SUBROUTINE BT_BSC2 ( lenrpt, report, ipt, iret ) C************************************************************************ C* BT_BSC2 * C* * C* This subroutine decodes the groups in section 2 and 3 of the bathy * C* report. The section 2 groups contain the type of instrumentation * C* and the temperatures at the given depths. The section 3 groups * C* contain the total water depth and surface current data. * C* * C* BT_BSC2 ( LENRPT, REPORT, IPT, IRET ) * C* * C* Input parameters: * C* * C* REPORT CHAR* Report array * C* LENRPT INTEGER Length of report minus section 4* C* IPT INTEGER Points to start of 8888k group * C* in section 2 * C* * C* Output parameters: * C* * C* RIVALS(IRIDGT) REAL Indicator for digitization * C* RIVALS(IRIWTM) REAL Instrument for water temp meas * C* RIVALS(IRWTMR) REAL Water temperature recorder type * C* IRET INTEGER Return code * C* 0 = Normal return * C* 1 = No section 2 data * C* * C** * C* Log: * C* R. Hollern/NCEP 11/98 * C* R. Hollern/NCEP 4/00 Added call to BT_INST * C* C. Caruso Magee/NCEP 11/02 Remove arg sc3cur from call to btbsc3 * C* and btdbat, and clean up doc block. * C************************************************************************ INCLUDE 'btcmn.cmn' C* CHARACTER*(*) report C* CHARACTER fld1*1 C------------------------------------------------------------------------ iret = 0 ip = ipt istrs3 = 0 C C* Check if section 2 data. C IF ( report(ip:ip+3) .ne. '8888' ) THEN iret = 1 RETURN END IF C C* Get the indicator for digitization. C ip = ip + 4 C fld1 = report ( ip:ip ) C CALL ST_INTG ( fld1, ival, ier ) IF ( ier .eq. 0 ) THEN rivals ( iridgt ) = FLOAT ( ival ) END IF C ip = ip + 2 C C* Get the instrument type for water temperature measurements. C CALL BT_INST( report, ip, iret ) IF ( iret .eq. 1 ) THEN RETURN END IF C C* Check if there is a section 3 in the report. C ip = ip + 3 C ii = index ( report(ip:lenrpt), '66666' ) C IF ( ii .gt. 0 ) THEN C C* Determine start of section 3 and end of section 2. Istrs3 is a C* pointer set to 0, if no section 3; else, it's set to start of 1ZZZZ C* group in section 3. C iends2 = ip + ii - 2 istrs3 = ip + ii + 5 C C* Decode section 3 groups. C CALL BT_BSC3 ( lenrpt, report, istrs3, ierr2 ) C ELSE iends2 = lenrpt END IF C C* Decode the bathythermal data. C CALL BT_DBAT ( iends2, report, ip, ierr1 ) C IF ( ierr1 .eq. 1 ) THEN iret = 1 RETURN END IF C ipt = ip C* RETURN END