SUBROUTINE LS_STBD ( iret ) C************************************************************************ C* LS_STBD * C* * C* This subroutine gets from the station table: the WMO block/station * C* number, the latitude and longitude location, the elevation, the WMO * C* country two letter ID, and the units of the wind speed if it was not * C* gotten from the YYGGi group in the AAXX line of the bulletin. * C* * C* LS_STBD( IRET ) * C* * C* Input parameters: * C* ITBLSZ INTEGER Current max size of station tbl* C* CIVALS (ICSTID) CHAR* Report ID * C* JCOUN (ITBLSZ) CHAR* Station WMO country 2-letter ID* C* YLAT (ITBLSZ) REAL Station latitude in hundredths * C* of degrees * C* YLONG (ITBLSZ) REAL Station Longitude in hundredths* C* of degrees * C* ELEV (ITBLSZ) REAL Station elevation in meters * C* JWMORG (ITBLSZ) INTEGER Station WMO region number * C* JSTNID (ITBLSZ) INTEGER Station block/station number * C* JWDFLG (ITBLSZ) INTEGER Station source and units of * C* wind speed indicator * C* (WMO Code Table 1855) * C* * C* Input and Output parameters: * C* IUWIND INTEGER Indicator for source and units * C* of wind speed * C* Output parameters: * C* RIVALS (IRWMOB) REAL WMO block number of station * C* RIVALS (IRWMOB) REAL WMO block number of station * C* RIVALS (IRSLAT) REAL Latitude in degrees * C* RIVALS (IRSELV) REAL Elevation of station in meters * C* RIVALS (IRISWS) REAL Indicator for source and * C* units of wind speed * C* (WMO Code Table 1855) * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = problems * C* * C* * C** * C* Log: * C* R. Hollern/NCEP 1/98 * C* R. Hollern/NCEP 1/99 Renamed INCLUDE block ls.bufr.prm to * C* lsbufr.cmn * C* R. Hollern/NCEP 3/99 Increased size of station tbl to 14000 * C* R. Hollern/NCEP 4/00 Removed INCLUDE 'lsbufr.cmn' and added * C* INCLUDE 'lscmn.stntbl.cmn' * C* J. Ator/NCEP 01/02 SUWS -> ISWS * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'lscmn.cmn' INCLUDE 'lscmn_stntbl.cmn' C* CHARACTER stnid*8, fld5*5 C* INCLUDE 'ERMISS.FNC' C------------------------------------------------------------------------ iret = 0 stnid = ' ' C C* Get report ID. C stnid = civals( icstid ) C C* Convert block/station ID from character to numeric C fld5 = stnid ( 1:5 ) CALL ST_INTG ( fld5, ival, ier ) IF ( ier .eq. 0 ) THEN iblkst = ival kblk = ival / 1000 kstn = iblkst - (1000*kblk) ELSE iret = 1 RETURN END IF C C* Get the Location of the block/station ID in the station table C CALL DC_BSRH ( iblkst, jstnid, jstn, ltb, jret ) C IF ( jret .eq. -1 ) THEN C C* If station ID not in table, skip decoding station report C loglvl = 2 CALL DC_WLOG( loglvl, 'LS', 2, stnid ( 1:5 ), ierwlg ) iret = 1 RETURN END IF C C* Station dictionary location, country, elevation, latitude, C* longitude, and units of wind speed C kwmo = jwmorg( ltb ) kcoun = jcoun ( ltb ) rivals ( irselv ) = elev ( ltb ) rivals ( irslat ) = ylat ( ltb ) rivals ( irslon ) = ylong ( ltb ) C IF ( ERMISS ( rivals ( irisws ) ) ) THEN rivals ( irisws ) = FLOAT ( jwdflg ( ltb ) ) END IF C* RETURN END