#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[]; /************************************************************************ * DCAXBT * * * * This program transfers AXBT data into NCEP's BUFR database * * * * Command line: * * decod_dcaxbt [options] [bufrtb] * * * * bufrtb = BUFR tables file * * * ** * * Log: * * S. Guan/NCEP 07/09 Initial version * * J. Ator/NCEP 11/10 Modified to read data from WMO bulletins* * M. Weiss/NCEP 19/01 Modified for Dell migration * * M. Weiss/IMSG 09/21 WCOSS2 install: #include "decod_ut.h" * * and void ax_dcod have been added. * ***********************************************************************/ { #define NUMEXP 1 int nexp = NUMEXP; char *prgnam = "DCAXBT"; /* ** 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 infile[80], bufrtb[80]; /* ** Do not change these variables. These variables are used by all ** decoders for getting the command line parameters. */ char parms[NUMEXP][DCMXLN]; char curtim[DCMXLN]; int num; int iret; int ier; /*---------------------------------------------------------------------*/ /* ** 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 ); } /* ** Set each standard decoder parameter to the value from the ** command line options (if defined) or else to the default ** value. */ dc_gopt ( defprm, defstn, dfstn2, idfadd, idfmax, ndfhr1, ndfhr2, idfwdh, prmfil, stntbl, stntb2, &iadstn, &maxtim, curtim, &nhours, &txtflg, &circflg, &iwndht, &iret ); /* ** Set default values for the additional decoder parameters. */ strcpy ( bufrtb, "bufrtab.031" ); /* ** Now, for each additional decoder parameter, 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] ); } /* ** Call the decoding routine. ** ** Change this function call and define command for the ** specific decoder. */ #ifdef UNDERSCORE #define ax_dcod ax_dcod_ #endif void ax_dcod ( char *, char *, int *, int *, size_t, size_t ); ut_prvs ( dvstr, strlen(dvstr) ); ax_dcod(curtim, bufrtb, &nhours, &iret, strlen(curtim), strlen(bufrtb) ); /* ** Send shut down message and close the log files. */ dc_exit ( &iret ); }