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

Re: [NCEP.List.PMB-PCSP] Re: tgsv32 migration



Paula,

Thanks for this addition of thw awip12 files.

There is an existing  bug in the gribinsert code for grib1 data only in
calculating the forecast verification time past the daylight savings
time change. I think that this wasn't seen on tgsv32 because the system
clock on that machine
was running in UTC time rather than local time.

At any rate, I do have a fix for this....if you have the time to
recompile the gribinsert program.

Attached is 1 file (get_gribname.c) for the ~ldm/gribinsert-1.1
directory. To rebuild would require:

1) replace the existing get_geibname.c file

2) cd ~ldm/gribinsert-1.1

3) make

that should rebuild the gribinsert program. We don't need to re-install
everything since the grib parameter tables have been updated in the past
few weeks. We would just copy the new gribinsert executable into place,
eg:

cp ~ldm/bin/gribinsert ~ldm/bin/gribinsert.old
cp gribinsert ~ldm/bin/gribinsert

(This update would be for both ldm systems you have).

If you can do this, that would be great.
I know you have other time commitments.

Thanks,

Steve



On Tue, 2006-10-24 at 09:36 -0400, Paula Freeman wrote:
> Steve,
> > Can we go ahead and get the 
> > nam.tHHz.awip12FF.tm00.grib2
> > files added to the WOC in lieu of the 20km grids that were on TGSV32?
> These should start showing up in the next cycle,
> 
> -Paula
> 
> Steve Chiswell wrote:
> > On Wed, 2006-10-18 at 07:49 -0400, P. J. Freeman wrote:
> >   
> >> Steve,
> >>
> >> According to the schedule you and Brent put together, CONDUIT should now 
> >> be entirely migrated off the tgsv32 host.  Is that true?
> >>
> >> -Paula
> >>     
> >
> > Paula,
> >
> > I didn't get confirmation back from the other top tiers yesterday (of
> > course we were having a snow storm here), but will switch at 18Z today.
> >
> > One last item. the TGSV32 server was sending the awip20 grid 215 files.
> > These
> > files aren't in the NCEP nam directory. However, the awip12 grid 218
> > files in grib2
> > are there and were on the action item list. Can we go ahead and get the 
> > nam.tHHz.awip12FF.tm00.grib2
> > files added to the WOC in lieu of the 20km grids that were on TGSV32?
> >
> > Thanks,
> >
> > Steve
> >
> >
> >
> >   
> >> Steve Chiswell wrote:
> >>     
> >>> Brent,
> >>>
> >>> Yes. I have to re-write the CONDUIT html pages to reflect the new
> >>> patterns etc, but otherwise, will make the ensemble change with top tier
> >>> nodes
> >>> on the 27th. 
> >>>
> >>> Steve
> >>>
> >>>
> >>> On Wed, 2006-09-20 at 07:44 -0400, Brent A. Gordon wrote:
> >>>   
> >>>       
> >>>> Hi Steve,
> >>>>
> >>>> Are you still on track to meet these dates?
> >>>>
> >>>> Brent
> >>>>
> >>>> Steve Chiswell wrote: 
> >>>>     
> >>>>         
> >>>>> Brent,
> >>>>>
> >>>>> Sure. How about Sept 27 for Ensemble and Oct 17 for the rest?
> >>>>>
> >>>>> Steve
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Wed, 2006-09-13 at 12:30 -0400, Brent A. Gordon wrote:
> >>>>>   
> >>>>>       
> >>>>>           
> >>>>>> Steve,
> >>>>>>
> >>>>>> Is there any way the Nov 1 date could be moved forward a couple of
> >>>>>> weeks to mid October?  I want to make sure this does not stand in the
> >>>>>> way of TOC decommissioning AFS.  This is not a critical item, just
> >>>>>> curious.
> >>>>>>
> >>>>>> We will get the NAM 216 data to the WOC and on CONDUIT next week.  
> >>>>>>
> >>>>>> I'm not sure about the RUC13 for AWIPS, it is tied up tight in the NWS
> >>>>>> requirements process.  We will look into adding this to the WOC for
> >>>>>> either the week of 9/25 or 10/2.
> >>>>>>
> >>>>>> Brent
> >>>>>>
> >>>>>> Steve Chiswell wrote: 
> >>>>>>     
> >>>>>>         
> >>>>>>             
> >>>>>>> Brent,
> >>>>>>>
> >>>>>>> I hadn't set a time schedule yet due to the tigge operations, but here
> >>>>>>> would be my strawman that I can send to the community:
> >>>>>>>
> >>>>>>> Sept 27 or Oct 3 change top level relays to receive ensemble data from
> >>>>>>> WOC and
> >>>>>>> remove requests of ensembles from TGSV32.
> >>>>>>>
> >>>>>>> Nov 1, transition top level relays to GFS 1 degree, NAM and remaining
> >>>>>>> RUC from WOC.
> >>>>>>>
> >>>>>>> One data set I had mentioned to Paula that is still absent from the 
> >>>>>>> WOC
> >>>>>>> feed is the NAM awipak (grid #216) data set.
> >>>>>>>
> >>>>>>> By the way, has there been any update on the RUC13km data that was
> >>>>>>> announced for last June?
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>>
> >>>>>>> Steve
> >>>>>>>
> >>>>>>> On Tue, 2006-09-12 at 09:49 -0400, Brent A. Gordon wrote:
> >>>>>>>   
> >>>>>>>       
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> Steve,
> >>>>>>>>
> >>>>>>>> The folks at the TOC were inquiring again this morning as to when the
> >>>>>>>> CONDUIT feed will be completely migrated off tgsv32.  Do you have a
> >>>>>>>> schedule for this?
> >>>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>>
> >>>>>>>> Brent
> >>>>>>>>     
> >>>>>>>>         
> >>>>>>>>             
> >>>>>>>>                 
-- 
Steve Chiswell <address@hidden>
Unidata
/*
 *   Copyright 2004, University Corporation for Atmospheric Research
 *   See COPYRIGHT file for copying and redistribution conditions.
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "ldm.h"

#include "gribinsert.h"

#include "grib2.h"
#include "gempak/gb2def.h"

/* wgrib prototypes used */
char *k5toa(unsigned char *pds);
char *levels(int, int, int);

void    grib1name ( char *filename, int seqno,  char *data, char *ident )
{
unsigned char model_id,grid_id,parmid,vcordid,center,subcenter;
unsigned char dattim[6],ftim[4],level[2];
int CCYY,YYYY,MM,DD,HH,vtime;
time_t time1, time2;
struct tm tm1, tm2;
char prodtmp[255],prodid[255],levelstmp[255];
char *pos;
static char datyp[]="grib";
static int isinit=!0;

/* Initialize time zone information */
if(isinit)
   {
   isinit = 0;
   putenv("TZ=UTC0");
   tzset();
   }

        model_id = *((unsigned char *)data+13);
        grid_id = *((unsigned char *)data+14);
        center = *((unsigned char *)data+12);
        subcenter = *((unsigned char *)data+33);

        dattim[0] = *((unsigned char *)data+20);
        dattim[1] = *((unsigned char *)data+21);
        dattim[2] = *((unsigned char *)data+22);
        dattim[3] = *((unsigned char *)data+23);
        dattim[4] = *((unsigned char *)data+24);
        dattim[5] = *((unsigned char *)data+32);

        ftim[0] = *((unsigned char *)data+26);
        ftim[1] = *((unsigned char *)data+27);
        ftim[2] = *((unsigned char *)data+28);
        ftim[3] = *((unsigned char *)data+25);

        parmid = *((unsigned char *)data+16);
        vcordid = *((unsigned char *)data+17);
        level[0] = *((unsigned char *)data+18);
        level[1] = *((unsigned char *)data+19);

        if(dattim[0] > 0) dattim[5] = dattim[5] - 1; CCYY = dattim[5]*100 + 
dattim[0];
        vtime = verf_time((unsigned char *)data+8,&YYYY,&MM,&DD,&HH);

        tm1.tm_year    = CCYY - 1900; tm1.tm_mon     = dattim[1] - 1;
        tm1.tm_mday    = dattim[2]; tm1.tm_hour    = dattim[3];
        tm1.tm_min     = dattim[4]; tm1.tm_sec     = 0;
        tm1.tm_isdst   = -1; time1 = mktime(&tm1);

        tm2.tm_year    = YYYY - 1900; tm2.tm_mon     = MM - 1;
        tm2.tm_mday    = DD; tm2.tm_hour    = HH;
        tm2.tm_min     = 0; tm2.tm_sec     = 0;
        tm2.tm_isdst   = -1; time2 = mktime(&tm2);

        memset(prodtmp,0,255);
        memset(prodid,0,255);
        memset(levelstmp,0,255);

        sprintf(prodid,"%s\0",k5toa((unsigned char *)data+8));
        while((pos = strchr(prodid,' ')) != NULL) pos[0] = '_';

        
sprintf(levelstmp,"%s\0",levels((int)vcordid,(int)level[0],(int)level[1]));
        while((pos = strchr(levelstmp,' ')) != NULL) pos[0] = '_';

        sprintf(prodtmp,"%s/%s/%s/#%03d/%04d%02d%02d%02d%02d/F%03d/%s/%s! 
%06d\0",datyp,
                
s_pds_center(center,subcenter),s_pds_model(center,model_id),grid_id,
                CCYY,dattim[1],dattim[2],dattim[3],dattim[4],(time2 - 
time1)/3600,
                prodid,
                levelstmp,seqno
                /*(char *)PDStimes(ftim[2],ftim[0],ftim[1],ftim[3]),
                YYYY,MM,DD,HH*/);
        if(strlen(filename) < 253)
                {
                strcpy(ident,filename);
                strncat(ident," !",2);
                strncat(ident,prodtmp,253-strlen(filename));
                }
        else
                {
                strncpy(ident,filename,255);
                ident[255] = '\0';
                }
}

void    grib2name ( char *filename, int seqno,  char *data, size_t sz, char 
*ident )
{
int i, n, ier, ilen;
int unpack=0, expand=0;
g2int  listsec0[3],listsec1[13],numlocal;
int model_id, grid_id;
char g2name[13], fdats[80];
char prodtmp[255];
char levelstmp[80];
char prods[128];
static char datyp[]="grib2", slashstr[]="/";
static int tblinit=0;
static char *strptr[5];

Gribmsg curr_g2;
Geminfo curr_gem;

static char g2tables[5][LLMXLN] = { 0 }, *tbllist[5];

curr_g2.cgrib2 = (unsigned char *)data;
curr_g2.mlength = sz;
curr_g2.gfld = NULL;
curr_g2.field_tot = 0;

if ( !tblinit)
    {
      for (i = 0; i < 5; i++)
        tbllist[i] = g2tables[i];
      tblinit = !0;
    }


if ( ( ier = g2_info ( curr_g2.cgrib2, listsec0,listsec1, &(curr_g2.field_tot), 
&numlocal) ) != 0 ) 
        return;

prods[0] = '\0';
for ( n=0; n < curr_g2.field_tot; n++)
   {
   ier=g2_getfld( curr_g2.cgrib2, n+1, unpack, expand, &curr_g2.gfld);

   /* initialize strings in geminfo structure */
   memset ( curr_gem.cproj, 0, sizeof(curr_gem.cproj));
   memset ( curr_gem.parm, 0, sizeof(curr_gem.parm));
   memset ( curr_gem.gdattm1, 0, sizeof(curr_gem.gdattm1));
   memset ( curr_gem.gdattm2, 0, sizeof(curr_gem.gdattm2));
   model_id = curr_g2.gfld->ipdtmpl[4];
   grid_id = curr_g2.gfld->griddef;

   gb2_2gem (&curr_g2, &curr_gem, tbllist, &ier);

   if ( ier != 0 )
      {
      sprintf(g2name,"UNK\0");
      sprintf(levelstmp,"LVL\0");
      sprintf(fdats,"FHRS\0");
      }
   else
      {
      sprintf(g2name,"%s\0",curr_gem.parm);
      cst_rmbl (g2name, g2name, &ilen, &ier );
      if ( n > 0 ) strncat ( prods, ";", 1);
      sprintf(prods+strlen(prods),"%s\0",g2name);

      strptr[0] = (char *)malloc(12);
      cst_itoc ( &curr_gem.vcord, 1, (char **)(&strptr), &ier);
     
      cst_rxbl (curr_gem.unit, curr_gem.unit, &ilen, &ier); 
      if ( ilen == 0 ) sprintf (curr_gem.unit, "-\0"); 
      if ( curr_gem.level[1] == -1 )
         sprintf(levelstmp,"%d %s 
%s\0",curr_gem.level[0],curr_gem.unit,strptr[0]);
      else
         sprintf(levelstmp,"%d-%d %s 
%s\0",curr_gem.level[0],curr_gem.level[1],curr_gem.unit,strptr[0]);

      cst_rmbl (curr_gem.gdattm1, curr_gem.gdattm1, &ilen, &ier );
      cst_rmbl (curr_gem.gdattm2, curr_gem.gdattm2, &ilen, &ier );
      if ( ilen > 0 )
         sprintf(fdats,"%s-%s\0",curr_gem.gdattm1,curr_gem.gdattm2);
      else
         sprintf(fdats,"%s\0",curr_gem.gdattm1);

      ilen = 1;
      while ( ilen > 0 ) cst_rmst(fdats, slashstr, &ilen, fdats, &ier);

      free(strptr[0]);
      }

   g2_free(curr_g2.gfld);
   curr_g2.gfld = NULL;
   }

sprintf(prodtmp,"%s/%s/%s/#%03d/%s/%s/%s! %06d\0",
                datyp,
                s_pds_center((int)listsec1[0],(int)listsec1[1]),
                s_pds_model((int)listsec1[0],model_id),
                grid_id,
                fdats,
                prods,
                levelstmp,seqno);

if(strlen(filename) < 253)
  {
    strcpy(ident,filename);
    strncat(ident," !",2);
    strncat(ident,prodtmp,253-strlen(filename));
  }
else
  {
    strncpy(ident,filename,255);
    ident[255] = '\0';
  }

return;
}

void    get_gribname ( int gversion, char *data, size_t sz, char *filename, int 
seqno, char *ident)
{
        
        if(memcmp(data,"GRIB",4) == 0)  
           {
           switch ( gversion )
              {
              case 0:
              case 1:
                        grib1name ( filename, seqno, data, ident);
                        break;
              case 2:
                        grib2name ( filename, seqno, data, sz, ident);
                        break;
              default:
                        sprintf(ident,"%s !gribx/! %06d\0",filename,seqno);
              }
           }
        else if (memcmp(data,"BUFR",4) == 0)
           {
           sprintf(ident,"%s !bufr/! %06d\0",filename,seqno);
           }
        else
           {
           sprintf(ident,"%s !data/! %06d\0",filename,seqno);
           }

return;
}