SUBROUTINE TA_CKS3 ( ibull, iret ) C************************************************************************ C* TA_CKS3 * C* * C* This routine checks the locations of the various associated fields * C* within Section 3 of an AirDat/Panasonic TAMDAR BUFR message, to * C* confirm that they apply to the expected descriptors. * C* * C* TA_DCOD ( IBULL, IRET ) * C* * C* Input parameters: * C* IBULL INTEGER(*) TAMDAR BUFR message * C* * C* Output parameters: * C* IRET INTEGER Return code: * C* 0 = normal return * C* -1 = associated fields not as * C* expected within Section 3 * C* * C** * C* Log: * C* J. Ator/NCEP 11/15 * C************************************************************************ INTEGER ibull(*) C* PARAMETER ( MXDSC = 50 ) C* CHARACTER cdesc(MXDSC)*6 C* LOGICAL gotaf002, gotaf007, af002ok, af007ok C*---------------------------------------------------------------------- C CALL UPDS3 ( ibull, MXDSC, cdesc, ndesc ) C C* Confirm that the first defined occurrence of 2-bit associated C* fields applies to the expected descriptors. C gotaf002 = .false. af002ok = .false. ii = 1 DO WHILE ( ( ii .le. ndesc ) .and. ( .not. gotaf002 ) ) IF ( cdesc(ii)(1:6) .eq. '204002' ) THEN gotaf002 = .true. IF ( ( (ii+5) .le. ndesc ) .and. + ( cdesc(ii+2)(1:6) .eq. '001013' ) .and. + ( cdesc(ii+3)(1:6) .eq. '012001' ) .and. + ( cdesc(ii+4)(1:6) .eq. '011002' ) .and. + ( cdesc(ii+5)(1:6) .eq. '011001' ) ) + af002ok = .true. END IF ii = ii + 1 END DO C C* Confirm that the first defined occurrence of 7-bit associated C* fields applies to the expected descriptors. C gotaf007 = .false. af007ok = .false. ii = 1 DO WHILE ( ( ii .le. ndesc ) .and. ( .not. gotaf007 ) ) IF ( cdesc(ii)(1:6) .eq. '204007' ) THEN gotaf007 = .true. IF ( ( (ii+2) .le. ndesc ) .and. + ( cdesc(ii+2)(1:6) .eq. '013009' ) ) + af007ok = .true. END IF ii = ii + 1 END DO C IF ( ( af002ok ) .and. ( af007ok ) ) THEN iret = 0 ELSE iret = -1 END IF C RETURN END