From cb72b0f14d6f7b3ef4d4b6b8f0ade8a5a6ccafa9 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 1 Jun 2023 10:41:00 +0200
Subject: [PATCH] Philippe 01/06/2023: PHYEX: PWSV was not computed (most of
 the time) if there are flyers (PWSV is needed by flyers)

---
 src/PHYEX/turb/mode_turb_ver_sv_flux.f90 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/PHYEX/turb/mode_turb_ver_sv_flux.f90 b/src/PHYEX/turb/mode_turb_ver_sv_flux.f90
index 1817fbb86..27b189c1b 100644
--- a/src/PHYEX/turb/mode_turb_ver_sv_flux.f90
+++ b/src/PHYEX/turb/mode_turb_ver_sv_flux.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -204,6 +204,7 @@ SUBROUTINE TURB_VER_SV_FLUX(D,CST,CSTURB,TURBN,TLES,ONOMIXLG,       &
 !!  Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O
 !  Wim de Rooy    06/2019: with energycascade, 50MF nog longer necessary
 !  P. Wautelet 30/11/2022: compute PWSV only when needed
+!  P. Wautelet 01/06/2023: fix for PWSV
 !!--------------------------------------------------------------------------
 !
 !*      0. DECLARATIONS
@@ -396,7 +397,7 @@ DO JSV=1,KSV
                     PRHODJ(:,:)*(ZRES(:,:)-PSVM(:,:,JSV))/PTSTEP
   !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
 !
-  IF ( (TURBN%LTURB_FLX .AND. TPFILE%LOPENED) .OR. TLES%LLES_CALL ) THEN
+  IF ( (TURBN%LTURB_FLX .AND. TPFILE%LOPENED) .OR. TLES%LLES_CALL .OR. OFLYER ) THEN
     ! Diagnostic of the cartesian vertical flux
     !
     !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT)
@@ -444,7 +445,7 @@ DO JSV=1,KSV
       PWSV(:,IKE,JSV)=PWSV(:,IKE-IKL,JSV)
       !$mnh_end_expand_array(JIJ=IIJB:IIJE)
     END IF
- END IF
+  END IF
   !
   IF (TURBN%LTURB_FLX .AND. TPFILE%LOPENED) THEN
     ! stores the JSVth vertical flux
-- 
GitLab