/* ** Do not change these include commands. ** All necessary header files are included in "geminc.h" ** All macros and constants are in "gemprm.h" and "bridge.h" */ #include "geminc.h" #include "gemprm.h" #include "bridge.h" #include "decod_ut.h" /* contains prototype for ut_prvs */ main ( argc, argv ) int argc; char *argv[]; /************************************************************************ * DCLSFC * * * * This program decodes land surface synoptic reports into BUFR output. * * * * Command line: * * dclsfc [options] [bufrtb] [stntbl] * * * * bufrtb = BUFR table * * stntbl = Land synoptic world station table * ** * * Log: * * R. Hollern/NCEP 5/96 Based on DCMSFC * * R. Hollern/NCEP 8/96 Set optional command line parameters * * R. Hollern/NCEP 1/98 Eliminated gempak references * * J. Ator/NCEP 05/01 Remove call to uerror * * J. Ator/NCEP 06/02 Add r40fl argument * * J. Ator/NCEP 01/05 Increased ndfhr1 from 120 to 240 * * C. Caruso Magee/NCEP 03/06 Added new args to calling sequence of * * dc_gopt and change default names of * * station table to lsfc.tbl and Res 40 * * to decod_WMO.Res40.headers * * S. Guan/NCEP 01/09 Add circflg to dc_gopt call sequence * * M. Weiss/NCEP 01/19 Modified for Dell migration * * M. Weiss/NCEP 09/21 WCOSS2 install: #include "decod_ut.h" * * and void ls_dcod have been added. ***********************************************************************/ { /* ** Change the values of these default variables for the ** specific decoder. ** ** These variables are the number of expected command line ** parameters; the program name; the packing and station tables; ** values for the number of additional stations and the ** number of times; and the number of hours, prior to the ** "current" time, to decode. */ #define NUMEXP 3 int nexp = NUMEXP; char *prgnam = "DCLSFC"; /* ** Define the standard decoder parameters. */ char stntbl[DCMXLN], stntb2[DCMXLN]; char prmfil[DCMXLN]; int iadstn; int maxtim; int nhours; int txtflg; int iwndht; int circflg; /* ** Define default values for the standard decoder parameters. */ char *defprm = " "; char *defstn = " "; char *dfstn2 = " "; int idfadd = 0; int idfmax = 0; int ndfhr1 = 240; int ndfhr2 = 240; int idfwdh = 0; /* ** Define the additional decoder parameters. */ const char *dvstr = DVSTR; /* DVSTR is a compile-time macro */ char bufrtb[DCMXLN]; char r40fl[DCMXLN]; /* ** Do not change these variables which are used by all ** decoders for getting the command line parameters. */ char parms[NUMEXP][DCMXLN]; char curtim[DCMXLN]; int num; int iret; /*---------------------------------------------------------------------*/ /* ** Initialize the output logs, set the time out and ** parse the command line parameters. */ dc_init ( prgnam, argc, argv, nexp, parms, &num, &iret ); /* ** Check for an initialization error. */ if ( iret < 0 ) { dc_exit ( &iret ); } /* ** For all optional command line parameters, set default ** values for the corresponding decoder parameters. */ dc_gopt ( defprm, defstn, dfstn2, idfadd, idfmax, ndfhr1, ndfhr2, idfwdh, prmfil, stntbl, stntb2, &iadstn, &maxtim, curtim, &nhours, &txtflg, &circflg, &iwndht, &iret ); /* ** Set default value for additional decoder parameter. */ strcpy ( bufrtb, "bufrtab.000" ); strcpy ( stntbl, "lsfc.tbl" ); strcpy ( r40fl, "decod_WMO.Res40.headers" ); /* ** Now, for each additional decoder paramter, if a value was ** defined on the command line, then use that value instead ** of the default value. */ if ( num > 0 ) { strcpy ( bufrtb, parms[0] ); } if ( num > 1 ) { strcpy ( stntbl, parms[1] ); } if ( num > 2 ) { strcpy ( r40fl, parms[2] ); } /* ** Change this function call, and the define command, ** for the specific decoder. */ #ifdef UNDERSCORE #define ls_dcod ls_dcod_ #endif void ls_dcod ( char *, char *, char *, char *, int *, int *, size_t, size_t, size_t, size_t ); ut_prvs ( dvstr, strlen(dvstr) ); ls_dcod ( curtim, stntbl, bufrtb, r40fl, &nhours, &iret, strlen(curtim), strlen(stntbl), strlen(bufrtb), strlen(r40fl) ); /* ** Send shut down message and close the log files. */ dc_exit ( &iret ); }