[RegCNET] Deciphering OUT_HEAD.CTL

Sara Rauscher rauscher at lanl.gov
Thu Nov 19 19:22:04 CET 2009


Hi Maurice-

You should check out the PDEF documentation at the grads web site:
http://grads.iges.org/grads/gadoc/pdef.html
See "How PDEF Grid Interpolation Works"

Basically PDEF defines your native grid, and grads bilinearly 
interpolates the data to a rectilinear lat/lon grid that is described by 
x and y (a window). You can change XDEF and YDEF to be whatever you want 
- they don't have to match the grid size of the native model grid, 
because grads does an interpolation to the grid defined by xdef and 
ydef. This is why when you open a file with PDEF in the .ctl file you 
get a message from grads that reads

"Notice: Implied interpolation for file w5kn2.1999.rain.ctl
 Interpolation will be performed on any data displayed from this file"

In terms of usable data - I am not sure what you mean by this. What 
information are you trying to get?

If you convert the file to netcdf, the lat/lon coordinates will not be 
correct, because they are two dimensional in reality (xlat and xlon), 
not one dimensional. In any graphics program, you have to give 
information about the projection and the 2d coordinates. In grads, you 
do this with PDEF. If you have a netcdf file, you can create a data 
descriptor file and use that to display the data - see the regcm tutorial at
http://users.ictp.it/RegCNET/tut4.html

In NCL for plotting, you can give the 2d xlat and xlon as the "corners" 
for the plot - see
http://es.ucsc.edu/~msnyder/NCL/nclplot.html

There's also routines in NCL to convert data on a RCM grid to a regular 
lat-lon grid, and vice versa, see
http://www.ncl.ucar.edu/Document/Functions/regrid.shtml

rcm2points     Interpolates curvilinear grids (RCM, WRF, NARR) to user 
specified locations.
rcm2points_Wrap     Interpolates curvilinear grids (RCM, WRF, NARR) to 
user specified locations and retains meta data.
rcm2rgrid     Interpolates RCM, WRF and NARR grids to rectilinear 
lat/lon grids.
rcm2rgrid_Wrap     Interpolates RCM, WRF and NARR grids to rectilinear 
lat/lon grid and retains meta data.
rgrid2rcm     Interpolates a rectilinear lat/lon grid to curvilinear 
grids like those used by the RCM, WRF and NARR models/datasets.

As for CDO, I am not very familiar with that software and how it can 
handle rcm data...sorry. You can certainly process netcdf files with it 
(as you would with NCO), but to display the data from the file,  you 
need to give the software information about the projection as described 
above.

hope this helps,
cheers
sara




Maurice.McHugh at noaa.gov wrote:
> Hello everyone,
>
> I'm trying to understand why in OUT_HEAD.CTL the pdef line states my correct grid sizes (nx,ny), but the xdef and ydef lines which should state the same grid size are different.
>
> For example,
> <snip>
> pdef   58   58 lcc   38.89  -77.00   29.00   29.00   30.00   60.00  -77.00  10000.  10000.
> xdef  166 linear  -80.65  0.0450
> ydef  126 linear   36.11  0.0450
> </snip>
>
> In the above case the 58x58 nature of my grid is correctly specified in pdef, but not in xdef nor ydef which give a 166x126 grid.  
>
> In order to better understand the file I went ahead converted the data to netCDF using CDO (climate data operators) and plotted markers at the intersection of xlong and xlat from OUT_HEAD.CTL but when plotted they produced a straight line.  I'm unsure whether this is a CDO translation artifact, or if my understanding of the contents of the OUT_HEAD.CTL file is woefully inadequate.
>
> Any insight to correctly extracting usable data from this file would be much appreciated!
>
> Regards,
>
> Maurice
>
> _______________________________________________
> RegCNET mailing list
> RegCNET at lists.ictp.it
> https://lists.ictp.it/mailman/listinfo/regcnet
>   


-- 
Sara A. Rauscher
T-3 Fluid Dynamics
MS B216
Los Alamos National Lab
Los Alamos, NM 87545 USA
(505) 606-0512




More information about the RegCNET mailing list