[MITgcm-support] Re: Netcdf - coordinates
Baylor Fox-Kemper
baylor at MIT.EDU
Thu Oct 21 20:45:26 EDT 2004
Hi Laure,
You can also do wonders defining grids and variables within Ferret.
For example, I have a run that uses cartesian coordinates. I prefer to
work in kilometers and time in days, and I like the variables to appear
on the correct grids and with depth a positive number. Thus, after
opening my state.nc file, I do:
DEFINE AXIS/FROM_DATA/X/NAME=xcax/units=km xc[y=1]/1000
DEFINE AXIS/FROM_DATA/Y/NAME=ycax/units=km yc[x=1]/1000
DEFINE AXIS/FROM_DATA/z/NAME=zcax/units=m (-1)*rc
DEFINE AXIS/FROM_DATA/t/NAME=time/units=day model_time/86400
DEFINE GRID/x=xcax/y=ycax/z=zcax/t=time center
Then, I can set a particular variable to be the version of the model
variable on this grid, e.g.,
LET T=Temp[g=center at asn] !This defines a version of temperature
'assigned' to the grid
SET VARIABLE/title="Potential Temp."/units=Celsius T !This makes it
plot correctly
This framework is pretty flexible, so that you should be able, with a
little practice, be able to get some ferret scripts that will open and
plot your files as you'd like.
Cheers,
-Baylor
Ed Hill wrote:
>On Thu, 2004-10-21 at 13:04, Laure Zanna wrote:
>
>
>>Hi,
>>
>>I'm using the mnc package and ferret to look at the output. It seems that the coordinates are not correctly saved in the netcdf file. The x coordinate runs as 1E to 90E, y as 1N to 40N and z is just the number of level.
>>This make things a bit difficult when I'm trying to plot the streamfunctions in the different ocean
>>Thanks, Laure
>>
>>
>
>
>Hi Laure,
>
>The problem you're encountering is probably a mismatch between how
>Ferret interprets the NetCDF dimensions and variable names and how we
>interpret them. We're working to improve our support of the NetCDF
>conventions (aiming for eventual "CF" compatibility) and its taking time
>since none of the conventions appear to have a good conceptual model for
>some of the coordinate systems that we need to support (eg. the "cube
>sphere" grid).
>
>As a temporary work-around, I suggest that you use either MatLAB or the
>very convenient NCO ("NetCDF Operators") suite of utilities:
>
> http://nco.sourceforge.net/
>
>to change the variable and/or dimension names within your NetCDF files
>and/or to extract the portions of the files that you need to plot within
>Ferret. The most helpful of the NCO utilities for variable extraction
>and renaming is "ncks" which is described at:
>
> http://nco.sourceforge.net/nco.html#ncks
>
>Ed
>
>
>
More information about the MITgcm-support
mailing list