[gradsusr] UKMET

Wesley Ebisuzaki wesley.ebisuzaki at noaa.gov
Fri Mar 9 16:26:41 EST 2012


Brian,

   Works for me:

wgrib -GDS fh.0006_tl.tempr | grep
"GDS=0000b2002100ffff0049815f9000ea60800000000249f0ffff04e24000000000000200030005000600080009000b000c000e0010001100130014001600170019001a001c001d001e0020002100230024002600270028002a002b002c002d002f003000310032003300340036003700380039003a003b003c003c003d003e003f0040004100410042004300430044004500450046004600470047004700480048004800490049004900490049004900490049"
| wgrib fh.0006_tl.tempr -i -grib -o onegrid.grb

grib2ctl.pl -verf onegrid.grb >one.ctl
gribmap -i one.ctl
grads

Versions of code:
wgrib: v1.8.1.2a
/export/wesley/wd51we/bin/grib2ctl.pl 0.9.12.5p48
OS: linux

In the second wgrib, make sure you use a -i and not a -l.  If you are using
windows, you
may have hit a line-length limitation in their shell.  Make sure your
grib2ctl/wgrib are
new enough to support thinned lat-lon grids (5/2006).

    Wesley




On Fri, Mar 9, 2012 at 2:51 PM, Walsh, Brian J <brian.walsh at amec.com> wrote:

>  Thanks.****
>
> ** **
>
> Jennifer/Wesley,****
>
> ** **
>
> I tried to break up a UKMET grib file, as per tricks using wgrib (
> ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/tricks.wgrib) using #15
> (separating grids by GDS).  So, I did the command:****
>
> ** **
>
> wgrib –GDS fh.0006_tl.precp and I got the result below:****
>
> ** **
>
> 1:40:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff00490000000249f080015f9081d4c0ffff04e240000000000049004900490049004900490049004900480048004800470047004700460046004500450044004300430042004100410040003f003e003d003c003c003b003a003900380037003600340033003200310030002f002d002c002b002a0028002700260024002300210020001e001d001c001a0019001700160014001300110010000e000c000b000900080006000500030002
> ****
>
> 2:3759:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff0049815f9000ea60800000000249f0ffff04e24000000000000200030005000600080009000b000c000e0010001100130014001600170019001a001c001d001e0020002100230024002600270028002a002b002c002d002f003000310032003300340036003700380039003a003b003c003c003d003e003f0040004100410042004300430044004500450046004600470047004700480048004800490049004900490049004900490049
> ****
>
> 3:7478:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff0049815f900249f08000000081d4c0ffff04e24000000000000200030005000600080009000b000c000e0010001100130014001600170019001a001c001d001e0020002100230024002600270028002a002b002c002d002f003000310032003300340036003700380039003a003b003c003c003d003e003f0040004100410042004300430044004500450046004600470047004700480048004800490049004900490049004900490049
> ****
>
> 4:11629:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff0049815f9081d4c080000000807530ffff04e24000000000000200030005000600080009000b000c000e0010001100130014001600170019001a001c001d001e0020002100230024002600270028002a002b002c002d002f003000310032003300340036003700380039003a003b003c003c003d003e003f0040004100410042004300430044004500450046004600470047004700480048004800490049004900490049004900490049
> ****
>
> 5:15348:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff004900000000ea6080015f900249f0ffff04e240000000000049004900490049004900490049004900480048004800470047004700460046004500450044004300430042004100410040003f003e003d003c003c003b003a003900380037003600340033003200310030002f002d002c002b002a0028002700260024002300210020001e001d001c001a0019001700160014001300110010000e000c000b000900080006000500030002
> ****
>
> 6:19067:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff004900000080753080015f9000ea60ffff04e240000000000049004900490049004900490049004900480048004800470047004700460046004500450044004300430042004100410040003f003e003d003c003c003b003a003900380037003600340033003200310030002f002d002c002b002a0028002700260024002300210020001e001d001c001a0019001700160014001300110010000e000c000b000900080006000500030002
> ****
>
> 7:23218:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff004900000081d4c080015f90807530ffff04e240000000000049004900490049004900490049004900480048004800470047004700460046004500450044004300430042004100410040003f003e003d003c003c003b003a003900380037003600340033003200310030002f002d002c002b002a0028002700260024002300210020001e001d001c001a0019001700160014001300110010000e000c000b000900080006000500030002
> ****
>
> 8:27369:d=12030900:APCP:kpds5=61:kpds6=1:kpds7=0:TR=4:P1=0:P2=6:TimeU=1:sfc:0-6hr
> acc:NAve=2:GDS=0000b2002100ffff0049815f908075308000000000ea60ffff04e24000000000000200030005000600080009000b000c000e0010001100130014001600170019001a001c001d001e0020002100230024002600270028002a002b002c002d002f003000310032003300340036003700380039003a003b003c003c003d003e003f0040004100410042004300430044004500450046004600470047004700480048004800490049004900490049004900490049
> ****
>
> ** **
>
> So, to parse everything but the first entry, I did the trick command:****
>
> ** **
>
> wgrib fh.0006_tl.precp –GDS | grep
> “GDS=0000b2002100ffff00490000000249f080015f9081d4c0ffff04e240000000000049004900490049004900490049004900480048004800470047004700460046004500450044004300430042004100410040003f003e003d003c003c003b003a003900380037003600340033003200310030002f002d002c002b002a0028002700260024002300210020001e001d001c001a0019001700160014001300110010000e000c000b000900080006000500030002”
> | wgrib fh.0006_tl.precp –I –grib –o UKMET.grib****
>
> ** **
>
> where UKMET.grib is the name of the new grib file****
>
> ** **
>
> It completes the command, but says “bad input from stdin”.****
>
> ** **
>
> The resulting grib file does only contain this grid, but when I run
> grib2ctl on the file, it looks like this:****
>
> ** **
>
> dset ^UKMET.grib****
>
> index ^UKMET.grib.idx****
>
> undef 9.999E+20****
>
> title UKMET.grib****
>
> *  produced by grib2ctl v0.9.12.5p32amec****
>
> dtype grib 40****
>
> tdef 1 linear 06Z09mar2012 1mo****
>
> zdef 1 linear 1 1****
>
> vars 1****
>
> APCPsfc  0 61,1, 0  ** surface Total precipitation [kg/m^2]****
>
> ENDVARS****
>
> ** **
>
> So, it doesn’t have any X/Y coordinates.  Any ideas?****
>
> ** **
>
> Thanks****
>
> ** **
>
> Brian****
>
> ** **
>
> ** **
>
> *From:* gradsusr-bounces at gradsusr.org [mailto:
> gradsusr-bounces at gradsusr.org] *On Behalf Of *Jennifer Adams
> *Sent:* Thursday, January 19, 2012 7:18 PM
> *To:* GrADS Users Forum
> *Subject:* Re: [gradsusr] UKMET****
>
> ** **
>
> I grabbed a sample file: ****
>
>
> ftp://tgftp.nws.noaa.gov/SL.us008001/ST.opnl/MT.bmoav_CY.12/RD.20120119/PT.grid_DF.bb/fh.0006_tl.press
> ****
>
> ** **
>
> There are 3 different variables (grib codes 6, 7, and 102). Each variable
> has 8 records, each with a different grid, except for variable 102, which
> has 9. The ninth grid for variable 102 is a latlon grid with 1813 points,
> all the others are thinned grids with nxny=3447. Grib2ctl creates a pdef
> file for the thinned grid, presumably based on the grid specs it finds in
> record #1. I ran wgrib -V on this file and then grepped on 'grid=' and got
> this:****
>
> ** **
>
> rec 1:00040:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=44 tropopause 6hr fcst:****
>
> rec 2:05915:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=41 tropopause 6hr fcst:****
>
> rec 3:11790:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=43 tropopause 6hr fcst:****
>
> rec 4:17233:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=37 tropopause 6hr fcst:****
>
> rec 5:23108:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=39 tropopause 6hr fcst:****
>
> rec 6:28983:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=42 tropopause 6hr fcst:****
>
> rec 7:34858:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=38 tropopause 6hr fcst:****
>
> rec 8:40733:date 2012011912 PRES kpds5=1 kpds6=7 kpds7=0 levels=(0,0)
> grid=40 tropopause 6hr fcst:****
>
> ** **
>
> When checking for matches for PDEF'd grids, gribmap will check the nxny
> value to make sure it matches what the PDEF entry says, but doesn't go
> beyond that. The one latlon grid in the file does spawn an error from
> gribmap, "GRIB grid size does not match descriptor". Each of the 8 thinned
> grids will appear identical to gribmap, so they will all match, and the one
> that the index file will point to will be the last record in the file to
> match, which will not likely correspond to the information used to create
> the pdef file. Wesley's suggestion to break up the file and separate out
> the nine different grids is the only way this data can be read with GrADS.
> ****
>
> --Jennifer****
>
> ** **
>
> ** **
>
> On Dec 16, 2011, at 5:06 PM, Wesley Ebisuzaki wrote:****
>
>
> **
> ******
>
> Brian,
>
> Looks like a problem with gribmap in GrADS v2.
>
> The files have several different grids in them. GrADS should check that
> the grid
> matches the grid in the ctl file (it does with grib1). It doesn't so all
> the grids match
> and you can plot the wrong data. :(
>
> Options: grib1, delete all but one of the grids.
>
> **
> ******
>
> 18.1: lev1=101,0 var=0,3,1 MATCH****
>
> 19.1: lev1=101,0 var=0,3,1 MATCH****
>
>  20.1: lev1=101,0 var=0,3,1 MATCH****
>
>  21.1: lev1=101,0 var=0,3,1 MATCH****
>
>  22.1: lev1=101,0 var=0,3,1 MATCH****
>
>  23.1: lev1=101,0 var=0,3,1 MATCH****
>
>  24.1: lev1=101,0 var=0,3,1 MATCH****
>
>  25.1: lev1=101,0 var=0,3,1 MATCH****
>
>  grib2map: Writing out the index file****
>
> Wesley
>
>
>
> Walsh, Brian J wrote:
> **
> ******
>
> ** **
>
> Hi,****
>
>  ** **
>
>  I’m wondering if anyone has been able to plot the UKMET grib data ****
>
>  available on the TGFTP ftp site ****
>
>  (ftp://tgftp.nws.noaa.gov/SL.us008001/ST.opnl/MT.bmoav_CY.12/) using ****
>
>  GrADS. It is a thinned lat-long grid and I am able to convert it to a ***
> *
>
>  GRIB2 file using cnvgrib and run wgrib2 on the files, but it’s not ****
>
>  plotting. Just wanted to see if anyone had success plotting these ****
>
>  files and how it was accomplished.****
>
>  ** **
>
>  Thanks****
>
>  ** **
>
>  Brian****
>
>  ** **
>
>  ** **
>
>  The information contained in this e-mail is intended only for the ****
>
>  individual or entity to whom it is addressed.****
>
>  Its contents (including any attachments) may contain confidential ****
>
>  and/or privileged information.****
>
>  If you are not an intended recipient you must not use, disclose, ****
>
>  disseminate, copy or print its contents.****
>
>  If you receive this e-mail in error, please notify the sender by reply **
> **
>
>  e-mail and delete and destroy the message.****
>
>  ------------------------------------------------------------------------*
> ***
>
>  ** **
>
>  _______________________________________________****
>
>  gradsusr mailing list****
>
>  gradsusr at gradsusr.org****
>
>  http://gradsusr.org/mailman/listinfo/gradsusr****
>
>  ** **
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr****
>
> ** **
>
> --****
>
> Jennifer M. Adams****
>
> IGES/COLA****
>
> 4041 Powder Mill Road, Suite 302****
>
> Calverton, MD 20705****
>
> jma at cola.iges.org****
>
> ** **
>
> ** **
>
> ** **
>
> ------------------------------
> The information contained in this e-mail is intended only for the
> individual or entity to whom it is addressed.
> Its contents (including any attachments) may contain confidential and/or
> privileged information.
> If you are not an intended recipient you must not use, disclose,
> disseminate, copy or print its contents.
> If you receive this e-mail in error, please notify the sender by reply
> e-mail and delete and destroy the message.
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120309/9f639ae4/attachment-0003.html 


More information about the gradsusr mailing list