[gradsusr] Reading CMAQ netcdf files in GrADS
Huddleston, John
Huddleston at cira.colostate.edu
Fri Dec 16 11:04:45 EST 2011
Arlindo
I am attaching a utility I wrote that will create a gridded polygon shapefile. I ran it with the commands:
grid2shp -1 984000 -2 '-384000' -x 112 -y 79 -s 12000 -o cmaqgrid
It created a shapefile called cmaqgrid which I then projected to WGS84 and then determined the extent of the grid in WGS84 space. The image is attached.
It is for North America Lambert Conformal Conic; so, users in other parts of the world should remove the PRJ file and copy in the appropriate projection file.
My first guess would be
dset ^file.ncf
dtype netcdf
title Vertically integrated atmos chem/aerosol vbles
pdef 112 79 lcc 32.95 -75.4 1 1 33 45 -97.00 12000 12000
undef -9999
xdef 112 linear -84.49 0.168
ydef 79 linear 32.95 0.15
zdef 1 linear 1 1
tdef 48 linear 00:00Z01jul2011 1dy
vars 1
AOD=>aod 1 t,z,y,x Aerosol Optical Depth
endvars
However, once I see the image in GrADS, I would tweak the numbers. The utility was statically built with MinGW. The source and Makefile is included for Linux users.
John Huddleston
From: arlindo.dasilva at gmail.com [mailto:arlindo.dasilva at gmail.com] On Behalf Of Arlindo da Silva
Sent: Thursday, December 15, 2011 12:55 PM
To: Huddleston, John
Cc: GrADS Users Forum
Subject: Reading CMAQ netcdf files in GrADS
Hi John,
Something tells me that you might know this. I have these CMAQ netcdf files from the DISCOVER-AQ campaign (see ncdump below). Do you happen to know the PDEF line that goes with these? I have the grid metrics in a separate file, I could always write some code to remap these, but if grads can do it on the fly it would be good enough for the exploratory data analysis that I need to perform.
Thanks,
Arlindo
-----
netcdf UMA_AOD {
dimensions:
TSTEP = UNLIMITED ; // (48 currently)
DATE-TIME = 2 ;
LAY = 1 ;
VAR = 1 ;
ROW = 79 ;
COL = 112 ;
variables:
int TFLAG(TSTEP, VAR, DATE-TIME) ;
TFLAG:units = "<YYYYDDD,HHMMSS>" ;
TFLAG:long_name = "TFLAG " ;
TFLAG:var_desc = "Timestep-valid flags: (1) YYYYDDD or (2) HHMMSS " ;
float AOD(TSTEP, LAY, ROW, COL) ;
AOD:long_name = "AOD " ;
AOD:units = "unitless " ;
AOD:var_desc = "AOD by Mie in VIS file " ;
// global attributes:
:IOAPI_VERSION = "$Id: @(#) ioapi library version 3.0 $ " ;
:EXEC_ID = "???????????????? " ;
:FTYPE = 1 ;
:CDATE = 2011182 ;
:CTIME = 164809 ;
:WDATE = 2011182 ;
:WTIME = 164809 ;
:SDATE = 2011182 ;
:STIME = 130000 ;
:TSTEP = 10000 ;
:NTHIK = 1 ;
:NCOLS = 112 ;
:NROWS = 79 ;
:NLAYS = 1 ;
:NVARS = 1 ;
:GDTYP = 2 ;
:P_ALP = 33. ;
:P_BET = 45. ;
:P_GAM = -97. ;
:XCENT = -97. ;
:YCENT = 40. ;
:XORIG = 984000. ;
:YORIG = -384000. ;
:XCELL = 12000. ;
:YCELL = 12000. ;
:VGTYP = 1 ;
:VGTOP = 200.f ;
:VGLVLS = 1.f, 0.9959855f ;
:GDNAM = "AQF_CONUS_5x " ;
:UPNAM = "setup " ;
:VAR-LIST = "AOD " ;
:FILEDESC = "hourly 1-layer cross-point Visibility Information
--
Arlindo da Silva
dasilva at alum.mit.edu<mailto:dasilva at alum.mit.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111216/8137d3b7/attachment-0003.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Grid2Shp.zip
Type: application/x-zip-compressed
Size: 103975 bytes
Desc: Grid2Shp.zip
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20111216/8137d3b7/attachment-0003.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmaqgrid.jpg
Type: image/jpeg
Size: 100779 bytes
Desc: cmaqgrid.jpg
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20111216/8137d3b7/attachment-0003.jpg
More information about the gradsusr
mailing list