[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

19991213: Problems with nagrib



Bob,

The invalid time error you are getting is due to a missing forecast time
for the sst grib product.

To fix this, you need to edit:

$GEMPAKHOME/source/gemlib/gb/gbgpds.c, in the first switch statement
which is: switch ( pds.time_range ) {

look for "case 1:" which is approximately line 140 in the file.

This case should be:

            case 1:
                    iafgi = 0;
                    ifcst = 0;
                    break;


You need to add the ifcst=0 line to the case statement in that file.
Then recompile that library routine and your nagrib program with:

cd $GEMPAKHOME/source/gemlib/gb/
make clean
make all
make clean

cd $GEMPAKHOME/source/programs/na/nagrib
make clean
make all
make install
make clean


I looked in today's sst grib file on the OSO server, and they do
change their grib version from 3 in the first TMPK product to 128 
for the second product. Table version 128 and higher are reserved for
local modeling centers, so the parameters they use here are not standard.
The first parameter number is #11 which is TMPK, the second grib
in the file is #254. The table ncepgrib2.tbl and the Grib code manual
list #254 as richardson number- but since this is a local table number 128, and
an SST grib file, then that may not be the appropriate parameter for that grid-
so you may need to find out from them what they define for their table 128.

Steve Chiswell





>From: Robert Ballentine <address@hidden>
>Organization: .
>Keywords: 199912131636.JAA13825

>Steve:
>   We are trying to use an SST file from the NCEP OSO server to initialize
>the water temperature in MM5.  The SST file is in 'grib' format.  We want to
>convert it to a gempak grid file using NAGRIB.  When we run NAGRIB under
>Linux, HP-UX, or Solaris, it fails to create the grid file with the message
> 
>                   [NAGRIB - 17]  Error setting date/time
>                   
>In previous attempts, it complained about not being able to open files
>wmogrib128.tbl and ncepgrib128.tbl.  Since we did not have those files, we
>copied wmogrib3.tbl to wmogrib128.tbl and ncepgrib3.tbl to ncepgrib128.tbl.
>   The following script is from our attempt at NAGRIB under Linux RedHat5.2.
>the original name of the NCEP SST file was gdas1.T00Z.sstgrb which we 
>downloaded from the OSO server under directory /ncep/FNL/fnl.991212/.  We 
>renamed it sst.grb for convenience.
>   Any help you can give will be appreciated.
>   Thanks,
>   Bob Ballentine
>********************************NAGRIB Script*********************************

>Script started on Mon Dec 13 11:24:37 1999
>met-05.oswego.edu: 1 % source /usr/local/NAWIPS/Gemenviron
>Setting to decmaps
>met-05.oswego.edu: 2 % nagrib
>Creating process: gplt for queue 6533
> GBFILE    GRIB data file name               sst.grb
> INDXFL    GRIB index file name              
> GDOUTF    Output grid file                  sst.grd
> PROJ      Map projection/angles/margins|dr  
> GRDAREA   Area covered by grid              
> KXKY      Number of grid points in x;y      
> MAXGRD    Maximum number of grids           1000
> CPYFIL    File to be copied                 gds
> GAREA     Graphics area                     
> OUTPUT    Output device/filename            t
> GBTBLS    Input GRIB decoding tables        
> GBDIAG    GRIB Diagnostic Elements          pds
> Parameters requested: GBFILE,INDXFL,GDOUTF,PROJ,GRDAREA,KXKY,MAXGRD,CPYFIL,
> GAREA,OUTPUT,GBTBLS,GBDIAG.
> GEMPAK-NAGRIB>r
> PDS bytes  1- 3 (pds.length)      = 28
> PDS byte      4 (pds.version)     = 3
> PDS byte      5 (pds.center)      = 7
> PDS byte      6 (pds.process)     = 44
> PDS byte      7 (pds.grid_id)     = 255
> PDS byte      8 (pds.flag)        = 128
> PDS byte      9 (pds.parameter)   = 11
> PDS byte     10 (pds.vcoord)      = 1
> PDS bytes    11 (pds.level_1)     = 0
> PDS bytes    12 (pds.level_2)     = 0
> PDS bytes 11-12 (pds.level)       = 0
> PDS byte     13 (pds.year)        = 99
> PDS byte     14 (pds.month)       = 12
> PDS byte     15 (pds.day)         = 11
> PDS byte     16 (pds.hour)        = 0
> PDS byte     17 (pds.minute)      = 0
> PDS byte     18 (pds.time_unit)   = 2
> PDS byte     19 (pds.time_p1)     = 0
> PDS byte     20 (pds.time_p2)     = 0
> PDS byte     21 (pds.time_range)  = 1
> PDS bytes 22-23 (pds.avg_num)     = 0
> PDS byte     24 (pds.avg_miss)    = 0
> PDS byte     25 (pds.century)     = 20
> PDS byte     26 (pds.izero)       = 4
> PDS bytes 27-28 (pds.dec_scale)   = 2
> PDS EXT FLAG (1-app,0-nc,-1-rep)  = 0
> PDS EXT STRING                    = 
> Changing center table to cntrgrib1.tbl
> Changing vertical coord table to vcrdgrib1.tbl
> Changing WMO parameter table to wmogrib3.tbl
> Changing center parameter table to ncepgrib3.tbl
> [NAGRIB -17]  Error setting date/time.
> PDS bytes  1- 3 (pds.length)      = 28
> PDS byte      4 (pds.version)     = 128
> PDS byte      5 (pds.center)      = 7
> PDS byte      6 (pds.process)     = 44
> PDS byte      7 (pds.grid_id)     = 255
> PDS byte      8 (pds.flag)        = 128
> PDS byte      9 (pds.parameter)   = 254
> PDS byte     10 (pds.vcoord)      = 1
> PDS bytes    11 (pds.level_1)     = 0
> PDS bytes    12 (pds.level_2)     = 0
> PDS bytes 11-12 (pds.level)       = 0
> PDS byte     13 (pds.year)        = 99
> PDS byte     14 (pds.month)       = 12
> PDS byte     15 (pds.day)         = 11
> PDS byte     16 (pds.hour)        = 0
> PDS byte     17 (pds.minute)      = 0
> PDS byte     18 (pds.time_unit)   = 2
> PDS byte     19 (pds.time_p1)     = 0
> PDS byte     20 (pds.time_p2)     = 0
> PDS byte     21 (pds.time_range)  = 1
> PDS bytes 22-23 (pds.avg_num)     = 0
> PDS byte     24 (pds.avg_miss)    = 0
> PDS byte     25 (pds.century)     = 20
> PDS byte     26 (pds.izero)       = 4
> PDS bytes 27-28 (pds.dec_scale)   = 2
> PDS EXT FLAG (1-app,0-nc,-1-rep)  = 0
> PDS EXT STRING                    = 
> Changing WMO parameter table to wmogrib128.tbl
> Changing center parameter table to ncepgrib128.tbl
> [NAGRIB -17]  Error setting date/time.
>
>
>         2 GRIB messages were read or scanned from the GRIB file:
>     sst.grb                                                                
>
>         0 grids were written to the GEMPAK file:
>     sst.grd                                                                 
>
> Parameters requested: GBFILE,INDXFL,GDOUTF,PROJ,GRDAREA,KXKY,MAXGRD,CPYFIL,
> GAREA,OUTPUT,GBTBLS,GBDIAG.
> GEMPAK-NAGRIB>exit
>met-05.oswego.edu: 3 % gpend
>met-05.oswego.edu: 4 % exit
>exit
>
>Script done on Mon Dec 13 11:25:17 1999
>