/* ** 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" main ( argc, argv ) int argc; char *argv[]; /************************************************************************ * DCMETR * * * * This program decodes metar reports into BUFR output. * * * * Command line: * * dcmetr [options] [bufrtb] [stntbl] * * * * bufrtb = BUFR table * * stntbl = Metar station table * ** * * Log: * * Jacobs/NCEP 9/95 * * D. Kidwell/NCEP 5/96 * * R. Hollern/NCEP 9/97 Modified routine to add the Metar World * * Station Table Name to the command line * * parameter list * * R. Hollern/NCEP 6/98 Eliminated gempak references * * J. Ator/NCEP 05/01 Remove call to uerror * * J. Ator/NCEP 01/05 Increased ndfhr1 from 120 to 240 * * C. Caruso Magee/NCEP 02/06 Added new args to calling sequence of * * dc_gopt and changed default name of * * station table to metar.tbl * * J. Ator/NCEP 01/09 Add circflg to dc_gopt call sequence * * M. Weiss/NCEP 01/2018 Modify for Dell environment * * J. Ator/NCEP 09/21 Modify for WCOSS2 environment * ***********************************************************************/ { #define NUMEXP 2 int nexp = NUMEXP; char *prgnam = "DCMETR"; /* ** 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]; /* ** 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. ** On an error, exit gracefully. */ if ( iret < 0 ) { dc_exit ( &iret ); } /* ** Set the decoder parameters to the command line entries or ** default values. */ 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 additonal decoder parameters. */ strcpy ( bufrtb, "bufrtab.000" ); strcpy ( stntbl, "metar.tbl" ); /* 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] ); } if ( num > 1 ) { strcpy ( stntbl, parms[1] ); } /* ** ** Change this function call, define command, and prototype ** for the specific decoder. */ #ifdef UNDERSCORE #define mt_dcod mt_dcod_ #endif void mt_dcod ( char *, char *, char *, int *, int *, size_t, size_t, size_t ); ut_prvs ( dvstr, strlen(dvstr) ); mt_dcod ( curtim, stntbl, bufrtb, &nhours, &iret, strlen(curtim), strlen(stntbl), strlen(bufrtb) ); /* ** Send a shut down message to the logs and close the log files. */ dc_exit ( &iret ); }