<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">Folks<br>Didn't get any help the first time I tried the gradsusr list with this problem, so I thought I would give it another try. Currently, I have been using grads to convert GRIB to netCDF files
using lats4d. Basically,
when I convert from GRIB to netCDF, it skews the data. I input
something like this in the command line:<br><br>lats4d -i
narr-a_221_19790101_0000_000.sub -o narr_2005 -ftype ctl -lon -160 -90
-lat 25 65 -time 0z1jan2005 21z31dec2005 -mxtimes 2920 -levs 925mb
-xvars ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl tmp10m tmpprs<br><br>That will leaves me with geo height data at 925mb. Notice how I ask for data from
160 to 90W and from 25 to 65N. However, when I run the above code, it ends
up giving me data from 160 to 89.6667W and from 25 to 65.333N (The data
in the 3 hourly NCEP NARR dataset is every third degree, so it seems to
just add on an extra line of gridpoints, so I get a 122x212 matrix rather than 121x211). So on the first latitude line of 25N,
all the points are correct, until the very last point at 25N 89.667W.
Here, the program takes the value of the point that should be at
25.333N 160W, and sticks it at 25N 89.667W. An thus, on the 25.333N
array, all the values are shifted one place to the left from where they
should be. And the last 2 grid points of that line are taken from the 2
most left points on the next line up...and so on. I hope that makes
sense. Please let me know if you have any ideas or if you know anyone
that might know the answer or if there is a better way to convert GRIB to netCDF, though I would really like to make this work with GrADS! Thank you so much for any help. By they
way, I am using version 2.0.a8.oga.1 on a linux machine and I got lats4d from downloading it off surgeforce with the 2.0.a8.oga.1 bundle Here is my ctl file, as I
have suspicions that the answer lies in the PDEF part....I just don't
know how. I also included below the ctl file what happens when I run lats4d.sh in verbose mode as it shows that I truely am just asking for 160-90W and 25-65N. Thank you!!!<br><br>Regards,<br>Matt Brewer<br><br><br>dset
^narr-a_221_%y4%m2%d2_%h200_000.sub.grb<br>index ^narr-a_221_19790101_0000_000.sub.grb.idx<br>undef 9.999E+20<br>title narr-a_221_19790101_0000_000.sub.grb<br>* produced by grib2ctl v0.9.12.5p46<br>dtype grib 221<br>options template<br>pdef 349 277 lcc 1 -145.5 1 1 50 50 -107 32463 32463<br>xdef 1111 linear -250 0.333333<br>ydef 247 linear 8 0.333333<br>tdef 90584 linear 00Z01jan1979 3hr<br>* z has 3 levels, for prs<br>zdef 3 levels<br>925 850 500<br>vars 9<br>HGTprs 3 7,100,0 ** (profile) <span style="border-bottom: 2px dotted rgb(54, 99, 136); cursor: pointer;" class="yshortcuts" id="lw_1282244225_1"><span style="border-bottom: 2px dotted rgb(54, 99, 136); cursor: pointer;" class="yshortcuts" id="lw_1282585262_0">Geopotential height</span></span> [gpm]<br>MSLETmsl 0 130,102,0 ** mean-sea level Mean sea level pressure (ETA model) [Pa]<br>PRMSLmsl 0 2,102,0 ** mean-sea level Pressure reduced to MSL [Pa]<br>TMPprs 3 11,100,0 **
(profile) Temp. [K]<br>TMP10m 0 11,105,10 ** 10 m above ground Temp. [K]<br>UGRDprs 3 33,100,0 ** (profile) u wind
[m/s]<br>UGRD10m 0 33,105,10 ** 10 m above ground u wind [m/s]<br>VGRDprs 3 34,100,0 ** (profile) v wind
[m/s]<br>VGRD10m 0 34,105,10 ** 10 m above ground v wind [m/s]<br>ENDVARS<br><br><br><br>lats4d in verbose mode<br><br>3 drizzle% lats4d.sh -i narr-a_221_19790101_0000_000.sub -o narrtest -ftype ctl -v -lon -160 -90 -lat 25 65 -time 0z1jan2005 21z1jan2005 -levs 925mb -xvars ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl tmp10m tmpprs<br>/bin/ls: cannot access 1.*: No such file or directory<br>/opt/opengrads/grads -blc 'run lats4d.gs -q -i narr-a_221_19790101_0000_000.sub -o narrtest -ftype ctl -v -lon -160 -90 -lat 25 65 -time 0z1jan2005 21z1jan2005 -levs 925mb -xvars ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl tmp10m tmpprs '<br><br> Welcome to the OpenGrADS Bundle Distribution<br> --------------------------------------------<br><br>For additional information enter "grads
-h".<br><br>Starting "/opt/opengrads/Linux/Versions/2.0.a8.oga.1/i686/grads -blc 'run lats4d.gs -q -i narr-a_221_19790101_0000_000.sub -o narrtest -ftype ctl -v -lon -160 -90 -lat 25 65 -time 0z1jan2005 21z1jan2005 -levs 925mb -xvars ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl tmp10m tmpprs ' " ...<br><br><br>Grid Analysis and Display System (GrADS) Version 2.0.a8.oga.1<br>Copyright (c) 1988-2010 by Brian Doty and the <br>Institute for Global Environment and Society (IGES)<br>GrADS comes with ABSOLUTELY NO WARRANTY<br>See file COPYRIGHT for more information<br><br>Config: v2.0.a8.oga.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 opendap-grids,stn athena geotiff shapefile<br>Issue 'q config' command for more information.<br>Loading User Defined Extensions table </opt/opengrads/Linux/Versions/2.0.a8.oga.1/i686/gex/udxt> ... ok.<br>GX Package Initialization: Size = 11 8.5 <br>Running in Batch mode<br>lats4d: Version
2.1.5 of 28 June 2010<br>No hardcopy metafile open<br>All files closed; all defined objects released;<br>All GrADS attributes have been reinitialized<br>Notice: Implied interpolation for file narr-a_221_19790101_0000_000.sub<br> Interpolation will be performed on any data displayed from this file<br>lats4d: Data file is <br>File 1 : narr-a_221_19790101_0000_000.sub.grb<br> Descriptor: narr-a_221_19790101_0000_000.sub.ctl<br> Binary: narr-a_221_%y4%m2%d2_%h200_000.sub.grb<br> Type = Gridded<br> Xsize = 1111 Ysize = 247 Zsize = 3 Tsize = 90584 Esize = 1<br> Number of Variables = 9<br> hgtprs 3 7 ** (profile) Geopotential height [gpm]<br> msletmsl 0 130 ** mean-sea level Mean sea level pressure (ETA model) [Pa]<br> prmslmsl 0 2 ** mean-sea level Pressure reduced to MSL
[Pa]<br> tmpprs 3 11 ** (profile) Temp. [K]<br> tmp10m 0 11 ** 10 m above ground Temp. [K]<br> ugrdprs 3 33 ** (profile) u wind [m/s]<br> ugrd10m 0 33 ** 10 m above ground u wind [m/s]<br> vgrdprs 3 34 ** (profile) v wind [m/s]<br> vgrd10m 0 34 ** 10 m above ground v wind [m/s]<br><br>lats4d: Dimension environment file same as data file<br>lats4d: excluding variable msletmsl<br>lats4d: excluding variable prmslmsl<br>lats4d: excluding variable tmpprs<br>lats4d: excluding variable tmp10m<br>lats4d: excluding variable ugrdprs<br>lats4d: excluding variable ugrd10m<br>lats4d: excluding variable vgrdprs<br>lats4d: excluding variable vgrd10m<br>lats4d: creating LATS PARAMETER TABLE file
.grads.lats.table<br>lats4d: time range: 00Z01JAN2005 21Z01JAN2005 by 1, delta t: 3 hourly<br>lats4d: vertical levels: 925mb<br>lats4d: using PRESSURE for vertical coordinate<br>lats4d: latitudinal range: 25 65<br>lats4d: longitudinal range: -160 -90<br>lats4d: upper air variables: hgtprs<br>lats4d: writing to coards file narrtest.nc on 00Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 03Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 06Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 09Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 12Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 15Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 18Z01JAN2005<br>lats4d: writing to coards file narrtest.nc on 21Z01JAN2005<br>lats4d: created coards file narrtest.nc<br>lats4d: exiting from GrADS...<br>No hardcopy metafile open<br>GX package terminated <br><br><br><br><br><br><br><br>
</div></div>
</div><br>
</body></html>