SUBROUTINE MA_TTOR ( tgtbl, iret ) C************************************************************************ C* MA_TTOR * C* * C* This subroutine opens and reads the tide gauge station table. * C* * C* MA_TTOR ( TGTBL, IRET ) * C* * C* Input parameters: * C* TGTBL CHAR* tide gauge station table * C* * C* Output parameters: * C* IRET INTEGER Return code: * C* 0 = normal return * C* -1 = error opening or reading * C** * C* Log: * C* J. Ator/NCEP 06/96 * C* J. Ator/NCEP 12/97 New interface format, style changes * C* J. Ator/NCEP 03/98 Include 'uacmn_stntbl.cmn' * C* J. Ator/NCEP 10/99 Clean up function declarations * C* C. Caruso Magee/NCEP 03/05 Copy from UA_LDOR.f. * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'macmn.cmn' C* CHARACTER*(*) tgtbl C* CHARACTER stnnam*32, tbchrs*20, stid*8, stat*2, coun*2 C------------------------------------------------------------------------ iret = -1 C C* Open the tide gauge station table file. C CALL FL_TBOP ( tgtbl, 'stns', lunstb, iertop ) IF ( iertop .ne. 0 ) THEN CALL DC_WLOG ( 0, 'FL', iertop, tgtbl, ierwlg ) RETURN END IF C C* Read in the tide gauge station table file. C ii = 1 ierrst = 0 DO WHILE ( ( ii .le. MTBLSZ ) .and. ( ierrst .eq. 0 ) ) CALL TB_RSTN ( lunstb, jstnid (ii), stnnam, istnm, + stat, coun, ylat (ii), ylong (ii), + elev (ii), ispri, tbchrs, ierrst ) jstnt = ii jstnidt (ii) = jstnid (ii) elevt (ii) = elev (ii) ylatt (ii) = ylat (ii) ylongt (ii) = ylong (ii) ii = ii + 1 END DO C C* If hit end of file reading station table without error, C* set return code to 0. C IF ( ierrst .eq. -1 ) THEN iret = 0 END IF C C* Close the tide gauge station table file. C CALL FL_CLOS ( lunstb, iercls ) C* RETURN END