SUBROUTINE UA_SDOR ( shptbl, iret ) C************************************************************************ C* UA_SDOR * C* * C* This subroutine opens and reads the ship station table. * C* * C* UA_SDOR ( SHPTBL, IRET ) * C* * C* Input parameters: * C* SHPTBL CHAR* Ship 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************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'uacmn.cmn' INCLUDE 'uacmn_stntbl.cmn' C* CHARACTER*(*) shptbl C* CHARACTER stnnam*32, tbchrs*20, stat*2 C------------------------------------------------------------------------ iret = -1 C C* Open the ship station table file. C CALL FL_TBOP ( shptbl, 'stns', iunstb, iertop ) IF ( iertop .ne. 0 ) THEN CALL DC_WLOG ( 0, 'FL', iertop, shptbl, ierwlg ) RETURN END IF C C* Read in the ship station table file. C ii = 1 ierrst = 0 DO WHILE ( ( ii .le. LLSTFL ) .and. ( ierrst .eq. 0 ) ) CALL TB_RSTN ( iunstb, sdstid (ii), stnnam, istnm, + stat, sdcoun (ii), slat, slon, + sdselv (ii), ispri, tbchrs, ierrst ) C C* Decode sdregn (ii) and sdinst (ii) from tbchrs. C READ ( UNIT = tbchrs, FMT = '(I1, I2)', IOSTAT = ierred ) + sdregn (ii), sdinst (ii) IF ( ierred .ne. 0 ) THEN sdregn (ii) = IMISSD sdinst (ii) = IMISSD END IF ii = ii + 1 END DO C IF ( ierrst .eq. -1 ) THEN iret = 0 nsde = ii - 1 END IF C C* Close the ship station table file. C CALL FL_CLOS ( iunstb, iercls ) C* RETURN END