From 583dc735a89b62f85788c261f173c49f637952fa Mon Sep 17 00:00:00 2001
From: Quentin Rodier <quentin.rodier@meteo.fr>
Date: Mon, 20 Jun 2022 17:31:38 +0200
Subject: [PATCH] Quentin 20/06/2022: bugfix, expansion (typo, over-dimension
 and J=0)

---
 src/common/aux/gradient_u_phy.F90             | 2 +-
 src/common/aux/gradient_v_phy.F90             | 2 +-
 src/common/turb/mode_turb_ver_thermo_flux.F90 | 4 ++--
 src/common/turb/turb.F90                      | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/common/aux/gradient_u_phy.F90 b/src/common/aux/gradient_u_phy.F90
index 5db52ebda..17284c32d 100644
--- a/src/common/aux/gradient_u_phy.F90
+++ b/src/common/aux/gradient_u_phy.F90
@@ -84,7 +84,7 @@ INTEGER :: JI,JJ,JK
 CALL DZM_PHY(D,PA,PA_WORK)
 CALL MXM_PHY(D,PDZZ,PDZZ_WORK)
 !
-!$mnh__expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
+!$mnh_expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
 PGZ_U_UW(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT)= PA_WORK(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT) &
                                                / PDZZ_WORK(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT)
 !$mnh_end_expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
diff --git a/src/common/aux/gradient_v_phy.F90 b/src/common/aux/gradient_v_phy.F90
index b6cc6cabb..fc8a77c1b 100644
--- a/src/common/aux/gradient_v_phy.F90
+++ b/src/common/aux/gradient_v_phy.F90
@@ -84,7 +84,7 @@ INTEGER :: JI,JJ,JK
 CALL DZM_PHY(D,PA,PA_WORK)
 CALL MYM_PHY(D,PDZZ,PDZZ_WORK)
 !
-!$mnh__expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
+!$mnh_expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
 PGZ_V_VW(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT)= PA_WORK(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT) &
                                                / PDZZ_WORK(D%NIBC:D%NIEC,D%NJBC:D%NJEC,1:D%NKT)
 !$mnh_end_expand_array(JI=D%NIBC:D%NIEC,JJ=D%NJBC:D%NJEC,JK=1:D%NKT)
diff --git a/src/common/turb/mode_turb_ver_thermo_flux.F90 b/src/common/turb/mode_turb_ver_thermo_flux.F90
index c8d4304a8..e6cbcea89 100644
--- a/src/common/turb/mode_turb_ver_thermo_flux.F90
+++ b/src/common/turb/mode_turb_ver_thermo_flux.F90
@@ -774,11 +774,11 @@ ELSE
     !ZWORK1 = MZF( MZM(PETHETA,D%NKA, D%NKU, D%NKL) * ZFLXZ,D%NKA, D%NKU, D%NKL )
     !$mnh_expand_array(JI=IIB:IIE,JJ=IJB:IJE,JK=1:D%NKT)
     PTP(IIB:IIE,IJB:IJE,1:D%NKT)  =  PBETA(IIB:IIE,IJB:IJE,1:D%NKT) * ZWORK2(IIB:IIE,IJB:IJE,1:D%NKT)
-    !$mnh_end_expand_array(JI=0:D%NIT,JJ=1:D%NJT,JK=1:D%NKT)
+    !$mnh_end_expand_array(JI=IIB:IIE,JJ=IJB:IJE,JK=1:D%NKT)
     !$mnh_expand_array(JI=IIB:IIE,JJ=IJB:IJE)
     PTP(IIB:IIE,IJB:IJE,IKB)=  PBETA(IIB:IIE,IJB:IJE,IKB) * PETHETA(IIB:IIE,IJB:IJE,IKB) *   &
                    0.5 * ( ZFLXZ(IIB:IIE,IJB:IJE,IKB) + ZFLXZ(IIB:IIE,IJB:IJE,IKB+D%NKL) )
-    !$mnh_end_expand_array(JI=0:D%NIT,JJ=1:D%NJT)
+    !$mnh_end_expand_array(JI=IIB:IIE,JJ=IJB:IJE)
   ELSE
     CALL MZF_PHY(D,ZFLXZ,ZWORK1)
     !$mnh_expand_array(JI=IIB:IIE,JJ=IJB:IJE,JK=1:D%NKT)
diff --git a/src/common/turb/turb.F90 b/src/common/turb/turb.F90
index a7933fa96..fc9bb8b83 100644
--- a/src/common/turb/turb.F90
+++ b/src/common/turb/turb.F90
@@ -789,9 +789,9 @@ ENDIF
 !*      3.7 Correction in the Surface Boundary Layer (Redelsperger 2001)
 !           ----------------------------------------
 !
-!$mnh_expand_array(JI=1:D%NIT,JJ=1:D%NJT,JK=1:D%NKT)
+!$mnh_expand_array(JI=1:D%NIT,JJ=1:D%NJT)
 ZLMO(:,:)=XUNDEF
-!$mnh_end_expand_array(JI=1:D%NIT,JJ=1:D%NJT,JK=1:D%NKT)
+!$mnh_end_expand_array(JI=1:D%NIT,JJ=1:D%NJT)
 IF (ORMC01) THEN
   !$mnh_expand_array(JI=1:D%NIT,JJ=1:D%NJT)
   ZUSTAR(:,:)=(PSFU(:,:)**2+PSFV(:,:)**2)**(0.25)
-- 
GitLab