[gradsusr] lats4d issues

Matt Brewer mcbrewer83 at yahoo.com
Mon Aug 9 11:38:28 EDT 2010


So the version of GrADS that I am using is Version 2.0.a8.oga.1. I have been 
using the ctl file called narr-a_221_19790101_0000_000.sub.ctl to display the 
grib files in GrADS and it has been working beautifully. The control file is the 
following:


dset ^narr-a_221_%y4%m2%d2_%h200_000.sub.grb
index ^narr-a_221_19790101_0000_000.sub.grb.idx
undef 9.999E+20
title narr-a_221_19790101_0000_000.sub.grb
*  produced by grib2ctl v0.9.12.5p46
dtype grib 221
options template
pdef 349 277 lcc 1 -145.5 1 1 50 50 -107 32463 32463
xdef 1111 linear -250 0.333333
ydef 247 linear 8 0.333333
tdef 90584 linear 00Z01jan1979 3hr
*  z has 3 levels, for  prs
zdef 3 levels
925 850 500
vars 9
HGTprs 3 7,100,0 ** (profile) Geopotential height [gpm]
MSLETmsl  0 130,102,0 ** mean-sea level Mean sea level pressure (ETA model) [Pa]
PRMSLmsl  0 2,102,0 ** mean-sea level Pressure reduced to MSL [Pa]
TMPprs 3 11,100,0 ** (profile) Temp. [K]
TMP10m  0 11,105,10 ** 10 m above ground Temp. [K]
UGRDprs 3 33,100,0 ** (profile) u wind [m/s]
UGRD10m  0 33,105,10 ** 10 m above ground u wind [m/s]
VGRDprs 3 34,100,0 ** (profile) v wind [m/s]
VGRD10m  0 34,105,10 ** 10 m above ground v wind [m/s]
ENDVARS

I downloaded the GRIB files from the NCEP NARR dataset, then used grib2ctl to 
get the ctl file. This is pre-projected data, the pdef is shown above. After 
more troubleshooting, this is what seems to occur. When I use lats4d to make a 
netCDF file from the grib files, and I ask for data that is inside of the 
reference longitude (-145.5) and standard longitude(-107) as shown in pdef, 
lats4d just plain doens't work. I use the command line
lats4d -i narr-a_221_19790101_0000_000.sub -o narr2009.nc -ftype ctl -lon -145 
-110 -lat 25 60  -time 0z1jan2009 21z31dec2009 -mxtimes 2920 -levs 925mb -xvars 
ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl
and it just thinks for a little bit, then shuts grads off. 
When I use that same command line but make it outside of the reference and 
standard longitudes, lats4d sort of works. For example, if I ask for data from 
-160 to -90, and from 25N to 65N, I ends up giving me data from -160 to -89.667 
and from 25N to 65.333N. The data that I am using is every third degree. So when 
I compare the grib file to the netCDF file, the point that is 25N -89.666 in the 
netCDF file is the same point as 25.333N -160W in the grib file. So somehow, 
lats4d is making an extra array place, and filling it with what is at the 
begginning of the array above it. What is going on???
Thank you so much for any suggestions you might have!
Matt





________________________________
From: Arlindo da Silva <dasilva at alum.mit.edu>
To: GrADS Users Forum <gradsusr at gradsusr.org>
Sent: Wed, August 4, 2010 7:44:53 PM
Subject: Re: [gradsusr] lats4d issues

On Mon, Aug 2, 2010 at 1:59 PM, Matt Brewer <mcbrewer83 at yahoo.com> wrote:

Folks,
>I am using lats4d to convert NCEP's NARR data (grib) to netCDF. It only kind of 
>worked. This is what I type into the command line: 
>
>
>lats4d -i narr-a_221_19790101_0000_000.sub -o narr2009.nc -ftype ctl -lon -160 
>-90 -lat 25 65  -time 0z1jan2009 21z31dec2009 -mxtimes 2920 -levs 925mb -xvars 
>ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl
>
>This works fine except for one issue. It seems to be totally messing up the axis 
>dimensions, causing data to be in incorrect lat/lon locations.Notice how I asked 
>for data from 160W to 90W and 25N to 65N, so with the longitude, that is a span 
>of 70 degrees, and for latitude, it is 40 degrees. So I should get back a 
>geopot. height matrix of 121x211 (there are data points every 1/3rd degree). It 
>seems, in matlab at least, that I get  an array of 122x212. And so what happens 
>is the first point on the second array actually gets saved in the 212th place in 
>the first array, so the second line starts out with what is supose to be the 
>second point in the array. Make sense? When I put the nc file into grads, it has 
>similar issues as well....so something wierd is going on when I run the lats4d 
>script....I just don't know what. So if anyone has any ideas of what is goin on, 
>please help!!!
>
>

The first step is to make sure GrADS is reading your GRIB file correctly. Go 
ahead, start GrADS, open your GRIB file, plot it and see if it is doing it 
correctly:

ga-> open narr-a_221_19790101_0000_000.sub
ga-> d something

If this is pre-projected data, make sure your PDEF is correct. Once you sort 
this out, the netcdf version should produce the same results. (Our regression 
tests do just that: reads a GRIB file, converts to netcdf, then reads the netcdf 
file back and checks if it gets exactly the same values.)

One important detail: when asking for help, you need to let us know the 
particular version of grads, lats4d, and your operating system; basically, the 
otput of "q config".

   Arlindo


 
Matt
>
>
>_______________________________________________
>gradsusr mailing list
>gradsusr at gradsusr.org
>http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Arlindo da Silva
dasilva at alum.mit.edu



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100809/616f52d6/attachment-0003.html 


More information about the gradsusr mailing list