From 87a912e1323b309fd5530983a59a90fa43006359 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Wed, 20 Jan 2021 10:10:25 +0100
Subject: [PATCH] Philippe 20/01/2021: bugfix: condition was wrong if
 HLES_AVG='H'. Budgets were not written.

(cherry picked from commit cb7345d0e6c373de6b9310858acc39266c4717d4)
---
 src/MNH/write_lesn.f90 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/MNH/write_lesn.f90 b/src/MNH/write_lesn.f90
index 9b8a50559..84e524e13 100644
--- a/src/MNH/write_lesn.f90
+++ b/src/MNH/write_lesn.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 2000-2020 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2000-2021 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.
@@ -59,6 +59,7 @@ END MODULE MODI_WRITE_LES_n
 !  C. Lac         02/2019: add rain fraction as a LES diagnostic
 !  P. Wautelet 13/10/2020: bugfix: correct some names for LES_DIACHRO_2PT diagnostics (Ri)
 !  P. Wautelet 26/10/2020: bugfix: correct some comments and conditions + add missing RES_RTPZ
+!  P. Wautelet 20/01/2021: bugfix: condition was wrong if HLES_AVG='H'. Budgets were not written.
 !! --------------------------------------------------------------------------
 !       
 !*      0. DECLARATIONS
@@ -121,8 +122,8 @@ IF (.NOT. LLES) RETURN
 IF (HLES_AVG=='A'                                                       &
      .AND. (XLES_TEMP_MEAN_START==XUNDEF .OR. XLES_TEMP_MEAN_END==XUNDEF)) RETURN
 IF (HLES_AVG=='E' .AND. CLES_NORM_TYPE=='NONE'                          ) RETURN
-IF (HLES_AVG=='H' .AND. (CLES_NORM_TYPE=='NONE'                          &
-     .OR. XLES_TEMP_MEAN_START/=XUNDEF .OR. XLES_TEMP_MEAN_END/=XUNDEF)) RETURN
+IF ( HLES_AVG == 'H' .AND. ( CLES_NORM_TYPE == 'NONE'                        &
+     .OR. XLES_TEMP_MEAN_START == XUNDEF .OR. XLES_TEMP_MEAN_END == XUNDEF ) ) RETURN
 !
 !*      1.   Initializations
 !            ---------------
-- 
GitLab