SUBROUTINE DB_S4EG ( dburpt, ipt, eg2nd8, iret ) C************************************************************************ C* DB_S4EG * C* * C* This subroutine decodes two of the drifting buoy section 4 * C* groups 8V(i)V(i)V(i)V(i) (if the buoy is of type Lagrangian), or only* C* one (if the buoy is non-Lagrangian). This field contains information* C* on the engineering status of the buoy. If Lagrangian buoy, first 8 * C* field is battery voltage and 2nd is submergence. If non-Lagrangian, * C* field is unknown engineering status information. * C* * C* DB_S4EG ( DBURPT, IPT, EG2ND8, IRET ) * C* * C* Input parameters: * C* DBURPT CHAR* Report array * C* * C* Input and Output parameters: * C* IPT INTEGER On input, points to the space * C* preceding the group 8VVVV; on * C* output, points to the last V * C* in last 8VVVV group. * C* * C* Output parameters passed via common: * C* RIVALS(IRBENG) REAL Engineering status information * C* on the buoy (non-Lagrangian) * C* RIVALS(IRBVOL) REAL Battery voltage in tenths of * C* Volts (Lagrangian) * C* * C* Output parameters: * C* EG2ND8 REAL 2nd 8 group data. Will check * C* in dbsc4d to see if drifter is * C* Lagrangian and has reported * C* drogue depth of 15 meters. If * C* so, store eg2nd8 into rivals * C* array element irldrs. * C* IRET INTEGER Return code * C* 0 = Normal return * C* 1 = Problems * C** * C* Log: * C* R. Hollern/NCEP 12/99 * C* C. Caruso Magee/NCEP 03/2000 Fixed docblock comments. * C* C. Caruso Magee/NCEP 06/2004 Added code to save irbvol and irldrs if* C* Lagrangian buoy. * C* C. Caruso Magee/NCEP 06/2004 modify to store eg2nd8 for now and save* C* to irldrs in dbsc4d.f. * C* C. Caruso Magee/NCEP 03/2006 correct docblock. * C************************************************************************ INCLUDE 'dbcmn.cmn' C* CHARACTER*(*) dburpt C* CHARACTER fld4*4 REAL eg2nd8 C------------------------------------------------------------------------ iret = 0 ipt = ipt + 2 fld4 = dburpt ( ipt:ipt+3 ) C C* Check buoy type. If Lagrangian, first field is battery voltage and C* second is submergence. If non-Lagrangian, only decode first 8 group C* found and save into irbeng (not saved into BUFR at present). C IF ( rivals ( irbuyt ) .ne. 1. ) THEN C C* non-Lagrangian buoy C CALL ST_INTG ( fld4, ival, ier ) ipt = ipt + 3 IF ( ier .eq. 0 ) THEN rivals ( irbeng ) = FLOAT ( ival ) END IF ELSE C C* Lagrangian buoy C CALL ST_INTG ( fld4, ival, ier ) ipt = ipt + 3 IF ( ier .eq. 0 ) THEN rivals ( irbvol ) = FLOAT ( ival ) END IF C C* Check for 2nd 8 group. Decode if present. C IF ( dburpt ( ipt+1:ipt+2 ) .eq. ' 8' ) THEN ipt = ipt + 3 fld4 = dburpt ( ipt:ipt+3 ) CALL ST_INTG ( fld4, ival, ier ) ipt = ipt + 3 IF ( ier .eq. 0 ) THEN eg2nd8 = FLOAT ( ival ) END IF END IF END IF C* RETURN END