[gradsusr] g2grb help

Wesley Ebisuzaki - NOAA Federal wesley.ebisuzaki at noaa.gov
Fri Nov 22 10:27:08 EST 2024


Robert,
  A bug was introduced into wgrib2's import_ieee routine when it was
parallelized to make it faster.  This broke g2grb.gs which uses
-import_ieee.
A fix for intel/amd cpus is to edit g2grb.gs

old:  'set fwrite -sq -be ' filetmp
new: 'set fwrite -sq -le ' filetmp
Change -import_ieee to -import_bin  in two lines.

It's not portable to big_endian machines but it is faster.  The -import_ieee
fix will be in the next release.
Wesley



On Fri, Nov 22, 2024 at 10:01 AM Robert Mulloy <Robert.Mulloy at calpine.com>
wrote:

> Hi Grads User List I'm looking for some help with g2grb.
>
> I am trying to save 500mb height anomaly fields to a grib file and I've
> tried the following g2grb commands and all of the files are empty. The
> script runs w/out issue; the output from the runs are below.
>
> Am I looking for the wrong variable? The input files are 500mb fields with
> one field being GP500mb and the other being Z500mb. When I run d
> smth9(GP500mb.1 - Z500mb.2) I get a series of height anomaly maps for all
> 21 timesteps.  I'm using the default template.grb2 template.
>
> define anomaly=(GP500mb.1 - Z500mb.2)
>
> g2grb anomaly GP_Var.grib d=2024102300:GP:500 mb:24 hour fcst
> g2grb anomaly HGT_Var.grib d=2024102300:HGT:500 mb:24 hour fcst
>
> For GP
> ga-> g2grb anomaly GP_Var.grib d=2024102300:GP:500 mb:6 hour fcst
> dlon=0.25 nx = 1441 lon0 = 0
> Y is varying   Lat = -90 to 90   Y = 1 to 721
> dlat=0.25 ny = 721 lat0 = -90
> new grads found undef=-999000000.000000
> making template file
> ! /home/rm11714/wgrib2 /Archive/grib/template.grb2 -d 1 -lola 0:1441:0.25
> -90:721:0.25 GP_Var.grib.template grib
> 1:0:d=2009080100:var discipline=0 master_table=2 parmcat=255
> parm=255:no_level:-2147483647 missing fcst:
> opening fwrite GP_Var.grib.tmp
> going to display anomaly
> result is Wrote 1038961 of 1038961 elements to GP_Var.grib.tmp as
> Sequential Big_Endian
>
> metadata = 1:0:d=2024102300:GP:500 mb:6 hour fcst:
> ! /home/rm11714/wgrib2  GP_Var.grib.template -import_ieee GP_Var.grib.tmp
> -set_metadata GP_Var.grib.inv -undefine_val -999000000.000000 -grib_out
> GP_Var.grib
> 1:0:d=2024102300:GP:500 mb:6 hour fcst:
>
> !rm GP_Var.grib.tmp GP_Var.grib.inv
> !rm GP_Var.grib.template
>
> For HGT
> ga-> g2grb anomaly HGT_Var.grib d=2024102300:HGT:500 mb:6 hour fcst
> dlon=0.25 nx = 1441 lon0 = 0
> Y is varying   Lat = -90 to 90   Y = 1 to 721
> dlat=0.25 ny = 721 lat0 = -90
> new grads found undef=-999000000.000000
> making template file
> ! /home/rm11714/wgrib2 /Archive/grib/template.grb2 -d 1 -lola 0:1441:0.25
> -90:721:0.25 HGT_Var.grib.template grib
> 1:0:d=2009080100:var discipline=0 master_table=2 parmcat=255
> parm=255:no_level:-2147483647 missing fcst:
> opening fwrite HGT_Var.grib.tmp
> going to display anomaly
> result is Wrote 1038961 of 1038961 elements to HGT_Var.grib.tmp as
> Sequential Big_Endian
>
> metadata = 1:0:d=2024102300:HGT:500 mb:6 hour fcst:
> ! /home/rm11714/wgrib2  HGT_Var.grib.template -import_ieee
> HGT_Var.grib.tmp -set_metadata HGT_Var.grib.inv -undefine_val
> -999000000.000000 -grib_out HGT_Var.grib
> 1:0:d=2024102300:HGT:500 mb:6 hour fcst:
>
> !rm HGT_Var.grib.tmp HGT_Var.grib.inv
> !rm HGT_Var.grib.template
>
> Thanks for the look
>
> Rob
> COMPANY CONFIDENTIALITY NOTICE: The information in this e-mail may be
> confidential and/or privileged and protected by work product immunity or
> other legal rules. No confidentiality or privilege is waived or lost by
> mis-transmission. If you are not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> review, dissemination, or copying of this e-mail and its attachments, if
> any, or the information contained herein is prohibited. If you have
> received this e-mail in error, please immediately notify the sender by
> return e-mail and delete this e-mail from your computer system.
> _______________________________________________
> 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/20241122/1ae130bd/attachment-0001.html>


More information about the gradsusr mailing list