From 3bb137c5a45fc24c18483fb631d11ebf40b5eeb1 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Mon, 6 Dec 2021 17:00:45 +0100
Subject: [PATCH] Philippe 06/12/2021: OpenACC: correct status and update of
 PRTHLS

---
 src/MNH/turb.f90     | 6 ++++--
 src/ZSOLVER/turb.f90 | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/MNH/turb.f90 b/src/MNH/turb.f90
index 0d5254975..bd109f01b 100644
--- a/src/MNH/turb.f90
+++ b/src/MNH/turb.f90
@@ -496,7 +496,8 @@ INTEGER  :: JLU_ZRM, JLU_TURB, JJU_ORMC01, JKU_CLOUD, JKU_TURB
 ! INOUT variables
 !
 !$acc &    create ( PBL_DEPTH, PSBL_DEPTH, PTHLT, PRT,                                     &
-!$acc &             PRUS, PRVS, PRWS, PRTHLS, PRTKES, PRRS, PRSVS )                        &
+!$acc &             PRUS, PRVS, PRWS, PRTKES, PRRS, PRSVS )                                &
+!$acc &    present( PRTHLS )                                                               &
 !
 ! OUT variables
 !
@@ -1436,10 +1437,11 @@ IF ( KRRL >= 1 ) THEN
   END IF
 END IF
 
-!$acc update self(PRRS,PTHLT,PRTHLS)
 
 ! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets
 call Sources_neg_correct( hcloud, 'NETUR', krr, ptstep, ppabst, pthlt, prt, prthls, prrs, prsvs )
+!$acc update self( PTHLT ) !PTHLT not modified in Sources_neg_correct
+!$acc update self( PRTHLS, PRRS )
 
 !----------------------------------------------------------------------------
 !
diff --git a/src/ZSOLVER/turb.f90 b/src/ZSOLVER/turb.f90
index 25ed9117b..05252079c 100644
--- a/src/ZSOLVER/turb.f90
+++ b/src/ZSOLVER/turb.f90
@@ -496,7 +496,8 @@ INTEGER  :: JLU_ZRM, JLU_TURB, JJU_ORMC01, JKU_CLOUD, JKU_TURB
 ! INOUT variables
 !
 !$acc &    create ( PBL_DEPTH, PSBL_DEPTH, PTHLT, PRT,                                     &
-!$acc &             PRUS, PRVS, PRWS, PRTHLS, PRTKES, PRRS, PRSVS )                        &
+!$acc &             PRUS, PRVS, PRWS, PRTKES, PRRS, PRSVS )                                &
+!$acc &    present( PRTHLS )                                                               &
 !
 ! OUT variables
 !
@@ -1436,10 +1437,11 @@ IF ( KRRL >= 1 ) THEN
   END IF
 END IF
 
-!$acc update self(PRRS,PTHLT,PRTHLS)
 
 ! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets
 call Sources_neg_correct( hcloud, 'NETUR', krr, ptstep, ppabst, pthlt, prt, prthls, prrs, prsvs )
+!$acc update self( PTHLT ) !PTHLT not modified in Sources_neg_correct
+!$acc update self( PRTHLS, PRRS )
 
 !----------------------------------------------------------------------------
 !
-- 
GitLab