SUBROUTINE DB_SC4D ( dburpt, iret ) C************************************************************************ C* DB_SC4D * C* * C* This subroutine calls the routines which decode the groups in * C* section 4 of the drifting buoy report. These section contains * C* quality control data and information on engineering and technical * C* parameters. * C* * C* DB_SC4D ( DBURPT, IRET ) * C* * C* Input parameters: * C* DBURPT CHAR* Report array * C* * C* Input parameters passed via common: * C* LSEC4 INTEGER Length of section 4 in report * C* ISEC4 INTEGER Pointer to start of section 4 * C* * C* Output parameters: * C* RIVALS(IRLDRS) REAL Lagrangian drifter submergence * 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 07/2001 Add code to decode new groups 3, 4, * C* 5, and 6. * C* C. Caruso Magee/NCEP 06/2004 Add rivals (irldrs) and add eg2nd8 * C* to calling sequence of dbs4eg.f. * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'dbcmn.cmn' C* CHARACTER*(*) dburpt REAL eg2nd8 C------------------------------------------------------------------------ iret = 0 iql = 0 eg2nd8 = RMISSD C ip = isec4 jflg0 = 0 jflg1 = 0 jflg2 = 0 jflg3 = 0 jflg4 = 0 jflg5 = 0 jflg6 = 0 C iend = isec4 + lsec4 - 1 ipt = ip C DO WHILE ( ipt .lt. iend ) C ipt = ipt + 1 C IF ( dburpt (ipt:ipt+1) .eq. ' 9' .and. + jflg0 .eq. 0 ) THEN C C* Decode the drogue data. C CALL DB_S4DG ( dburpt, ipt, jret ) jflg0 = 1 ELSE IF ( dburpt (ipt:ipt+1) .eq. ' 8' .and. + jflg1 .eq. 0 ) THEN C C* Decode the engineering data. C CALL DB_S4EG ( dburpt, ipt, eg2nd8, jret ) jflg1 = 1 ELSE IF ( dburpt ( ipt:ipt+1 ) .eq. ' 1' .and. + jflg2 .eq. 0 ) THEN C C* Decode the first set of quality control indicators. C ipt = ipt + 2 CALL DB_DS4Q ( dburpt, ipt, jret ) jflg2 = 1 ELSE IF ( dburpt (ipt:ipt+1) .eq. ' 2' .and. + jflg3 .eq. 0 ) THEN C C* Decode the second set of quality control indicators. C ipt = ipt + 2 CALL DB_DS4R ( dburpt, ipt, jret ) jflg3 = 1 C iql = rivals ( irqcil ) + .05 C IF ( iql .eq. 1 ) THEN C C* Decode the time and location of the last known C* position of the buoy. C CALL DB_S4TP ( dburpt, iend, ipt, iptout, jret ) ipt = iptout C ELSE IF ( iql .eq. 2 ) THEN C C* Decode the latitude and longitude location of the C* second possible solution (symmetrical to the C* satellite subtrack). C CALL DB_S4LL ( dburpt, ipt, jret ) END IF ELSE IF ( dburpt (ipt:ipt+1) .eq. ' 3' .and. + jflg4 .eq. 0 ) THEN C C* Decode the hydrostatic pressure of lower end of the C* cable and the length of the cable (groups 3 and 4). C CALL DB_S4PL ( dburpt, ipt, jret ) jflg4 = 1 ELSE IF ( dburpt (ipt:ipt+1) .eq. ' 5' .and. + jflg5 .eq. 0 ) THEN C C* Decode the buoy type and drogue type. C CALL DB_S4BD ( dburpt, ipt, jret ) jflg5 = 1 ELSE IF ( dburpt (ipt:ipt+1) .eq. ' 6' .and. + jflg6 .eq. 0 ) THEN C C* Decode the anemometer height and type. C CALL DB_S4AN ( dburpt, ipt, jret ) jflg6 = 1 END IF END DO C C* Check drogue depth. If Lagrangian drifter, and if drogue depth C* is 15 meters, store second 8 group data into rivals (irldrs). C* Only store submergence if it's between 0% and 100%. C IF ( ( rivals ( irdrod ) .eq. 15. ) .and. + ( rivals ( irbuyt ) .eq. 1. ) .and. + ( eg2nd8 .ne. RMISSD ) ) THEN IF ( eg2nd8 .ge. 0. .and. eg2nd8 .le. 100. ) THEN rivals ( irldrs ) = eg2nd8 END IF END IF C RETURN END