From b5ea700660f410563e750051cbc81bb25dfa7578 Mon Sep 17 00:00:00 2001
From: ESCOBAR Juan <escj@nuwa>
Date: Thu, 24 Mar 2022 19:21:06 +0100
Subject: [PATCH] Juan 24/03/2022:MNH , Bug nvhpc/22.2 doesnt accepte kernel
 present added for Cray -> add #ifdef MNH_COMPILER_CCE

---
 src/MNH/etheta.f90               |  4 ++
 src/MNH/turb_hor_tke.f90         | 12 ++++++
 src/MNH/turb_hor_uv.f90          | 52 ++++++++++++++++++++++++
 src/MNH/turb_hor_uw.f90          |  8 ++++
 src/MNH/turb_hor_vw.f90          |  8 ++++
 src/MNH/turb_ver_dyn_flux.f90    | 68 ++++++++++++++++++++++++++++++++
 src/MNH/turb_ver_thermo_corr.f90 |  8 ++++
 src/MNH/turb_ver_thermo_flux.f90 | 20 ++++++++++
 8 files changed, 180 insertions(+)

diff --git a/src/MNH/etheta.f90 b/src/MNH/etheta.f90
index 74620d766..8768a94d1 100644
--- a/src/MNH/etheta.f90
+++ b/src/MNH/etheta.f90
@@ -193,7 +193,11 @@ ELSE
 !$acc end kernels
 
     IF ( KRRI>0 ) THEN  ! rc and ri case
+#ifdef MNH_COMPILER_CCE
       !$acc kernels present(ZA)
+#else
+      !$acc kernels 
+#endif
       ZRW(:,:,:) = ZRW(:,:,:) + PRM(:,:,:,3)
       !$acc loop seq
       DO JRR=5,KRR
diff --git a/src/MNH/turb_hor_tke.f90 b/src/MNH/turb_hor_tke.f90
index 4e42a64a5..d538b366d 100644
--- a/src/MNH/turb_hor_tke.f90
+++ b/src/MNH/turb_hor_tke.f90
@@ -254,7 +254,11 @@ ZFLX(:,:,IKB:IKB) =                                                      &
 CALL MXM_DEVICE( PK(:,:,IKB:IKB), ZTMP1_DEVICE(:,:,1:1) )
 CALL DXM_DEVICE( PTKEM(:,:,IKB:IKB), ZTMP2_DEVICE(:,:,1:1) )
 CALL MXM_DEVICE( ZFLX (:,:,IKB:IKB), ZTMP3_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLX)
+#else
+!$acc kernels 
+#endif
 ZFLX(:,:,IKB) =                                                &
          - XCET * ZTMP1_DEVICE(:,:,1)                 *  (        &
            ZTMP2_DEVICE(:,:,1) * PINV_PDXX(:,:,IKB)               &
@@ -384,7 +388,11 @@ IF (.NOT. L2D) THEN
 !
 ! special case near the ground ( uncentred gradient )
 !
+#ifdef MNH_COMPILER_CCE   
 !$acc kernels present(ZFLX)  
+#else
+!$acc kernels 
+#endif
   ZFLX(:,:,IKB) =  ZCOEFF(:,:,IKB+2)*PTKEM(:,:,IKB+2)                     &
                  + ZCOEFF(:,:,IKB+1)*PTKEM(:,:,IKB+1)                     &
                  + ZCOEFF(:,:,IKB  )*PTKEM(:,:,IKB  )     
@@ -400,7 +408,11 @@ IF (.NOT. L2D) THEN
   CALL MYM_DEVICE( PK(:,:,IKB:IKB), ZTMP1_DEVICE(:,:,1:1) )
   CALL DYM_DEVICE( PTKEM(:,:,IKB:IKB), ZTMP2_DEVICE(:,:,1:1) )
   CALL MYM_DEVICE( ZFLX (:,:,IKB:IKB), ZTMP3_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLX)
+#else
+!$acc kernels 
+#endif
   ZFLX(:,:,IKB) =                                                      &
      - XCET * ZTMP1_DEVICE(:,:,1) *  (           &
        ZTMP2_DEVICE(:,:,1) * PINV_PDYY(:,:,IKB)                 &
diff --git a/src/MNH/turb_hor_uv.f90 b/src/MNH/turb_hor_uv.f90
index 1720e36ed..016b96123 100644
--- a/src/MNH/turb_hor_uv.f90
+++ b/src/MNH/turb_hor_uv.f90
@@ -395,18 +395,30 @@ CALL DYM_DEVICE(PUM(:,:,IKB:IKB),ZTMP1_DEVICE(:,:,1:1))
 CALL MXM_DEVICE(PDZZ(:,:,IKB+1:IKB+1),ZTMP2_DEVICE(:,:,1:1))
 CALL MXM_DEVICE(PDZZ(:,:,IKB:IKB),ZTMP3_DEVICE(:,:,1:1))
 !
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP5_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP5_DEVICE(:,:,1) = (PUM(:,:,IKB+1)-PUM(:,:,IKB))*(1./ZTMP2_DEVICE(:,:,1)+1./ZTMP3_DEVICE(:,:,1))
 !$acc end kernels
 CALL MYM_DEVICE(ZTMP5_DEVICE(:,:,1:1),ZTMP4_DEVICE(:,:,1:1))
 !
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP5_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP5_DEVICE(:,:,1) = PDZY(:,:,IKB+1) + PDZY(:,:,IKB)
 !$acc end kernels
 CALL MXM_DEVICE(ZTMP5_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
 !
 CALL MXM_DEVICE(PDYY(:,:,IKB:IKB),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP5_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP5_DEVICE(:,:,1) = ( ZTMP1_DEVICE(:,:,1) - ZTMP4_DEVICE(:,:,1)*0.5*ZTMP2_DEVICE(:,:,1) ) &
                       / ZTMP3_DEVICE(:,:,1)
 !$acc end kernels
@@ -416,7 +428,11 @@ CALL DXM_DEVICE(PVM(:,:,IKB:IKB),ZTMP1_DEVICE(:,:,1:1))
 !
 CALL MYM_DEVICE(PDZZ(:,:,IKB:IKB),ZTMP2_DEVICE(:,:,1:1))
 CALL MYM_DEVICE(PDZZ(:,:,IKB+1:IKB+1),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP6_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP6_DEVICE(:,:,1) = (PVM(:,:,IKB+1)-PVM(:,:,IKB))*(1./ZTMP3_DEVICE(:,:,1)+1./ZTMP2_DEVICE(:,:,1))
 !$acc end kernels
 CALL MXM_DEVICE(ZTMP6_DEVICE(:,:,1:1),ZTMP4_DEVICE(:,:,1:1))
@@ -427,7 +443,11 @@ ZTMP6_DEVICE(:,:,1:1) = (PDZX(:,:,IKB+1:IKB+1)+PDZX(:,:,IKB:IKB))
 CALL MYM_DEVICE(ZTMP6_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
 !
 CALL MYM_DEVICE(PDXX(:,:,IKB:IKB),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP6_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP6_DEVICE(:,:,1) = ( ZTMP1_DEVICE(:,:,1) - ZTMP4_DEVICE(:,:,1)*0.5*ZTMP2_DEVICE(:,:,1) ) &
                       / ZTMP3_DEVICE(:,:,1)
 !$acc end kernels
@@ -435,13 +455,21 @@ ZTMP6_DEVICE(:,:,1) = ( ZTMP1_DEVICE(:,:,1) - ZTMP4_DEVICE(:,:,1)*0.5*ZTMP2_DEVI
 CALL MXM_DEVICE(PK(:,:,IKB:IKB),ZTMP1_DEVICE(:,:,1:1))
 CALL MYM_DEVICE(ZTMP1_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
 !
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLX)
+#else
+!$acc kernels 
+#endif
 ZFLX(:,:,IKB) = - XCMFS * ZTMP2_DEVICE(:,:,1) * ( ZTMP5_DEVICE(:,:,1) + ZTMP6_DEVICE(:,:,1) )
 !$acc end kernels
 #endif
 ! 
 ! extrapolates this flux under the ground with the surface flux
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLX)
+#else
+!$acc kernels 
+#endif
 #ifndef MNH_BITREP
 ZFLX(:,:,IKB-1) =                                                           &
    PTAU11M(:,:) * PCOSSLOPE(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:)**2         &
@@ -479,7 +507,11 @@ ZFLX(:,:,IKB-1:IKB-1) = 2. * MXM( MYM( ZFLX(:,:,IKB-1:IKB-1) ) )  &
 #else
 CALL MYM_DEVICE(ZFLX(:,:,IKB-1:IKB-1),ZTMP1_DEVICE(:,:,1:1))
 CALL MXM_DEVICE(ZTMP1_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLX)
+#else
+!$acc kernels 
+#endif
 ZFLX(:,:,IKB-1) = 2. * ZTMP2_DEVICE(:,:,1) - ZFLX(:,:,IKB)
 !$acc end kernels
 #endif
@@ -728,7 +760,11 @@ IF (KSPLT==1) THEN
         ) / MXF(MYM( 0.5*(PDXX(:,:,IKB:IKB)+PDXX(:,:,IKB+1:IKB+1)) ) )&
     ) 
 #else
+#ifdef MNH_COMPILER_CCE
   !$acc kernels present(ZTMP1_DEVICE)
+#else
+  !$acc kernels 
+#endif
   ZTMP1_DEVICE(:,:,1) = 0.5 * (ZFLX(:,:,IKB+1)+ZFLX(:,:,IKB))
   !$acc end kernels
   CALL MYF_DEVICE(ZTMP1_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
@@ -750,27 +786,43 @@ IF (KSPLT==1) THEN
   ZTMP2_DEVICE(:,:,1) = 0.5*(PDXX(:,:,IKB)+PDXX(:,:,IKB+1))
 !$acc end kernels
   CALL MYM_DEVICE(ZTMP2_DEVICE(:,:,1:1),ZTMP6_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
   ZTMP2_DEVICE(:,:,1) = ZTMP3_DEVICE(:,:,1) / ZTMP4_DEVICE(:,:,1) + ZTMP5_DEVICE(:,:,1) / ZTMP6_DEVICE(:,:,1)
 !$acc end kernels
   CALL MYF_DEVICE(ZTMP2_DEVICE(:,:,1:1),ZTMP3_DEVICE(:,:,1:1))
   CALL MXF_DEVICE(ZTMP3_DEVICE(:,:,1:1),ZTMP2_DEVICE(:,:,1:1))
   !
   CALL MXM_DEVICE(PDZZ(:,:,IKB+1:IKB+1),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP5_DEVICE)
+#else
+!$acc kernels 
+#endif
   ZTMP5_DEVICE(:,:,1) = (PUM(:,:,IKB+1)-PUM(:,:,IKB)) / ZTMP3_DEVICE(:,:,1) * PDZY(:,:,IKB+1)
 !$acc end kernels
   CALL MXF_DEVICE(ZTMP5_DEVICE(:,:,1:1),ZTMP3_DEVICE(:,:,1:1))
   CALL MYF_DEVICE(ZTMP4_DEVICE(:,:,1:1),ZTMP5_DEVICE(:,:,1:1)) !Re-use of ZTMP4_DEVICE
   !
   CALL MYM_DEVICE(PDZZ(:,:,IKB+1:IKB+1),ZTMP4_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP7_DEVICE)
+#else
+!$acc kernels 
+#endif
   ZTMP7_DEVICE(:,:,1) = (PVM(:,:,IKB+1)-PVM(:,:,IKB)) / ZTMP4_DEVICE(:,:,1) * PDZX(:,:,IKB+1)
 !$acc end kernels
   CALL MYF_DEVICE(ZTMP7_DEVICE(:,:,1:1),ZTMP4_DEVICE(:,:,1:1))
   CALL MXF_DEVICE(ZTMP6_DEVICE(:,:,1:1),ZTMP7_DEVICE(:,:,1:1)) !Re-use of ZTMP6_DEVICE
   !  
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZWORK)
+#else
+!$acc kernels 
+#endif
   ZWORK(:,:,IKB) =  - ZTMP1_DEVICE(:,:,1) * (ZTMP2_DEVICE(:,:,1) &
                                              - ZTMP3_DEVICE(:,:,1) / ZTMP5_DEVICE(:,:,1) &
                                              - ZTMP4_DEVICE(:,:,1) / ZTMP7_DEVICE(:,:,1) ) 
diff --git a/src/MNH/turb_hor_uw.f90 b/src/MNH/turb_hor_uw.f90
index aaf35a767..99d9a52dc 100644
--- a/src/MNH/turb_hor_uw.f90
+++ b/src/MNH/turb_hor_uw.f90
@@ -476,7 +476,11 @@ IF (KSPLT==1) THEN
                 /(PDZZ(:,:,IKB+1)+PDZZ(:,:,IKB))
   !$acc end kernels
   CALL MXM_DEVICE( ZTMP3_DEVICE(:,:,1:1), ZTMP4_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
   !$acc kernels present(ZTMP3_DEVICE)
+#else
+  !$acc kernels 
+#endif
   ZTMP3_DEVICE(:,:,1) = ZFLX(:,:,IKB+1) *                  &
    (   (PUM(:,:,IKB+1)-PUM(:,:,IKB)) / ZTMP1_DEVICE(:,:,1) &
      + ( ZTMP2_DEVICE(:,:,1)                               &
@@ -486,7 +490,11 @@ IF (KSPLT==1) THEN
    )
   !$acc end kernels
   CALL MXF_DEVICE( ZTMP3_DEVICE(:,:,1:1), ZTMP1_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
   !$acc kernels present(ZWORK)
+#else
+  !$acc kernels 
+#endif
   ZWORK(:,:,IKB) = - ZTMP1_DEVICE(:,:,1) 
   !$acc end kernels
 #endif
diff --git a/src/MNH/turb_hor_vw.f90 b/src/MNH/turb_hor_vw.f90
index cd411e778..ed1d62a84 100644
--- a/src/MNH/turb_hor_vw.f90
+++ b/src/MNH/turb_hor_vw.f90
@@ -496,7 +496,11 @@ IF (KSPLT==1) THEN
 		    /(PDZZ(:,:,IKB+1)+PDZZ(:,:,IKB))
     !$acc end kernels
     CALL MYM_DEVICE( ZTMP3_DEVICE(:,:,1:1), ZTMP4_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
     !$acc kernels present(ZTMP3_DEVICE)
+#else
+    !$acc kernels 
+#endif
     ZTMP3_DEVICE(:,:,1) = ZFLX(:,:,IKB+1) *                    &
       (   (PVM(:,:,IKB+1)-PVM(:,:,IKB)) / ZTMP1_DEVICE(:,:,1)  &
 	+ ( ZTMP2_DEVICE(:,:,1)                                &
@@ -505,7 +509,11 @@ IF (KSPLT==1) THEN
       )
     !$acc end kernels
     CALL MYF_DEVICE( ZTMP3_DEVICE(:,:,1:1), ZTMP1_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
     !$acc kernels present(ZWORK)
+#else
+    !$acc kernels 
+#endif
     ZWORK(:,:,IKB) = - ZTMP1_DEVICE(:,:,1)
     !$acc end kernels
 #endif
diff --git a/src/MNH/turb_ver_dyn_flux.f90 b/src/MNH/turb_ver_dyn_flux.f90
index b75fcc15f..7392f8a85 100644
--- a/src/MNH/turb_ver_dyn_flux.f90
+++ b/src/MNH/turb_ver_dyn_flux.f90
@@ -577,7 +577,11 @@ CALL MXM_DEVICE( ZKEFF, ZTMP1_DEVICE )
 CALL MZM_DEVICE(PRHODJ, ZTMP2_DEVICE )
 CALL MXM_DEVICE(ZTMP2_DEVICE,ZTMP3_DEVICE)
 CALL MXM_DEVICE( PDZZ, ZTMP4_DEVICE )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA)
+#else
+!$acc kernels 
+#endif
 #ifndef MNH_BITREP
 ZA(:,:,:) = -PTSTEP * XCMFS * ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) / ZTMP4_DEVICE(:,:,:)**2
 #else
@@ -596,7 +600,11 @@ END DO
 !
 ! compute the coefficient between the vertical flux and the 2 components of the 
 ! wind following the slope
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZCOEFFLXU)
+#else
+!$acc kernels 
+#endif
 #ifndef MNH_BITREP
 ZCOEFFLXU(:,:,1) = PCDUEFF(:,:) * (PDIRCOSZW(:,:)**2 - ZDIRSINZW(:,:)**2) &
      * PCOSSLOPE(:,:)
@@ -662,7 +670,11 @@ ELSE             !ATMOS MODEL ONLY
       * 0.5 * ( 1. + MXM(PRHODJ(:,:,KKA:KKA)) / MXM(PRHODJ(:,:,IKB:IKB)) )
   ELSE               
     ! compute the explicit tangential flux at the W point
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZSOURCE,ZTMP1_DEVICE,ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
     ZSOURCE(:,:,IKB)     =                                              &
      PTAU11M(:,:) * PCOSSLOPE(:,:) * PDIRCOSZW(:,:) * ZDIRSINZW(:,:) &
      -PTAU12M(:,:) * PSINSLOPE(:,:) * ZDIRSINZW(:,:)                  &
@@ -690,7 +702,11 @@ ELSE             !ATMOS MODEL ONLY
     CALL MXM_DEVICE( ZTMP2_DEVICE(:,:,1:1), ZTMP4_DEVICE(:,:,1:1) )
     CALL MXM_DEVICE(PRHODJ(:,:,KKA:KKA),ZTMP1_DEVICE(:,:,KKA:KKA))
     CALL MXM_DEVICE(PRHODJ(:,:,IKB:IKB),ZTMP2_DEVICE(:,:,IKB:IKB))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZSOURCE)
+#else
+!$acc kernels 
+#endif
     ZSOURCE(:,:,IKB) = ( ZTMP3_DEVICE(:,:,1) + ZTMP4_DEVICE(:,:,1) - ZCOEFS(:,:,1) * PUM(:,:,IKB) * PIMPL  &
                           ) * 0.5 * ( 1. + ZTMP1_DEVICE(:,:,KKA) / ZTMP2_DEVICE(:,:,IKB) )
 !$acc end kernels
@@ -764,7 +780,11 @@ ZFLXZ(:,:,IKB:IKB)   =   MXM(PDZZ(:,:,IKB:IKB))  *                &
 CALL MXM_DEVICE(PDZZ(:,:,IKB:IKB),ZTMP1_DEVICE(:,:,IKB:IKB))
 CALL MXM_DEVICE(PRHODJ(:,:,KKA:KKA),ZTMP2_DEVICE(:,:,KKA:KKA))
 CALL MXM_DEVICE(PRHODJ(:,:,IKB:IKB),ZTMP3_DEVICE(:,:,IKB:IKB))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLXZ)
+#else
+!$acc kernels 
+#endif
 ZFLXZ(:,:,IKB:IKB)   =   ZTMP1_DEVICE(:,:,IKB:IKB)  *                &
   ( ZSOURCE(:,:,IKB:IKB)                                          &
    +ZCOEFS(:,:,1:1) * ZRES(:,:,IKB:IKB) * PIMPL                   &                
@@ -833,7 +853,11 @@ PDP(:,:,IKB:IKB) = - MXF (
                          )
 #else
 CALL MXM_DEVICE(PDZZ(:,:,IKB+KKL:IKB+KKL),ZTMP1_DEVICE(:,:,IKB+KKL:IKB+KKL))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP2_DEVICE(:,:,IKB:IKB) = ZFLXZ(:,:,IKB+KKL:IKB+KKL) * (PUM(:,:,IKB+KKL:IKB+KKL)-PUM(:,:,IKB:IKB))  &
                          / ZTMP1_DEVICE(:,:,IKB+KKL:IKB+KKL)
 !$acc end kernels
@@ -1017,13 +1041,21 @@ IF(HTURBDIM=='3DIM') THEN
               /(PDZZ(:,:,IKB+KKL)+PDZZ(:,:,IKB  )) 
 !$acc end kernels
   CALL MXM_DEVICE(ZTMP2_DEVICE(:,:,1:1),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
   ZTMP2_DEVICE(:,:,1) = ZFLXZ(:,:,IKB+KKL) *                          &
      ( ZTMP1_DEVICE(:,:,1) - ZTMP3_DEVICE(:,:,1) * PDZX(:,:,IKB+KKL) )   &
      / (0.5*(PDXX(:,:,IKB+KKL)+PDXX(:,:,IKB)))
 !$acc end kernels
   CALL MXF_DEVICE(ZTMP2_DEVICE(:,:,1:1),ZTMP4_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA)
+#else
+!$acc kernels 
+#endif
   ZA(:,:,IKB:IKB) = - ZTMP4_DEVICE(:,:,1:1)
 !$acc end kernels
 #endif
@@ -1134,7 +1166,11 @@ CALL MYM_DEVICE( ZKEFF, ZTMP1_DEVICE )
 CALL MYM_DEVICE( PDZZ, ZTMP2_DEVICE )
 CALL MZM_DEVICE(PRHODJ, ZTMP3_DEVICE )
 CALL MYM_DEVICE(ZTMP3_DEVICE,ZTMP4_DEVICE)
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA,ZCOEFFLXU)
+#else
+!$acc kernels 
+#endif
 #ifndef MNH_BITREP
 ZA(:,:,:)    = - PTSTEP * XCMFS * ZTMP1_DEVICE(:,:,:) * ZTMP4_DEVICE(:,:,:) / ZTMP2_DEVICE(:,:,:)**2
 #else
@@ -1203,7 +1239,11 @@ IF (GOCEAN) THEN ! Ocean case
 ELSE ! Atmos case
   IF (.NOT.LCOUPLES) THEN !  only atmosp without coupling
   ! compute the explicit tangential flux at the W point
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZSOURCE,ZTMP1_DEVICE)
+#else
+!$acc kernels 
+#endif
     ZSOURCE(:,:,IKB)       =                                                  &
       PTAU11M(:,:) * PSINSLOPE(:,:) * PDIRCOSZW(:,:) * ZDIRSINZW(:,:)         &
      +PTAU12M(:,:) * PCOSSLOPE(:,:) * ZDIRSINZW(:,:)                          &
@@ -1223,7 +1263,11 @@ ELSE ! Atmos case
     ZTMP1_DEVICE(:,:,1) = ZSOURCE(:,:,IKB)   / PDZZ(:,:,IKB)
 !$acc end kernels
     CALL MYM_DEVICE( ZTMP1_DEVICE(:,:,1:1), ZTMP2_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP1_DEVICE)
+#else
+!$acc kernels 
+#endif
     ZTMP1_DEVICE(:,:,1) = ZCOEFFLXU(:,:,1) / PDZZ(:,:,IKB) &
               *ZUSLOPEM(:,:,1)                          &
               +ZCOEFFLXV(:,:,1) / PDZZ(:,:,IKB)         &
@@ -1232,7 +1276,11 @@ ELSE ! Atmos case
     CALL MYM_DEVICE(ZTMP1_DEVICE(:,:,1:1),ZTMP3_DEVICE(:,:,1:1))
     CALL MYM_DEVICE(PRHODJ(:,:,KKA:KKA),ZTMP1_DEVICE(:,:,1:1))
     CALL MYM_DEVICE(PRHODJ(:,:,IKB:IKB),ZTMP4_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZSOURCE)
+#else
+!$acc kernels 
+#endif
     ZSOURCE(:,:,IKB) = ( ZTMP2_DEVICE(:,:,1) +  ZTMP3_DEVICE(:,:,1) - ZCOEFS(:,:,1) * PVM(:,:,IKB) * PIMPL ) &
       * 0.5 * ( 1. + ZTMP1_DEVICE(:,:,1) / ZTMP4_DEVICE(:,:,1) )
 !$acc end kernels
@@ -1309,7 +1357,11 @@ END DO
 CALL MYM_DEVICE(PDZZ(:,:,IKB:IKB),ZTMP1_DEVICE(:,:,1:1))
 CALL MYM_DEVICE(PRHODJ(:,:,KKA:KKA),ZTMP2_DEVICE(:,:,1:1))
 CALL MYM_DEVICE(PRHODJ(:,:,IKB:IKB),ZTMP3_DEVICE(:,:,1:1))
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZFLXZ)
+#else
+!$acc kernels 
+#endif
 ZFLXZ(:,:,IKB)   =   ZTMP1_DEVICE(:,:,1)  *                 &
   ( ZSOURCE(:,:,IKB)                                     &
    +ZCOEFS(:,:,1) * ZRES(:,:,IKB) * PIMPL                &      
@@ -1384,11 +1436,19 @@ ZFLXZ(:,:,IKB+KKL:IKB+KKL) * (PVM(:,:,IKB+KKL:IKB+KKL)-PVM(:,:,IKB:IKB))  &
                        )
 #else
 CALL MYM_DEVICE( PDZZ(:,:,IKB+KKL:IKB+KKL), ZTMP1_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
 ZTMP2_DEVICE(:,:,1) = ZFLXZ(:,:,IKB+KKL) * (PVM(:,:,IKB+KKL)-PVM(:,:,IKB)) / ZTMP1_DEVICE(:,:,1)
 !$acc end kernels
 CALL MYF_DEVICE( ZTMP2_DEVICE(:,:,1:1), ZTMP1_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA)
+#else
+!$acc kernels 
+#endif
 ZA(:,:,IKB)  = - ZTMP1_DEVICE(:,:,1)
 !$acc end kernels
 #endif
@@ -1567,13 +1627,21 @@ IF(HTURBDIM=='3DIM') THEN
                 /(PDZZ(:,:,IKB+KKL)+PDZZ(:,:,IKB  ))
 !$acc end kernels
     CALL MYM_DEVICE( ZTMP2_DEVICE(:,:,1:1), ZTMP3_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
     ZTMP2_DEVICE(:,:,1) = ZFLXZ(:,:,IKB+KKL) *                        &
        ( ZTMP1_DEVICE(:,:,1) - ZTMP3_DEVICE(:,:,1) * PDZY(:,:,IKB+KKL) ) &
        / (0.5*(PDYY(:,:,IKB+KKL)+PDYY(:,:,IKB)))
 !$acc end kernels
     CALL MYF_DEVICE( ZTMP2_DEVICE(:,:,1:1), ZTMP1_DEVICE(:,:,1:1) )
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA)
+#else
+!$acc kernels 
+#endif
     ZA(:,:,IKB:IKB) = - ZTMP1_DEVICE(:,:,1:1)
 !$acc end kernels
 #endif
diff --git a/src/MNH/turb_ver_thermo_corr.f90 b/src/MNH/turb_ver_thermo_corr.f90
index 8d61bacab..a97503d7c 100644
--- a/src/MNH/turb_ver_thermo_corr.f90
+++ b/src/MNH/turb_ver_thermo_corr.f90
@@ -728,7 +728,11 @@ END IF
   END DO
   !$acc end kernels
   CALL MZF_DEVICE( ZTMP3_DEVICE(:,:,:), ZTMP4_DEVICE(:,:,:) )
+#ifdef MNH_COMPILER_CCE
   !$acc kernels present(ZFLXZ)
+#else
+  !$acc kernels 
+#endif
 #ifdef MNH_COMPILER_NVHPC
   !$acc loop independent collapse(3)
 #endif
@@ -1409,7 +1413,11 @@ END IF
     END DO
     !$acc end kernels
     CALL MZF_DEVICE( ZTMP2_DEVICE(:,:,:), ZTMP3_DEVICE(:,:,:) )
+#ifdef MNH_COMPILER_CCE
     !$acc kernels present(ZFLXZ)
+#else
+    !$acc kernels 
+#endif
 #ifdef MNH_COMPILER_NVHPC
     !$acc loop independent collapse(3)
 #endif
diff --git a/src/MNH/turb_ver_thermo_flux.f90 b/src/MNH/turb_ver_thermo_flux.f90
index 0e02f50cd..0e403966d 100644
--- a/src/MNH/turb_ver_thermo_flux.f90
+++ b/src/MNH/turb_ver_thermo_flux.f90
@@ -1114,7 +1114,11 @@ END IF
 #else
 IF ( KRRL >= 1 ) THEN
   IF ( KRRI >= 1 ) THEN
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
     ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
     ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:)
 !$acc end kernels
@@ -1124,7 +1128,11 @@ IF ( KRRL >= 1 ) THEN
     PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE * PFRAC_ICE(:,:,:)
 !$acc end kernels
   ELSE
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZTMP2_DEVICE)
+#else
+!$acc kernels 
+#endif
     !dir$ concurrent 
     ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:) * PATHETA(:,:,:) * 2. * PSRCM(:,:,:)
     ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:) / PDZZ(:,:,:)
@@ -1562,7 +1570,11 @@ END DO
       ZA(JI,JJ,JK)   =  PBETA(JI,JJ,JK) * ZTMP3_DEVICE(JI,JJ,JK)
     END DO
 !$acc end kernels
+#ifdef MNH_COMPILER_CCE
 !$acc kernels present(ZA)
+#else
+!$acc kernels 
+#endif
 #endif
     ZA(:,:,IKB) =  PBETA(:,:,IKB) * PEMOIST(:,:,IKB) *   &
                    0.5 * ( ZFLXZ (:,:,IKB) + ZFLXZ (:,:,IKB+KKL) )
@@ -1610,7 +1622,11 @@ END DO
 #else
   IF ( KRRL >= 1 ) THEN
     IF ( KRRI >= 1 ) THEN
+#ifdef MNH_COMPILER_CCE
       !$acc kernels present(ZTMP2_DEVICE)
+#else
+      !$acc kernels 
+#endif
       !dir$ concurrent 
       ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
       ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:)
@@ -1621,7 +1637,11 @@ END DO
       PRRS(:,:,:,4) = PRRS(:,:,:,4) - ZTMP1_DEVICE(:,:,:) * ZTMP3_DEVICE(:,:,:) * PFRAC_ICE(:,:,:)
 !$acc end kernels
     ELSE
+#ifdef MNH_COMPILER_CCE
       !$acc kernels present(ZTMP2_DEVICE)
+#else
+      !$acc kernels 
+#endif
       !dir$ concurrent 
       ZTMP1_DEVICE(:,:,:) = PRHODJ(:,:,:)*PAMOIST(:,:,:)*2.*PSRCM(:,:,:)
       ZTMP2_DEVICE(:,:,:) = ZFLXZ(:,:,:)/PDZZ(:,:,:)
-- 
GitLab