SUBROUTINE BT_TSEC ( mszrpt, report, ierr1 ) C************************************************************************ C* BT_TSEC * C* * C* This subroutine calls the routines which decode sections 1, 2, 3, * C* and 4 of the tesac report. * C* * C* BT_BSEC ( MSZRPT, REPORT, IERR1 ) * C* * C* Input parameters: * C* * C* MSZRPT INTEGER Report size in bytes * C* REPORT CHAR* Report array * C* * C* Output parameters: * C* * C* IERR1 INTEGER Return code * C* 0 = Normal return * C* 1 = Problems * C** * C* Log: * C* R. Hollern/NCEP 01/99 * C* C. Caruso Magee/NCEP 03/02 Add new subroutine to decode Section * C* 3 current data. * C* C. Caruso Magee/NCEP 11/02 Rewrite s/r BT_TSC3 to UT_SEC3. * C* C. Caruso Magee/NCEP 04/03 Change nlev of subsfc current from * C* 200 to MXDLYR. * C************************************************************************ INCLUDE 'btcmn.cmn' C* CHARACTER*(*) report C------------------------------------------------------------------------ ierr1 = 0 C C* Get the ship or buoy ID. C CALL BT_RPID ( mszrpt, report, lenrpt, ierr2 ) C IF ( ierr2 .eq. 2 ) THEN ierr1 = 1 RETURN END IF C C* Decode the groups in section 1. C CALL BT_SEC1 ( report, ipt, ierr2 ) C IF ( ierr2 .eq. 1 ) THEN ierr1 = 1 RETURN END IF C C* Start of section 2. C istsc2 = ipt C C* Decode the groups in section 4. C CALL BT_TSC4 ( lenrpt, report, istsc2, ierr2 ) C C* Decode the groups in sections 2. C CALL BT_TSC2 ( lenrpt, report, istsc2, istsc3, ierr2 ) C C* Decode the groups in sections 3. C IF ( istsc3 .gt. 0 ) THEN CALL UT_SEC3 ( lenrpt, report, istsc3, 'TESAC', ierr2 ) IF ( ierr2 .eq. 0 ) THEN C C* Store decoded data into rivals arrays. C* First, store method of removing velocity and movement of C* platform from current measurement, period of current C* measurement, and duration and time of current measurement C* into Interface. C rivals ( irmrmv ) = rmrmv rivals ( irpocm ) = rpocm rivals ( irdtcc ) = rdtcc C C* Store number of levels of current data into Interface. C rivals ( irnddc ) = rnddc nlev = NINT ( rivals ( irnddc ) ) IF ( nlev .gt. 0 .and. nlev .le. MXDLYR ) THEN DO i = 1, rivals ( irnddc ) C C* Store selected/sig depths in meters into Interface. C rivals ( irdbsc ( i ) ) = rdbsc ( i ) C C* Convert current direction from tens of degrees into whole C* degrees and store into Interface. C rivals ( irdroc ( i ) ) = 10. * rdroc ( i ) C C* Convert current speed from cm/s to m/s and store into C* Interface. C rivals ( irspoc ( i ) ) = PR_D100 ( rspoc ( i ) ) END DO END IF END IF END IF C* RETURN END