[Thread Prev][Thread Next][Index]

RE: Sorting netCDF file?



Maybe you could try something using the netcdf operators.

http://nco.sourceforge.net/nco.html

ncks will pick out individual time slices, which can then be recombined with
ncrcat

You might be able to do it with a script that does someting like this.

dump list of time values from original file
sort list
loop over list
	extract time slice for time value with ncks
	concatenate on new file with ncrcat
end loop

Paul Farrar
Naval Oceanographic Office, N33

> -----Original Message-----
> From:	strandwg@ucar.edu [SMTP:strandwg@ucar.edu]
> Sent:	Friday, June 20, 2003 4:52 PM
> To:	Ferret Users Mailing List
> Subject:	Sorting netCDF file?
> 
> 
> FERRET doesn't like netCDF files with non-monotonically-increasing axis
> values,
> ie:
> 
> prompt>ferret
>         NOAA/PMEL TMAP
>         FERRET v5.51  
>         Solaris 5.8 - 02/28/03
>         20-Jun-03 15:49     
> 
> yes? use unsorted_time.nc 
>  *** NOTE: Coordinates out of order or missing on axis time at subscript 7
>  *** NOTE: A dummy axis of subscripts will be used
> yes? quit
> 
> I was wondering if anyone had a little utility that takes such a netCDF
> file
> and sorts the time axis (and all the variables which are defined on said
> axis) so it is monotonically increasing and all the variables are properly
> re-ordered as well.
> 
> I've started writing such a beast in F90 but I can see it's not trivial, I
> think.
> 
> Thanks.
> --
> /\        Gary Strand (303) 497-1336                                NCAR
> CG2260
>   \_][    www.cgd.ucar.edu/ccr/strandwg                    3080 Center
> Green Dr
>       \___strandwg@ucar.edu                       Boulder, Colorado, USA
> 80301


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement