SUBROUTINE BT_SEC1 ( report, ipt, iret ) C************************************************************************ C* BT_SEC1 * C* * C* This subroutine decodes the groups in section 1 of a bathy, tesac, * C* or trackob report. It also decodes the first 3 groups in section 2 * C* of a trackob report. These groups contain the observation time, the * C* latitude and longitude location, the wind direction and speed, and * C* the air temperature. The wind and air temperature groups are * C* optional. The elevation at the report site is set to 0.0 meters. * C* * C* BT_SEC1 ( REPORT, IPT, IRET ) * C* * C* Input parameters: * C* REPORT CHAR* Report array * C* IRPTYP INTEGER Report type identifier * C* = 1, BATHY (JJYY) report * C* = 2, TESAC (KKXX) report * C* = 3, TRACKOB (NNXX) report * C* = 4, BATHY (JJVV) report with * C* a high precision lat/long * C* = 5, TESAC (KKYY) report with * C* a high precision lat/long * C* * C* Output parameters: * C* IRPTDT (*) INTEGER Report date-time * C* (YYYY, MM, DD, HH, MM) * C* RIVALS(IRSELV) REAL Elevation of station in meters * C* RIVALS(IRSLAT) REAL Latitude in degrees * C* RIVALS(IRSLON) REAL Longitude in degrees * C* RIVALS(IRDRCT) REAL Wind direction in degrees * C* RIVALS(IRSPED) REAL Wind speed in meters/second * C* IPT INTEGER Points to start of next group * C* in report * C* IRET INTEGER Return code * C* 0 = Normal return * C* 1 = Problems * C* * C** * C* Log: * C* R. Hollern/NCEP 11/98 * C* R. Hollern/NCEP 1/99 Generalized routine to decode both * C* bathy or tesac section 1 groups * C* R. Hollern/NCEP 3/99 Added code to decode trackob report data* C* R. Hollern/NCEP 4/00 Removed code to save report correction * C* indicator * C* J. Ator/NCEP 01/02 Updated docblock * C* J. Ator/NCEP 02/06 Updated docblock * C************************************************************************ INCLUDE 'btcmn.cmn' C* CHARACTER*(*) report C* CHARACTER fld1*1 C------------------------------------------------------------------------ iret = 0 ip = 1 C C* Set elevation to 0.0 meters. C rivals ( irselv ) = 0.0 C C* Get the GMT observation time of data. C CALL BT_OBST ( report, ip, iret ) IF ( iret .eq. 1 ) THEN RETURN END IF C C* Get the latitude and longitude location. C IF ( irptyp .eq. 4 .or. irptyp .eq. 5 ) THEN CALL BT_PLTL ( report, ip, iret ) ELSE CALL BT_LTLG ( report, ip, iret ) IF ( iret .eq. 1 ) THEN RETURN END IF END IF C IF ( irptyp .eq. 3 ) THEN ipt = ip RETURN END IF C C* Check if next group is the wind data group. C fld1 = report(ip:ip) C IF ( fld1 .eq. '0' .or. fld1 .eq. '1' .or. + fld1 .eq. '2' .or. fld1 .eq. '3' ) THEN CALL BT_DDFF ( report, ip, ierr1 ) END IF C C* Check if next group is the air temperature group. C fld1 = report(ip:ip) C IF ( fld1 .eq. '4' ) THEN ip = ip + 1 CALL BT_TEMP ( report, ip, ierr1 ) END IF C ipt = ip C* RETURN END