From 4e8401e96a3d48d77e71412970b758c101ff69cc Mon Sep 17 00:00:00 2001
From: Quentin Rodier <quentin.rodier@meteo.fr>
Date: Mon, 25 Oct 2021 17:47:16 +0200
Subject: [PATCH] Quentin 25/10/2021: bugfix RESTART reproductibility. In the
 case of no online chemistry (LORILAM=F) or LDUST/LSALT=T processes changing
 the aerosols (XAER) at each time-step, XAER is computed once at the START
 segment in ini_ecmwf_radiations based on current pressure and not updated
 during MESONH except if LAERO_FT=T and CAER='TEGE'. At RESTART, the aerosols
 climatology is updated but the pressure has changed. For reproductibility,
 one must use LAERO_FT=T and CAER='TEGE'. XAER_CLIM was not updated in the
 process done by CALL AEROZON in phys_param

---
 src/MNH/phys_paramn.f90 | 1 +
 src/MNH/read_exsegn.f90 | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/src/MNH/phys_paramn.f90 b/src/MNH/phys_paramn.f90
index 327f252f0..be5d47e97 100644
--- a/src/MNH/phys_paramn.f90
+++ b/src/MNH/phys_paramn.f90
@@ -680,6 +680,7 @@ IF (.NOT. OCLOUD_ONLY .AND. KTCOUNT /= 1)  THEN
          NDLON,NFLEV,CAER,NAER,NSTATM,                             &
          XSINDEL,XCOSDEL,XTSIDER,XCORSOL,                          &
          XSTATM,XOZON, XAER)
+  XAER_CLIM = XAER
  END IF
 END IF
 !
diff --git a/src/MNH/read_exsegn.f90 b/src/MNH/read_exsegn.f90
index a8c847c3f..9db15fc16 100644
--- a/src/MNH/read_exsegn.f90
+++ b/src/MNH/read_exsegn.f90
@@ -2149,6 +2149,13 @@ IF ( CRAD /= 'NONE' .AND. CPROGRAM=='MESONH' ) THEN
   IF(CCONF=='START') THEN
     CGETRAD='INIT'
   END IF
+  IF(CCONF=='RESTA' .AND. (.NOT. LAERO_FT) .AND.  (.NOT. LORILAM) &
+                    .AND. (.NOT. LSALT)  .AND. (.NOT. LDUST)) THEN
+    WRITE(UNIT=ILUOUT,FMT=9001) KMI
+    WRITE(UNIT=ILUOUT,FMT=*) '!!! WARNING !!! FOR REPRODUCTIBILITY BETWEEN START and START+RESTART,'
+    WRITE(UNIT=ILUOUT,FMT=*) 'YOU MUST USE LAERO_FT=T WITH CAER=TEGE IF CCONF=RESTA IN ALL SEGMENTS'
+    WRITE(UNIT=ILUOUT,FMT=*) 'TO UPDATE THE OZONE AND AEROSOLS CLIMATOLOGY USED BY THE RADIATION CODE;'
+  END IF
 END IF
 !
 !        3.6  check the initialization of the deep convection scheme
-- 
GitLab