SUBROUTINE UT_RSTN ( lun, stid, stnnam, istnm, stat, coun, + slat, slon, selv, ispri, utchrs, iret ) C************************************************************************ C* UT_RSTN * C* * C* This subroutine reads the next record from the GEMPAK station table. * C* * C* UT_RSTN ( LUN, STID, STNNAM, ISTNM, STAT, COUN, SLAT, SLON, * C* SELV, ISPRI,UTCHRS, IRET ) * C* * C* Input parameters: * C* LUN INTEGER Logical unit number * C* * C* Output parameters: * C* STID CHAR* Station identifier * C* STNNAM CHAR*32 Station name * C* ISTNM INTEGER Station number * C* STAT CHAR*2 State * C* COUN CHAR*2 Country * C* SLAT REAL Station latitude * C* SLON REAL Station longitude * C* SELV REAL Station elevation * C* ISPRI INTEGER Station priority * C* UTCHRS CHAR*20 Additional parameters * C* IRET INTEGER Return code * C* 0 = normal return * C* -1 = end of file * C* -2 = read error * C** * C* Log: * C* M. Weiss/IMSG 04/18 New routine based on TB_RSTN, but built * C* to read CLATH and CLONH from higher * C* precision metar.tbl. * C* M. Weiss/IMSG 11/20 Changed chrx*20 to chrx*60 * C************************************************************************ CHARACTER*(*) stid, stnnam, stat, coun, utchrs C* CHARACTER sid*8, sname*32, st*2, cn*2, chrx*60 C------------------------------------------------------------------------ iret = 0 C C* Read one station from the table. C CALL UT_ASTN ( lun, 1, nstn, sid, sname, isn, st, + cn, rlat, rlon, relv, ispr, chrx, iret ) C C* Check for error. C IF ( iret .ne. 0 ) THEN IF ( iret .ne. -1 ) iret = -2 stid = ' ' stnnam = ' ' istnm = 0 stat = ' ' coun = ' ' slat = 0.0 slon = 0.0 selv = 0.0 ispri = 0 utchrs = ' ' ELSE C C* Set output variables. C iret = 0 stid = sid istnm = isn stnnam = sname stat = st coun = cn slat = rlat slon = rlon selv = relv ispri = ispr utchrs = chrx END IF C* RETURN END