National Oceanic and
Atmospheric Administration
United States Department of Commerce

Data on curvilinear grids

Data on curvilinear grids

Question:

I have data on a curvilinear grid. I don't understand how to interpret the coordinates.

Example:

Data from Ocean models such as ROMS and HYCOM compute and write data on curvilinear grids. There may be several related grids in a dataset. Use "ncdump -h" or the Ferret SHOW DATA and SHOW DATA/ATTRIBUTES command to examine the dataset. The data variables should have "coordinates" attributes to tell you what coordinate variables are to be used.

! Open the dataset and examine the contents. The dataset has several dozen varibles. (the URL shown is NOT a valid URL; it is shown only for its general form)

yes? use "http://server.edu:8080/thredds/dodsC/data/2008/data"
yes? show data
currently SET data sets:
1> http://server.edu:8080/thredds/dodsC/data/2008/data (default)
name title I J K L

...
LON_RHO longitude of RHO-points 1:224 1:254 ... ...
LAT_RHO latitude of RHO-points 1:224 1:254 ... ...
LON_U longitude of U-points 1:223 1:254 ... ...
LAT_U latitude of U-points 1:223 1:254 ... ...
...
MASK_RHO mask on RHO-points 1:224 1:254 ... ...
MASK_U mask on U-points 1:223 1:254 ... ...
...
U u-momentum component 1:223 1:254 1:36 1:367
V v-momentum component 1:224 1:253 1:36 1:367
W vertical momentum component 1:224 1:254 1:37 1:367
TEMP potential temperature 1:224 1:254 1:36 1:367
...

yes? sh att/all temp
attributes for dataset:

temp.long_name = potential temperature
temp.units = Celsius
temp.time = ocean_time
temp.coordinates = lat_rho lon_rho
temp._FillValue = 0

If we just plot the variable TEMP, the coordinates are simply indices, not longitudes and latitudes.

Use the curvilinear form of the graphics commands, specifying the curvilinear coordinate variables as shown in the coordinates attribute.

yes? fill/L=1/K=1 temp, lon_rho, lat_rho

The plot is on a longitude/latitude axes, so utility scripts such as "go land" will work fine:

yes? go land_detail

Often for coastal models the grid is quite fine, so the data used in Ferret's land-overlay and land-outline scripts are too coarse. The dataset itself may have MASK variables, which are 0 over land and 1 over ocean. Look for the mask variable with the same grid as our variable TEMP

yes? sh att/all mask_rho
attributes for dataset:

mask_rho.long_name = mask on RHO-points
mask_rho.option_0 = land
mask_rho.option_1 = water
mask_rho.coordinates = lat_rho lon_rho


yes? shade/over/palette=gray/nolabel (if mask_rho eq 0 then mask_rho), lon_rho, lat_rho

A final hint: Sometimes it's useful to just look at the curvilinear coordinate variables themselves.