[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to save NetCDF data on curvilinear grid?



Hi -
What you have done, saving the variable and its coordinate variables to the dataset, is what I think you would want.  As you did for the lon and lat variables, you could define the units and title for the rose variable also, so that the variables in the output dataset would have meaningful attributes, and you can add a coordinates attribute to the rose variable.
set var/title="LONGITUDE" clon_in[d=2]
set var/title="LATITUDE" clat_in[d=3]
set var/units=meters/title="Relief of the Surface of the Earth" rose[d=1]
define attribute/output topo.coordinates = clon_in, clat_in
save/clobber/file=Warn_in_ICM_Topography.nc rose[d=1],clon_in[d=2],clat_in[d=3]

See the CF standards document http://cf-pcmdi.llnl.gov/ for more about curvilinear coordinates.  The coordinates are listed in the coordinates attribute; the dimensions are what you see in parentheses after the variable name (for rectilinear datasets the coordinates and dimensions are generally the same; for curvilinear coordinates they are not).


On 3/2/2011 9:33 AM, Szymon Roziewski wrote:
Hi Ferreters!
I'm trying to save some data in 660 colums and 750 rows matrix which is
defined on curvilinear grid but I don't know how to do.

This is my ferret script:

DEFINE AXIS/x=1:660:1 xaxis
DEFINE AXIS/y=1:750:1 yaxis
DEFINE GRID/x=xaxis/y=yaxis gridlonlat
FILE/VARIABLES=rose/COLUMNS=660/GRID=gridlonlat
warnTopography660x750_1space.dat
FILE/VARIABLES=clon_in/COLUMNS=660/GRID=gridlonlat LonIcmWarn660x750.dat
FILE/VARIABLES=clat_in/COLUMNS=660/GRID=gridlonlat LatIcmWarn660x750.dat
set var/title="LONGITUDE" clon_in[d=2]
set var/title="LATITUDE" clat_in[d=3]

save/clobber/file=Warn_in_ICM_Topography.nc
rose[d=1],clon_in[d=2],clat_in[d=3]

First of all I read the data on some abstract grid (660x750) i.e. rose (main
data), clon_in (matrix of curvilinear longitudes), clat_in (matrix of
curvilinear latitudes).
Afterwards, I would like to save the rose data on curvilinear grid e.g.
rose(clon_in, clat_in) as NetCDF file.
How could I manage to do that?

Kind regards,
Szymon Roziewski


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement