SUBROUTINE MT_STBD( iret ) C************************************************************************ C* MT_STBD * C* * C* This subroutine gets the latitude, longitutde, elevation, and WMO * C* country 2-letter ID for the current station. * C* * C* MT_STBD( IRET ) * C* * C* Input parameters: * C* CIVALS(ICSTID) CHAR* Report ID * C* MAXSTN INTEGER Max number of stations in the * C* Metar World Station Table * C* YLAT (MAXSTN) REAL Station table latitude array * C* YLONG (MAXSTN) REAL Station table longitude array * C* ELEV (MAXSTN) REAL Station table elevation array * C* JCOUN (MAXSTN) CHAR* Station WMO country 2-letter ID* C* * C* Output parameters: * C* RIVALS(IRSLAT) REAL Latitude of station in * C* hundredths of degrees * C* RIVALS(IRSLON) REAL Longitude of station in * C* hundredths of degrees * C* RIVALS(IRSELV) REAL Elevation of station in meters * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = problems * C* * C** * C* Log: * C* R. Hollern/NCEP 6/98 * C* R. Hollern/NCEP 7/98 Got the country 2-letter ID for * C* the station * C* C. Caruso Magee/NCEP 02/07 Clean up setting of report ID. * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'mtcmn.cmn' INCLUDE 'mtstnd.cmn' C* CHARACTER stid*4 C------------------------------------------------------------------------ iret = 0 stid = ' ' C C* Get report ID. C stid = civals(icstid)(1:4) C C* Look for id match in station table C CALL DC_BSRC ( stid, jstnid, nstns, ilc, kret ) C IF ( ilc .gt. 0 ) THEN C C* Found a match C rivals ( irselv ) = elev ( ilc ) rivals ( irslat ) = ylat ( ilc ) rivals ( irslon ) = ylong ( ilc ) contry = jcoun ( ilc ) ELSE C C* Station ID not found in station table C iret = 1 logmsg = 'ID ' // stid // ' not in station table.' CALL DC_WLOG ( 2, 'DCMETR', 2, logmsg(1:29), ierlog ) END IF C* RETURN END