SUBROUTINE SY_SCLD ( iubfma, iubfmn, rptok ) C************************************************************************ C* SY_SCLD * C* * C* This routine gets and stores the supplemental cloud data. * C* * C* SY_SCLD ( IUBFMA, IUBFMN, RPTOK ) * C* * C* Input parameters: * C* IUBFMA INTEGER Logical unit number of messages * C* file for BUFR input stream * C* IUBFMN INTEGER Logical unit number of messages * C* file for BUFR output stream * C* Output parameters: * C* RPTOK LOGICAL .TRUE. iff no errors have been * C* found in the current input BUFR * C* report which would make it * C* questionable to write output * C* to the BUFR output stream * C** * C* Log: * C* J. Ator/NCEP 09/12 * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'sycmn.cmn' C* LOGICAL rptok C* REAL*8 r8scld (5,MXLV) C* CHARACTER tagsc*10 C*----------------------------------------------------------------------- C C* Locate the name of the sequence containing the supplemental C* cloud layers. C CALL GETTAGPR ( iubfma, 'CLAM', 2, tagsc, ierctg ) IF ( ierctg .eq. 0 ) THEN CALL UFBSEQ ( iubfma, r8wk, MXMN, MXLV, nlv, tagsc ) IF ( nlv .gt. 20 ) THEN rptok = .false. RETURN ELSE IF ( nlv .gt. 0 ) THEN C C* Store the supplemental cloud layers. C DO jj = 1, nlv r8scld (1,jj) = r8wk (1,jj) r8scld (2,jj) = r8wk (2,jj) r8scld (3,jj) = r8wk (3,jj) IF ( gots96 .or. gots91 ) THEN r8scld (4,jj) = r8wk (4,jj) r8scld (5,jj) = r8wk (5,jj) ELSE r8scld (4,jj) = r8bfms r8scld (5,jj) = r8wk (4,jj) END IF END DO CALL DRFINI ( iubfmn, nlv, 1, '{BSYSCLD}' ) CALL UFBSEQ ( iubfmn, r8scld, 5, nlv, nlv2, 'BSYSCLD' ) END IF END IF C C* Locate the name of the sequence containing the cloud bases C* below station level. C CALL GETTAGPR ( iubfma, 'CTDS', 1, tagsc, ierctg ) IF ( ierctg .eq. 0 ) THEN CALL UFBSEQ ( iubfma, r8wk, MXMN, MXLV, nlv, tagsc ) IF ( nlv .gt. 20 ) THEN rptok = .false. RETURN ELSE IF ( nlv .gt. 0 ) THEN C C* Store the cloud bases below station level. C CALL DRFINI ( iubfmn, nlv, 1, '{BSYBCLD}' ) CALL UFBSEQ ( iubfmn, r8wk, MXMN, nlv, nlv2, 'BSYBCLD' ) END IF END IF C C* Get the cloud drift data. C CALL UFBSEQ ( iubfma, r8wk, MXMN, MXLV, nlv, 'DIRCLDFT' ) IF ( ( IBFMS ( r8wk (2,1) ) .eq. 0 ) .or. + ( IBFMS ( r8wk (4,1) ) .eq. 0 ) .or. + ( IBFMS ( r8wk (6,1) ) .eq. 0 ) ) THEN CALL DRFINI ( iubfmn, 1, 1, '' ) CALL UFBSEQ ( iubfmn, r8wk, MXMN, 1, nlv2, 'DIRCLDFT' ) END IF C* RETURN END