SUBROUTINE CUCALLNTL &
 & (  KIDIA,    KFDIA,    KLON,   KLEV,&
 & KSTEP,   LDLAND,&
 & PTSPHY,&
 & PTM15,    PQM15,    PUM15,    PVM15,   PLITOT5,&
 & PVERVEL5, PQHFL5,   PAHFS5,   PAPHM15,&
 & PAP5,     PAPH5,    PGEO5,    PGEOH5,&
 & PTENT5,   PTENQ5,   PTENU5,   PTENV5,  PARPRC5,&
 & KTOPC,    KBASEC,   KTYPE,&
 & KCBOT,    KCTOP,    KBOTSC,   LDCUM,   LDSC,&
 & PLU5,     PLUDE5,   PMFU5,    PMFD5,&
 & PDIFCQ5,  PDIFCS5,  PFHPCL5,  PFHPCN5,&
 & PFPLCL5,  PFPLCN5,  PSTRCU5,  PSTRCV5, PFCQLF5,PFCQIF5,&
 & KTRAC,    PCM15,    PTENC5,   PSCAV5,&
 & PTM1,     PQM1,     PUM1,     PVM1,&
 & PVERVEL,  PQHFL,    PAHFS,&
 & PAP,      PAPH,     PGEO,     PGEOH,&
 & PTENT,    PTENQ,    PTENU,    PTENV,   PARPRC,&
 & PLU,      PLUDE,    PMFU,     PMFD,&
 & PFPLCL,   PFPLCN,&
 & PCM1,     PTENC)  

!          *CUCALLNTL* - MASTER ROUTINE - PROVIDES INTERFACE FOR:
!                       *CUMASTRNTL* (CUMULUS PARAMETERIZATION)
!                       *CUCCDIATL* (CUMULUS CLOUDS FOR RADIATION)
!                       *CUSTRATTL* (PBL_STRATOCUMULUS)

!           J.F. MAHFOUF   E.C.M.W.F.     05/12/96

!           Adapted from 

!           M.TIEDTKE      E.C.M.W.F.     12/1989

!**   PURPOSE.
!     --------

!          *CUCALLNTL* - INTERFACE FOR *CUMASTRNTL*,*CUCCDIATL* AND *CUSTRATTL*:
!                        PROVIDES INPUT FOR CUMASTRNTL, CUCCDIANTL AND CUSTRATTL.
!                        RECEIVES UPDATED TENDENCIES, PRECIPITATION
!                        AND CONVECTIVE CLOUD PARAMETERS FOR RADIATION.

!**   INTERFACE.
!     ----------

!          *CUCALLNTL* IS CALLED FROM *CALLPARTL*

!     PARAMETER     DESCRIPTION                                   UNITS
!     ---------     -----------                                   -----
!     INPUT PARAMETERS (INTEGER):

!    *KIDIA*        START POINT
!    *KFDIA*        END POINT
!    *KLON*         NUMBER OF GRID POINTS PER PACKET
!    *KLEV*         NUMBER OF LEVELS
!    *KTRAC*        NUMBER OF TRACERS
!    *KSTEP*        CURRENT TIME STEP INDEX

!     INPUT PARAMETERS (LOGICAL)

!    *LDLAND*       LAND SEA MASK (.TRUE. FOR LAND)

!     INPUT PARAMETERS (REAL)

!    *PTSPHY*       TIME STEP FOR THE PHYSICS                     S
!    *PTM15*        TEMPERATURE (T-1)                           (Trajectory)
!    *PQM15*        SPECIFIC HUMIDITY (T-1)                     (Trajectory)
!    *PUM15*        X-VELOCITY COMPONENT (T-1)                  (Trajectory)
!    *PVM15*        Y-VELOCITY COMPONENT (T-1)                  (Trajectory)
!    *PCM15*        CHEMICAL TRACERS                            (Trajectory)
!    *PLITOT5*      GRID MEAN LIQUID WATER+ICE CONTENT          (Trajectory)
!    *PVERVEL5*     VERTICAL VELOCITY                           (Trajectory)
!    *PQHFL5*       MOISTURE FLUX (EXCEPT FROM SNOW EVAP.)      (Trajectory)
!    *PAHFS5*       SENSIBLE HEAT FLUX                          (Trajectory)
!    *PAPHM15*      PRESSURE ON HALF LEVELS                     (Trajectory)
!    *PAP5*         PROVISIONAL PRESSURE ON FULL LEVELS         (Trajectory)
!    *PAPH5*        PROVISIONAL PRESSURE ON HALF LEVELS         (Trajectory)
!    *PGEO5*        GEOPOTENTIAL                                (Trajectory)
!    *PGEOH5*       GEOPOTENTIAL ON HALF LEVELS                 (Trajectory)
!    *PSCAV5*       SCAVENGING COEFFICIENT                      (Trajectory)

!    *PTM1*         TEMPERATURE (T-1)                             K
!    *PQM1*         SPECIFIC HUMIDITY (T-1)                       KG/KG
!    *PUM1*         X-VELOCITY COMPONENT (T-1)                    M/S
!    *PVM1*         Y-VELOCITY COMPONENT (T-1)                    M/S
!    *PCM1*         CHEMICAL TRACERS                            
!    *PVERVEL*      VERTICAL VELOCITY                             PA/S
!    *PQHFL*        MOISTURE FLUX (EXCEPT FROM SNOW EVAP.)     KG/(SM2)
!    *PAHFS*        SENSIBLE HEAT FLUX                            W/M2
!    *PAP*          PROVISIONAL PRESSURE ON FULL LEVELS           PA 
!    *PAPH*         PROVISIONAL PRESSURE ON HALF LEVELS           PA
!    *PGEO*         GEOPOTENTIAL                                  M2/S2
!    *PGEOH*        GEOPOTENTIAL ON HALF LEVELS                   M2/S2

!    UPDATED PARAMETERS (REAL):

!    *PTENT5*       TEMPERATURE TENDENCY                       (Trajectory)
!    *PTENQ5*       MOISTURE TENDENCY                          (Trajectory)
!    *PTENU5*       TENDENCY OF U-COMP. OF WIND                (Trajectory)
!    *PTENV5*       TENDENCY OF V-COMP. OF WIND                (Trajectory)
!    *PTENC5*       TRACER TENDENCIES                          (Trajectory)
!    *PARPRC5       ACCUMULATED PRECIPITATION AMMOUNT          (Trajectory)
!                   FOR RADIATION CALCULATION

!    *PTENT*        TEMPERATURE TENDENCY                         K/S 
!    *PTENQ*        MOISTURE TENDENCY                           KG/(KG S)
!    *PTENU*        TENDENCY OF U-COMP. OF WIND                  M/S2
!    *PTENV*        TENDENCY OF V-COMP. OF WIND                  M/S2 
!    *PTENC*        TRACER TENDENCIES                          
!    *PARPRC*       ACCUMULATED PRECIPITATION AMMOUNT           KG/(M2*S)
!                   FOR RADIATION CALCULATION

!    UPDATED PARAMETERS (INTEGER):

!    *KTOPC*        UPDATED CONVECTIVE CLOUD TOP LEVEL FOR RADIATION
!    *KBASEC*       UPDATED CONVECTIVE CLOUD BASE LEVEL FOR RADIATION

!    OUTPUT PARAMETERS (INTEGER):

!    *KTYPE*        TYPE OF CONVECTION
!                       1 = PENETRATIVE CONVECTION
!                       2 = SHALLOW CONVECTION
!                       3 = MIDLEVEL CONVECTION 
!    *KCBOT*        CLOUD BASE LEVEL
!    *KCTOP*        CLOUD TOP LEVEL
!    *KBOTSC*       CLOUD BASE LEVEL FOR SC-CLOUDS

!    OUTPUT PARAMETERS (LOGICAL):

!    *LDCUM*        FLAG: .TRUE. FOR CONVECTIVE POINTS 
!    *LDSC*         FLAG: .TRUE. FOR SC-POINTS

!    OUTPUT PARAMETERS (REAL):

!    *PLU5*         LIQUID WATER CONTENT IN UPDRAFTS          (Trajectory)
!    *PLUDE5*       DETRAINED LIQUID WATER                    (Trajectory) 
!    *PMFU5*        MASSFLUX UPDRAFTS                         (Trajectory) 
!    *PMFD5*        MASSFLUX DOWNDRAFTS                       (Trajectory) 
!    *PDIFCQ5*      CONVECTIVE FLUX OF SPECIFIC HUMIDITY      (Trajectory) 
!    *PDIFCS5*      CONVECTIVE FLUX OF HEAT                   (Trajectory) 
!    *PFHPCL5*      ENTHALPY FLUX DUE TO CONVECTIVE RAIN      (Trajectory) 
!    *PFHPCN5*      ENTHALPY FLUX DUE TO CONVECTIVE SNOW      (Trajectory) 
!    *PFPLCL5*      CONVECTIVE RAIN FLUX                      (Trajectory) 
!    *PFPLCN5*      CONVECTIVE SNOW FLUX                      (Trajectory) 
!    *PSTRTU5*      CONVECTIVE FLUX OF U-MOMEMTUM             (Trajectory)
!    *PSTRTV5*      CONVECTIVE FLUX OF V-MOMEMTUM             (Trajectory)
!    *PFCQLF5*      CONVECTIVE CONDENSATION FLUX LIQUID       (Trajectory) 
!    *PFCQIF5*      CONVECTIVE CONDENSATION FLUX ICE          (Trajectory) 

!    *PLU*          LIQUID WATER CONTENT IN UPDRAFTS            KG/KG
!    *PLUDE*        DETRAINED LIQUID WATER                      KG/(M3*S)
!    *PMFU*         MASSFLUX UPDRAFTS                           KG/(M2*S)
!    *PMFD*         MASSFLUX DOWNDRAFTS                         KG/(M2*S)
!    *PFPLCL*       CONVECTIVE RAIN FLUX                        KG/(M2*S)
!    *PFPLCN*       CONVECTIVE SNOW FLUX                        KG/(M2*S)

!     EXTERNALS.
!     ----------

!          CUMASTRNTL
!          CUCCDIATL
!          CUSTRATTL

!          MODIFICATIONS
!          -------------
!             92-09-21 : Update to Cy44      J.-J. MORCRETTE
!             96-09-20 : Modified to work with diagnostic
!                                            cloud scheme D.GREGORY
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!             06-02-11 : Add Tracers            P. BECHTOLD

!----------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

USE YOMCST   , ONLY : RG       ,R        ,RV       ,RCPD     ,&
 & RCPV     ,RETV     ,RCW      ,RCS      ,RLVTT    ,&
 & RLSTT    ,RTT      ,RALPW    ,RBETW    ,RGAMW    ,&
 & RALPS    ,RBETS    ,RGAMS    ,RALPD    ,RBETD    ,&
 & RGAMD  
USE YOETHF   , ONLY : R2ES     ,R3LES    ,R3IES    ,R4LES    ,&
 & R4IES    ,R5LES    ,R5IES    ,RVTMP2   ,R5ALVCP  ,&
 & R5ALSCP  ,RALVDCP  ,RALSDCP  ,RTWAT    ,RTICE   ,RTICECU ,&
 & RTWAT_RTICE_R      ,RTWAT_RTICECU_R  
USE YOECUMF  , ONLY : NJKT2
USE YOEPHY   , ONLY : LEPCLD   ,LMFTRAC
USE YOEPHLI  , ONLY : LPHYLIN  ,RLPTRC
USE YOPHNC   , ONLY : LENCLD2

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KLON 
INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV 
INTEGER(KIND=JPIM),INTENT(IN)    :: KTRAC 
INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KSTEP 
LOGICAL           ,INTENT(IN)    :: LDLAND(KLON) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PTSPHY 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PTM15(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PQM15(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PUM15(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVM15(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCM15(KLON,KLEV,KTRAC) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PSCAV5(KTRAC) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PLITOT5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVERVEL5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PQHFL5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAHFS5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAPHM15(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAP5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAPH5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PGEO5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PGEOH5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENT5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENQ5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENU5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENV5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENC5(KLON,KLEV,KTRAC) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PARPRC5(KLON) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KTOPC(KLON) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KBASEC(KLON) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KTYPE(KLON) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KCBOT(KLON) 
INTEGER(KIND=JPIM),INTENT(INOUT) :: KCTOP(KLON) 
INTEGER(KIND=JPIM),INTENT(OUT)   :: KBOTSC(KLON) 
LOGICAL           ,INTENT(INOUT) :: LDCUM(KLON) 
LOGICAL           ,INTENT(OUT)   :: LDSC(KLON) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PLU5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PLUDE5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PMFU5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PMFD5(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PDIFCQ5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PDIFCS5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFHPCL5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFHPCN5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFPLCL5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFPLCN5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSTRCU5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSTRCV5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFCQLF5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFCQIF5(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PTM1(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PQM1(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PUM1(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVM1(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCM1(KLON,KLEV,KTRAC) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PVERVEL(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PQHFL(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAHFS(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAP(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAPH(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PGEO(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PGEOH(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENT(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENQ(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENU(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENV(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PTENC(KLON,KLEV,KTRAC) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PARPRC(KLON) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PLU(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PLUDE(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PMFU(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PMFD(KLON,KLEV) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFPLCL(KLON,KLEV+1) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFPLCN(KLON,KLEV+1) 

REAL(KIND=JPRB) ::     ZTP15(KLON,KLEV),       ZQP15(KLON,KLEV),&
 & ZUP15(KLON,KLEV),       ZVP15(KLON,KLEV),&
 & ZTU5(KLON,KLEV),        ZQU5(KLON,KLEV),&
 & ZQSAT5(KLON,KLEV),      ZRAIN5(KLON)   

REAL(KIND=JPRB) ::     ZTP1(KLON,KLEV),        ZQP1(KLON,KLEV),&
 & ZUP1(KLON,KLEV),        ZVP1(KLON,KLEV),&
 & ZTU(KLON,KLEV),         ZQU(KLON,KLEV),&
 & ZQSAT(KLON,KLEV),       ZRAIN(KLON)         
!-----------------------------------------------------------------------

REAL(KIND=JPRB) :: ZQEA5(KLON,KLEV)&
 & ,  ZTEA5(KLON,KLEV)&
 & ,  ZVEA5(KLON,KLEV)&
 & ,  ZUEA5(KLON,KLEV)&
 & ,  ZENTHD5(KLON,KLEV),ZENTHS5(KLON,KLEV)  
REAL(KIND=JPRB) :: ZCONDFLL5(KLON),ZCONDFLN5(KLON)

REAL(KIND=JPRB) :: ZQEA(KLON,KLEV)&
 & ,  ZTEA(KLON,KLEV)&
 & ,  ZVEA(KLON,KLEV)&
 & ,  ZUEA(KLON,KLEV)&
 & ,  ZENTHD(KLON,KLEV)  

! Tracers
REAL(KIND=JPRB) :: ZCP15(KLON,KLEV,KTRAC), ZCP1(KLON,KLEV,KTRAC)

INTEGER(KIND=JPIM) :: JK, JL, JN

REAL(KIND=JPRB) :: ZALFAW5, ZCP5, ZGDPH5

LOGICAL :: LLTEST
REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "cuccdiatl.intfb.h"
#include "cumastrntl.intfb.h"
#include "custrat.intfb.h"
#include "saturtl.intfb.h"

!DIR$ VFUNCTION EXPHF
#include "fcttrm.h"
#include "fcttre.h"

!-----------------------------------------------------------------------

!*    0.1          STORE T,Q,X,Y TENDENCIES FOR FLUX COMPUTATIONS
!*                 ----------------------------------------------

IF (LHOOK) CALL DR_HOOK('CUCALLNTL',0,ZHOOK_HANDLE)
DO JK=1,KLEV
  DO JL=KIDIA,KFDIA
    ZQEA (JL,JK)=PTENQ (JL,JK)
    ZQEA5(JL,JK)=PTENQ5(JL,JK)
    ZTEA (JL,JK)=PTENT (JL,JK)
    ZTEA5(JL,JK)=PTENT5(JL,JK)
    ZVEA (JL,JK)=PTENV (JL,JK)
    ZVEA5(JL,JK)=PTENV5(JL,JK)
    ZUEA (JL,JK)=PTENU (JL,JK)
    ZUEA5(JL,JK)=PTENU5(JL,JK)
    ZENTHD5(JL,JK)=0.0_JPRB
    ZENTHS5(JL,JK)=0.0_JPRB
  ENDDO
ENDDO
DO JK=1,KLEV+1
  DO JL=KIDIA,KFDIA
    PFPLCL5(JL,JK)=0.0_JPRB
    PFPLCN5(JL,JK)=0.0_JPRB
  ENDDO
ENDDO

!-----------------------------------------------------------------------

!*    1.           CALCULATE T,Q AND QS AT MAIN LEVELS
!*                 -----------------------------------

DO JK=1,KLEV
  DO JL=KIDIA,KFDIA
    ZTP1 (JL,JK)=PTM1 (JL,JK)+PTENT (JL,JK)*PTSPHY
    ZTP15(JL,JK)=PTM15(JL,JK)+PTENT5(JL,JK)*PTSPHY
    ZQP1 (JL,JK)=PQM1 (JL,JK)+PTENQ (JL,JK)*PTSPHY
    ZQP15(JL,JK)=PQM15(JL,JK)+PTENQ5(JL,JK)*PTSPHY
    ZUP1 (JL,JK)=PUM1 (JL,JK)+PTENU (JL,JK)*PTSPHY
    ZUP15(JL,JK)=PUM15(JL,JK)+PTENU5(JL,JK)*PTSPHY
    ZVP1 (JL,JK)=PVM1 (JL,JK)+PTENV (JL,JK)*PTSPHY
    ZVP15(JL,JK)=PVM15(JL,JK)+PTENV5(JL,JK)*PTSPHY
    ZQSAT5(JL,JK)=ZQP15(JL,JK)
    ZQSAT (JL,JK)=ZQP1 (JL,JK)
  ENDDO
ENDDO
IF(KTRAC>0 .AND. LMFTRAC) THEN
  DO JN=1,KTRAC
    DO JK=1,KLEV
      DO JL=KIDIA,KFDIA
        ZCP1 (JL,JK,JN)=PCM1 (JL,JK,JN)+PTENC (JL,JK,JN)*PTSPHY
        ZCP15(JL,JK,JN)=PCM15(JL,JK,JN)+PTENC5(JL,JK,JN)*PTSPHY
      ENDDO
    ENDDO
  ENDDO
ENDIF

CALL SATURTL (KIDIA , KFDIA , KLON  , NJKT2 , KLEV,&
 & PAP5  , ZTP15 , ZQSAT5, &
 & PAP   , ZTP1  , ZQSAT   )  

DO JL=KIDIA,KFDIA
  ZRAIN5(JL)=0.0_JPRB
  LDCUM(JL)=.FALSE.
ENDDO

!-----------------------------------------------------------------------

!*    2.     CALL 'CUMASTRNTL'(MASTER-ROUTINE FOR CUMULUS PARAMETERIZATION) 
!*           -------------------------------------------------------------- 

CALL CUMASTRNTL &
 & (  KIDIA,    KFDIA,    KLON,    KLEV,&
 & LDLAND,   PTSPHY,&
 & ZTP15,    ZQP15,    ZUP15,    ZVP15,    PLITOT5,&
 & PVERVEL5, ZQSAT5,   PQHFL5,   PAHFS5,&
 & PAP5,     PAPH5,    PGEO5,    PGEOH5,&
 & PTENT5,   PTENQ5,   PTENU5,   PTENV5,&
 & LDCUM,    KTYPE,    KCBOT,    KCTOP,&
 & KBOTSC,   LDSC,&
 & ZTU5,     ZQU5,     PLU5,     PLUDE5,&
 & ZENTHD5,  PFPLCL5,  PFPLCN5,  ZRAIN5,&
 & PMFU5,    PMFD5,&
 & KTRAC,    ZCP15,    PTENC5,   PSCAV5,&
 & ZTP1,     ZQP1,     ZUP1,     ZVP1,&
 & PVERVEL,  ZQSAT,    PQHFL,    PAHFS,&
 & PAP,      PAPH,     PGEO,     PGEOH,&
 & PTENT,    PTENQ,    PTENU,    PTENV,&
 & ZTU,      ZQU,      PLU,      PLUDE,&
 & ZENTHD,   PFPLCL,   PFPLCN,   ZRAIN,&
 & PMFU,     PMFD,&
 & ZCP1,     PTENC )  

!----------------------------------------------------------------------

! SECTIONS 3 AND 4 ARE ONLY REQUIRED IF THE DIAGNOSTIC CLOUD SCHEME
! IS USED  : LEPCLD=.FALSE.

!----------------------------------------------------------------------

LLTEST = (.NOT.LEPCLD.AND..NOT.LENCLD2).OR.(LPHYLIN.AND..NOT.LENCLD2)

if (LLTEST) then
!-----------------------------------------------------------------------

!*    3.0       CALL 'CUCCDIATL' TO UPDATE CLOUD PARAMETERS FOR RADIATION
!               ---------------------------------------------------------

  CALL CUCCDIATL &
   & (  KIDIA,    KFDIA,    KLON,   KLEV,&
   & KSTEP,    kcbot,    kctop,&
   & ldcum,    ZQU5,     PLU5,     PMFU5,   ZRAIN5,&
   & PARPRC5,  KTOPC,    KBASEC  )  

!---------------------------------------------------------------------

!*    4.0          CALL 'CUSTRATTL' FOR PARAMETERIZATION OF PBL-CLOUDS
!                  ---------------------------------------------------

!         CALL CUSTRATTL
!     *     (  KIDIA,    KFDIA,    KLON,   KLEV
!     *     ,  Ldcum,    PTSPHY
!     *     ,  PAP5,     PAPH5,    PGEO5
!     *     ,  ZTP15,    ZQP15,    ZQSAT5,  ZENTHS5
!     *     ,  PTENT5,   PTENQ5
!     *     ,  PAP,      PAPH,     PGEO
!     *     ,  ZTP1,     ZQP1,     ZQSAT,   ZENTHS
!     *     ,  PTENT,    PTENQ)

  CALL CUSTRAT &
   & (  KIDIA,    KFDIA,    KLON,   KLEV,&
   & Ldcum,    PTSPHY,&
   & PAP5,     PAPH5,    PGEO5,&
   & ZTP15,    ZQP15,    ZQSAT5,   ZENTHS5,&
   & PTENT5,   PTENQ5)  

ENDIF

!-----------------------------------------------------------------------

!---------------------------------------------------------------------

!*    5.           FLUX COMPUTATIONS
!                  -----------------

DO JL=KIDIA,KFDIA
  PDIFCQ5(JL,1)=0.0_JPRB
  PDIFCS5(JL,1)=0.0_JPRB
  PSTRCU5(JL,1)=0.0_JPRB
  PSTRCV5(JL,1)=0.0_JPRB
  PFCQLF5(JL,1)=0.0_JPRB
  PFCQIF5(JL,1)=0.0_JPRB
  PFHPCL5(JL,1)=0.0_JPRB
  PFHPCN5(JL,1)=0.0_JPRB
  PDIFCS5(JL,1)=0.0_JPRB
  PDIFCQ5(JL,1)=0.0_JPRB
  ZCONDFLL5(JL)=0.0_JPRB
  ZCONDFLN5(JL)=0.0_JPRB
ENDDO

DO JK=1,KLEV
  DO JL=KIDIA,KFDIA

    ZGDPH5   = -RG/(      PAPHM15(JL,JK+1)-PAPHM15(JL,JK) )
!...increment in dry static energy is converted to flux of d.s.e.
    ZCP5=RCPD*(1+RVTMP2*PQM15(JL,JK))
    PDIFCS5(JL,JK+1)=(PTENT5(JL,JK)-ZTEA5(JL,JK))/ZGDPH5*ZCP5 +PDIFCS5(JL,JK)
!...increments in U,V
    PSTRCU5(JL,JK+1)=(PTENU5(JL,JK)-ZUEA5(JL,JK))/ZGDPH5 + PSTRCU5(JL,JK)
    PSTRCV5(JL,JK+1)=(PTENV5(JL,JK)-ZVEA5(JL,JK))/ZGDPH5 + PSTRCV5(JL,JK)

!...increment in Q
    PDIFCQ5(JL,JK+1)=(PTENQ5(JL,JK)-ZQEA5(JL,JK))/ZGDPH5 + PDIFCQ5(JL,JK)

  ENDDO
ENDDO

DO JK=1,KLEV
  DO JL=KIDIA,KFDIA
!... enthalpy flux due to precipitations

    PFHPCL5(JL,JK+1)=-PFPLCL5(JL,JK+1)*RLVTT
    PFHPCN5(JL,JK+1)=-PFPLCN5(JL,JK+1)*RLSTT
    IF (LPHYLIN) THEN
      ZALFAW5=0.545_JPRB*(TANH(0.17_JPRB*(ZTP15(JL,JK)-RLPTRC))+1.0_JPRB)
    ELSE
      ZALFAW5=FOEALFA(ZTP15(JL,JK))
    ENDIF
    ZCONDFLL5(JL)=ZCONDFLL5(JL) + ZALFAW5     *PLUDE5(JL,JK)
    ZCONDFLN5(JL)=ZCONDFLN5(JL) + (1.0_JPRB-ZALFAW5)*PLUDE5(JL,JK)
    PDIFCS5(JL,JK+1)=PDIFCS5(JL,JK+1)-PFHPCL5(JL,JK+1)-&
     & PFHPCN5(JL,JK+1)+&
     & RLVTT * ZCONDFLL5(JL) + RLSTT * ZCONDFLN5(JL)  
    PDIFCQ5(JL,JK+1)=PDIFCQ5(JL,JK+1)-PFPLCL5(JL,JK+1)-&
     & PFPLCN5(JL,JK+1)-&
     & ZCONDFLL5(JL) - ZCONDFLN5(JL)  
    PFCQLF5(JL,JK+1)=ZCONDFLL5(JL)
    PFCQIF5(JL,JK+1)=ZCONDFLN5(JL)
  ENDDO
ENDDO

!---------------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('CUCALLNTL',1,ZHOOK_HANDLE)
END SUBROUTINE CUCALLNTL
