[ncl-talk] Confusion on GFS files in GRIB2

Dennis Shea shea at ucar.edu
Tue Mar 9 13:26:13 MST 2021


Ummm,  Looks like a truncated file.
======
Please make the file available.

One approach would be to ftp the file:

ftp ftp.cgd.ucar.edu
anonymous
your_email
cd incoming
put gfs.t00z.pgrb2.0p25.f000
quit

*After* a successful file transfer,  email me directly.

On Tue, Mar 9, 2021 at 12:15 PM <dr.hieronymus at posteo.net> wrote:

> Hello,
>
> Thanks for your advices.
>
> I am using ncl 6.4.0 on Ubuntu 18.04.5 LTS.
>
> First of all I realized that the GFS file extension has to be .grb2.
> Otherwise ncl cannot read the file.
>
> I get the following output by using the command: ncl_filedump
> gfs.t00z.pgrb2.0p25.f000.grb2
>
> I'm still confused since I get the error/warning regarding the grid.
> Moreover, there is no variable named TMP_P0_L103_GLL0.
>
> What is broken?
>
> Thanks in advance.
>
>   Copyright (C) 1995-2017 - All Rights Reserved
>   University Corporation for Atmospheric Research
>   NCAR Command Language Version 6.4.0
>   The use of this software is governed by a License Agreement.
>   See http://www.ncl.ucar.edu/ for more details.
> fatal:GdsCEGrid: Invalid grid detected
> fatal:NclGRIB2: Couldn't handle dimension information returned by grid
> decoding
> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> error
> fatal:GdsCEGrid: Invalid grid detected
> fatal:NclGRIB2: Couldn't handle dimension information returned by grid
> decoding
> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> error
> fatal:GdsCEGrid: Invalid grid detected
> ...
> ...
> ...
> fatal:GdsCEGrid: Invalid grid detected
> fatal:NclGRIB2: Couldn't handle dimension information returned by grid
> decoding
> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> error
> fatal:GdsCEGrid: Invalid grid detected
> fatal:NclGRIB2: Couldn't handle dimension information returned by grid
> decoding
> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> error
>
> Variable: f
> Type: file
> filename:       gfs.t00z.pgrb2.0p25.f000
> path:   gfs.t00z.pgrb2.0p25.f000.grb2
>     file global attributes:
>     dimensions:
>        lv_ISBL0 = 34
>        lv_AMSL1 = 3
>        lv_HTGL2 = 3
>        lv_PVL3 = 2
>        lv_HTGL4 = 2
>        lv_ISBL5 = 31
>        lv_SIGL6 = 4
>        lv_ISBL7 = 22
>        lv_HTGL8 = 7
>        lv_ISBL9 = 21
>        lv_ISBL10 = 29
>        lv_SPDL11 = 2
>        lv_ISBL12 = 24
>        lv_DBLL13 = 4
>     variables:
>        float lv_DBLL13_l1 ( lv_DBLL13 )
>           long_name :   Depth below land surface
>           units :       m
>
>        float lv_DBLL13_l0 ( lv_DBLL13 )
>           long_name :   Depth below land surface
>           units :       m
>
>        float lv_ISBL12 ( lv_ISBL12 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>        float lv_SPDL11_l1 ( lv_SPDL11 )
>           long_name :   Level at specified pressure difference from ground
> to level
>           units :       Pa
>
>        float lv_SPDL11_l0 ( lv_SPDL11 )
>           long_name :   Level at specified pressure difference from ground
> to level
>           units :       Pa
>
>        float lv_ISBL10 ( lv_ISBL10 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>        float lv_ISBL9 ( lv_ISBL9 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>        float lv_HTGL8 ( lv_HTGL8 )
>           long_name :   Specified height level above ground
>           units :       m
>
>        float lv_ISBL7 ( lv_ISBL7 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>        float lv_SIGL6_l1 ( lv_SIGL6 )
>           long_name :   Sigma level (sigma value)
>           units :       none
>
>        float lv_SIGL6_l0 ( lv_SIGL6 )
>           long_name :   Sigma level (sigma value)
>           units :       none
>
>        float lv_ISBL5 ( lv_ISBL5 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>        float lv_HTGL4 ( lv_HTGL4 )
>           long_name :   Specified height level above ground
>           units :       m
>
>        float lv_PVL3 ( lv_PVL3 )
>           long_name :   Potential vorticity
>           units :       K m2 kg-1 s-1
>
>        float lv_HTGL2 ( lv_HTGL2 )
>           long_name :   Specified height level above ground
>           units :       m
>
>        float lv_AMSL1 ( lv_AMSL1 )
>           long_name :   Specific altitude above mean sea level
>           units :       m
>
>        float lv_ISBL0 ( lv_ISBL0 )
>           long_name :   Isobaric surface
>           units :       Pa
>
>
>
>
>
>
> Am 09.03.2021 05:10 schrieb Lyndz:
> > Hello,
> >
> > In addition to Sir Dennis' reply.
> >
> > *[1] *If you want to plot the surface temperature, use the
> > *TMP_P0_L103_GLL0*
> >
> >
> > *Variable: temp*
> >
> > *Type: float*
> >
> > *Total Size: 4152960 bytes*
> >
> > *            1038240 values*
> >
> > *Number of Dimensions: 2*
> >
> > *Dimensions and sizes: [lat_0 | 721] x [lon_0 | 1440]*
> >
> > *Coordinates: *
> >
> > *            lat_0: [90..-90]*
> >
> > *            lon_0: [ 0..359.75]*
> >
> > *Number Of Attributes: 14*
> >
> > *  initial_time : 11/10/2020 (00:00)*
> >
> > *  forecast_time_units : hours*
> >
> > *  forecast_time : 3*
> >
> > *  level_type : Specified height level above ground (m)*
> >
> > *  parameter_template_discipline_category_number : ( 0, 0, 0, 0 )*
> >
> > *  parameter_discipline_and_category : Meteorological products,
> > Temperature*
> >
> > *  grid_type : Latitude/longitude*
> >
> > *  units : K*
> >
> > *  long_name : Temperature*
> >
> > *  production_status : Operational products*
> >
> > *  center : US National Weather Service - NCEP (WMC)*
> >
> > *  lv_HTGL2 : 2*
> >
> > *  _FillValue : 1e+20*
> >
> > *  level : 0*
> >
> >
> >
> > *[2] *Check this simple explanation from David Brown's reply in one of
> > the
> > posts here:
> >
> >
> > https://mailman.ucar.edu/pipermail/ncl-talk/2015-December/004772.html
> >
> >
> >
> > *[3] *Have a look at NCL's sample scripts for plotting GRIB2 files
> > here:
> >
> >
> > http://www.ncl.ucar.edu/Training/Workshops/UMaine/Scripts/Plymouth/
> >
> >
> >
> >
> > Sincerely,
> >
> >
> > Lyndz
> >
> >
> >
> > On Tue, Mar 9, 2021 at 5:19 AM Dennis Shea <shea at ucar.edu> wrote:
> >
> >> [1] Please: Always include the version of NCL you are using.
> >>
> >> %> ncl -V
> >>
> >> The most recent version is 6.6.2
> >>
> >> [2] Before processing, you can examine a GRIB file's contents via:
> >>
> >> %> *ncl_filedump* gfs.t00z.pgrb2.0p25.f001.grb | less
> >>
> >> Do you see a variable named "TMP_P0_L102_GLL0" ?
> >>
> >> [3]
> >>
> >> grib_file = "gfs.t00z.pgrb2.0p25.f001"   + ".grb"
> >> fin = addfile(grib_file, "r")
> >> varnames = getfilevarnames(fin)
> >> print(varnames)
> >>
> >> The output you included shows only vertical dimension variables:  lv_*
> >> (0)     lv_DBLL14_l1
> >> (1)     lv_DBLL14_l0
> >> (2)     lv_ISBL13
> >>          ......SNIP ......
> >> (15)    lv_HTGL2
> >> (16)    lv_AMSL1
> >> (17)    lv_ISBL0
> >>
> >>
> >> Then, NCL tells you that the variable *TMP_P0_L102_GLL0* *is not in
> >> the
> >> grib file *
> >>
> >>
> >>
> >> On Mon, Mar 8, 2021 at 1:35 PM dr.hieronymus--- via ncl-talk <
> >> ncl-talk at mailman.ucar.edu> wrote:
> >>
> >>> Hi,
> >>>
> >>> Regarding the GFS files, I have written to NCEP. Thanks, that was a
> >>> good
> >>> idea.
> >>>
> >>> When using following code:
> >>>
> >>> ;;; load ncl scripts/files
> >>> load "/usr/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> >>> load "/usr/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> >>> load "/usr/lib/ncarg/nclscripts/csm/contributed.ncl"
> >>>
> >>> begin
> >>>
> >>> ;;; read data from grib file
> >>> grib_file = "gfs.t00z.pgrb2.0p25.f001"
> >>> fin = addfile(grib_file, "r")
> >>> varnames = getfilevarnames(fin)
> >>>
> >>> print(varnames)
> >>> printVarSummary(fin->TMP_P0_L102_GLL0)
> >>>
> >>> ;;; get variables: level, variable, longitude, latitude
> >>> ;t2m = fin->TMP_P0_L102_GLL0(:,:)
> >>> ;lon = fin->lon
> >>> ;lat = fin->lat
> >>>
> >>> ;;; convert to degrees
> >>> ;t2m = t2m-273.15
> >>>
> >>> end
> >>>
> >>> I get the following error message:
> >>>
> >>> warning:NclGRIB2: APCP_P8_L1 contains records that NCL cannot
> >>> currently
> >>> differentiate. One or more records will be ignored.
> >>> warning:NclGRIB2: ACPCP_P8_L1 contains records that NCL cannot
> >>> currently
> >>> differentiate. One or more records will be ignored.
> >>> fatal:GdsCEGrid: Invalid grid detected
> >>> fatal:NclGRIB2: Couldn't handle dimension information returned by
> >>> grid
> >>> decoding
> >>> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> >>> error
> >>> fatal:GdsCEGrid: Invalid grid detected
> >>> fatal:NclGRIB2: Couldn't handle dimension information returned by
> >>> grid
> >>> decoding
> >>> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> >>> error
> >>> ...
> >>> ...
> >>> ...
> >>> fatal:GdsCEGrid: Invalid grid detected
> >>> fatal:NclGRIB2: Couldn't handle dimension information returned by
> >>> grid
> >>> decoding
> >>> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> >>> error
> >>> fatal:GdsCEGrid: Invalid grid detected
> >>> fatal:NclGRIB2: Couldn't handle dimension information returned by
> >>> grid
> >>> decoding
> >>> fatal:NclGRIB2: Deleting reference to parameter because of decoding
> >>> error
> >>>
> >>>
> >>> Variable: varnames
> >>> Type: string
> >>> Total Size: 144 bytes
> >>>              18 values
> >>> Number of Dimensions: 1
> >>> Dimensions and sizes:   [18]
> >>> Coordinates:
> >>> (0)     lv_DBLL14_l1
> >>> (1)     lv_DBLL14_l0
> >>> (2)     lv_ISBL13
> >>> (3)     lv_ISBL12
> >>> (4)     lv_SPDL11_l1
> >>> (5)     lv_SPDL11_l0
> >>> (6)     lv_ISBL10
> >>> (7)     lv_ISBL9
> >>> (8)     lv_HTGL8
> >>> (9)     lv_ISBL7
> >>> (10)    lv_SIGL6_l1
> >>> (11)    lv_SIGL6_l0
> >>> (12)    lv_ISBL5
> >>> (13)    lv_HTGL4
> >>> (14)    lv_PVL3
> >>> (15)    lv_HTGL2
> >>> (16)    lv_AMSL1
> >>> (17)    lv_ISBL0
> >>> fatal:["Execute.c":6397]:variable (TMP_P0_L102_GLL0) is not in file
> >>> (fin)
> >>> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 14
> >>> in
> >>> file temperature_tmp.ncl
> >>>
> >>> Do I understand correctly that ncl has detected an invalid grid? Why?
> >>>
> >>> Thanks.
> >>>
> >>>
> >>>
> >>> Am 08.03.2021 16:44 schrieb Lyndz:
> >>> > Hi,
> >>> >
> >>> > I'm not sure if this is an ncl question. You should have directed
> your
> >>> > questions to the ncep help page (
> >>> > https://www.ncep.noaa.gov/mail_dataquestions/)
> >>> >
> >>> > *[1] *As far as I know, the .anl files are analyses files and were
> >>> > already
> >>> > assimilated with observations.
> >>> >
> >>> > *[2]* If you want to use the forecast, then use the files with the
> >>> > following format (
> >>> >
> >>>
> https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.20210308/12/
> >>> ):
> >>> >
> >>> > gfs.t12z.pgrb2.0p25.f000
> >>> > <
> >>>
> https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.20210308/12/gfs.t12z.pgrb2.0p25.f000
> >>> >
> >>> >
> >>> > gfs.t12z.pgrb2.0p25.f001
> >>> > <
> >>>
> https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.20210308/12/gfs.t12z.pgrb2.0p25.f001
> >>> >
> >>> >
> >>> > etc..
> >>> >
> >>> > No need to download the other files!
> >>> >
> >>> > ncl_filedump gfs.t12z.pgrb2.0p25.f000.grb will give you the contents
> >>> > of the file.
> >>> >
> >>> > If you want temperature, then look for the keyword "Temperature".
> This
> >>> > will give u information about the variables such as below:
> >>> >
> >>> > float TMP_P0_L102_GLL0 ( lv_AMSL1, lat_0, lon_0 )
> >>> >
> >>> >          center :       US National Weather Service - NCEP (WMC)
> >>> >
> >>> >          production_status :    Operational products
> >>> >
> >>> >          long_name :    Temperature
> >>> >
> >>> >          units :        K
> >>> >
> >>> >          _FillValue :   1e+20
> >>> >
> >>> >          grid_type :    Latitude/longitude
> >>> >
> >>> >          parameter_discipline_and_category :    Meteorological
> >>> > products, Temperature
> >>> >
> >>> >          parameter_template_discipline_category_number :        ( 0,
> 0,
> >>> > 0, 0 )
> >>> >
> >>> >          level_type :   Specific altitude above mean sea level (m)
> >>> >
> >>> >          forecast_time :        72
> >>> >
> >>> >          forecast_time_units :  hours
> >>> >
> >>> >          initial_time : 03/08/2021 (00:00)
> >>> >
> >>> > The variable name is the same for other GFS files, regardless of
> >>> > resolution.
> >>> >
> >>> > *[3]* For documentation, check this:
> >>> >
> >>>
> https://www.emc.ncep.noaa.gov/emc/pages/numerical_forecast_systems/gfs/documentation.php
> >>> >
> >>> > *[4] *The files are archived in rda.ucar.edu. For the 25km GFS, for
> >>> > example, see this link:
> >>> >
> >>> > https://rda.ucar.edu/datasets/ds084.1/#!docs
> >>> >
> >>> >
> >>> >
> >>> > Hope this helps.
> >>> >
> >>> > --Lyndz
> >>> >
> >>> >
> >>> >
> >>> > On Mon, Mar 8, 2021 at 8:05 PM dr.hieronymus--- via ncl-talk <
> >>> > ncl-talk at mailman.ucar.edu> wrote:
> >>> >
> >>> >> Hello,
> >>> >>
> >>> >> I am trying to dig through GFS files in GRIB2 format on NCEP's FTP
> >>> >> server (https://www.nco.ncep.noaa.gov/pmb/products/gfs/).
> >>> >>
> >>> >> Unfortunately, it is not very easy to get a proper overview.
> >>> >> Therefore,
> >>> >> my first question is whether there is documentation somewhere that
> >>> >> describes the different formats/variants in detail.
> >>> >>
> >>> >> What one quickly notice and easy understand is that the GFS files
> are
> >>> >> available in different resolutions (0.25°, 0.50°, 1.00°) and each
> GFS
> >>> >> file is described by an index file. The GFS files with 0.25°
> >>> >> resolution
> >>> >> have an hourly granularity and the GFS files with 0.50° and 1.00°
> >>> >> resolution have a three-hourly granularity.
> >>> >>
> >>> >> Then, there are the .anl and .f000 GFS files. I don't understand the
> >>> >> difference between .anl and .f000. Is .f000 not a forecast?
> >>> >> Furthermore,
> >>> >> I noticed that the index files are different regarding .f000 and
> >>> >> .f001-384 (0.25°) and .f000 and .f003-384 (0.50°, 1.00°).
> >>> >>
> >>> >> What also confuses me are the different GFS files, namely pgrb2,
> >>> >> pgrb2b,
> >>> >> pgrb2full and sfluxgrbfFFF. What are the differences exactly?
> >>> >> According
> >>> >> to the corresponding index files, the same physical variables are
> >>> >> available in all different GFS files. Do these variables always have
> >>> >> the
> >>> >> same values in all GFS files? Doesn't it matter which file I use
> >>> >> when
> >>> >> I have decided on a resolution?
> >>> >>
> >>> >> I am actually only interested in the temperature 2 meters above the
> >>> >> ground. Which file should I simply use?
> >>> >>
> >>> >> In addition, I also wanted to know if the initial values for each
> >>> >> model
> >>> >> run (00, 06, 12, 18) are published somewhere.
> >>> >>
> >>> >> Thank you in advance for your help.
> >>> >> _______________________________________________
> >>> >> ncl-talk mailing list
> >>> >> ncl-talk at mailman.ucar.edu
> >>> >> List instructions, subscriber options, unsubscribe:
> >>> >> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>> _______________________________________________
> >>> ncl-talk mailing list
> >>> ncl-talk at mailman.ucar.edu
> >>> List instructions, subscriber options, unsubscribe:
> >>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210309/8aba8a87/attachment.html>


More information about the ncl-talk mailing list