SUBROUTINE DB_SC3D ( dburpt, iret ) C************************************************************************ C* DB_SC3D * C* * C* This subroutine calls the routine which decodes the groups in * C* section 3 of the drifting buoy report. This section contains * C* temperatures, salinity and current (when available) at selected * C* depths. * C* * C* DB_SC3D ( DBURPT, IRET ) * C* * C* Input parameters: * C* DBURPT CHAR* Report array * C* * C* Input parameters passed via common: * C* LSEC3 INTEGER Length of section 3 * C* ISEC3 INTEGER Pointer to start of section 3 * C* * C* Output parameters passed via common: * C* RIVALS(IRQ3D1) REAL Quality control indicator for * C* temperature/salinity profile. * C* WMO Code Table 3334. * C* RIVALS(IRQ3D2) REAL Quality control indicator for * C* current profile. WMO Code * C* Table 3334. * C* RIVALS(IRMRMV) REAL Method of removing velocity and * C* movement of platform from cur- * C* rent measurement. WMO Code * C* Table 2267. * C* RIVALS(IRDTCC) REAL Duration and time of current * C* measurement. WMO Code Table * C* 2264. * C* RIVALS(IRNDDC) REAL Number of levels of subsfc * C* current data. * C* RIVALS(IRDBSC) REAL Depth below sfc (meters). * C* RIVALS(IRDROC) REAL Direction towards which current * C* is heading (degrees). * C* RIVALS(IRSPOC) REAL Speed of current (m/s). * C* * C* Output parameters: * 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 12/2002 Add code to decode subsfc current * C* data. * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'dbcmn.cmn' C* CHARACTER*(*) dburpt C* CHARACTER fld1*1 C------------------------------------------------------------------------ iret = 0 ipt = isec3 iend = isec3 + lsec3 - 1 C C* Get the quality control indicator for temperature/salinity C* profile. C fld1 = dburpt (ipt:ipt) CALL ST_INTG ( fld1, ival, ier ) IF ( ier .eq. 0 ) rivals ( irq3d1 ) = FLOAT ( ival ) C C* Get the quality control indicator for current profile. C ipt = ipt + 1 fld1 = dburpt (ipt:ipt) CALL ST_INTG ( fld1, ival, ier ) IF ( ier .eq. 0 ) rivals ( irq3d2 ) = FLOAT ( ival ) C DO WHILE ( ipt .lt. iend ) C ipt = ipt + 1 C IF ( dburpt ( ipt:ipt+4 ) .eq. ' 8887' ) THEN C C* Decode the depth, temperature and salinity data groups. C ipt = ipt + 5 C CALL DB_TESA( dburpt, iend, ipt, jret ) C ELSE IF ( dburpt ( ipt:ipt+2 ) .eq. ' 66' ) THEN C C* Decode section 3 subsurface current data. C CALL UT_SEC3 ( iend, dburpt, ipt, 'BUOY', 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 and duration and time C* of current measurement into Interface. C rivals ( irmrmv ) = rmrmv 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. 200 ) 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 C* whole 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 C* into Interface. C rivals ( irspoc ( i ) ) = PR_D100 ( rspoc ( i ) ) END DO END IF END IF END IF END DO C* RETURN END