SUBROUTINE MT_STBL ( lunstb, iret ) C*********************************************************************** C* MT_STBL * C* * C* This subroutine reads the world metar station table to get the * C* following data for each station in the table: the station ID, the * C* latitude and longitude location, the elevation, and the country * C* WMO 2-letter ID. * C* * C* MT_STBL ( LUNSTB, IRET ) * C* * C* Input parameters: * C* LUNSTB INTEGER Station table unit number * C* * C* Output parameters: * C* * C* NSTNS INTEGER Number of stations in table * C* ELEV (MAXSTN) Real Station elevation in meters * C* YLAT (MAXSTN) Real Station latitude in hundredths * C* of degrees * C* YLONG (MAXSTN) Real Station latitude in hundredths * C* of degrees * C* JSTNID (MAXSTN) INTEGER Station ID * C* JCOUN (MAXSTN) INTEGER Station country 2-letter ID * C* IRET INTEGER return code * C* 0 = normal return * C* -2 = station table open error * C* * C** * C* Log: * C* D. Kidwell/NCEP 10/95 * C* R. Hollern/NCEP 9/97 Switched from the GEMPAK to the * C* World Metar Station Table * C* R. Hollern/NCEP 7/98 Got the country 2-letter ID for * C* each station * C* R. Hollern/NCEP 3/99 Added check to prevent exceeding* C* world metar station table size * C* C. Caruso Magee/NCEP 02/05 Moved definition of MAXSTN to * C* mtstnd.cmn and fixed MAXSTN * C* overflow check. * C*********************************************************************** INCLUDE 'mtstnd.cmn' C* CHARACTER * 100 logstn C* CHARACTER * 4 stid CHARACTER * 32 stnnam CHARACTER * 2 stat, cntry CHARACTER * 14 tbchrs C----------------------------------------------------------------------- iret = 0 C C* Read in station table. C jret = 0 nerr = 0 nstns = 0 C C* Station table is in Gempak format. C DO WHILE ( jret .eq. 0 .and. nstns .lt. MAXSTN ) C CALL TB_RSTN ( lunstb, stid, stnnam, istnm, stat, + cntry, slat, slon, selv, ispri, tbchrs, jret ) C IF ( jret .eq. 0 ) THEN nstns = nstns + 1 jstnid ( nstns ) = stid ylat ( nstns ) = slat ylong ( nstns ) = slon elev ( nstns ) = selv jcoun( nstns ) = cntry // ' ' ELSE IF ( jret .eq. -1 ) THEN C C* EOF read. C RETURN ELSE IF ( jret .eq. -2 ) THEN C C* Read error. C iret = -1 logstn = ' ' CALL DC_WLOG ( 0, 'DCMETR', 2, logstn(1:53), ierlog ) END IF C END DO C* RETURN END