From 542deee636cd98f97dd13c9b04692104c2ca3907 Mon Sep 17 00:00:00 2001
From: Gaelle Tanguy <gaelle.tanguy@meteo.fr>
Date: Tue, 26 Apr 2016 11:43:59 +0000
Subject: [PATCH] C.Lac 26/04/2016 : Modification of the free atm gradient when
 the top of the model is too low

---
 src/MNH/free_atm_profile.f90 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/MNH/free_atm_profile.f90 b/src/MNH/free_atm_profile.f90
index 498cd0cd5..e0bd002a1 100644
--- a/src/MNH/free_atm_profile.f90
+++ b/src/MNH/free_atm_profile.f90
@@ -86,6 +86,8 @@ END MODULE MODI_FREE_ATM_PROFILE
 !!    MODIFICATIONS
 !!    -------------
 !!      Original    26/08/97
+!!      C.Lac  04/2016  Modification of the free atm gradient when the top of
+!!                      the model is too low
 !-------------------------------------------------------------------------------
 !
 !*       0.    DECLARATIONS
@@ -232,10 +234,14 @@ DO JI=1,IIU
 !*       3.2  guess of free atm. gradient
 !             ---------------------------
 !
+  IF (IK350/=IK5000) THEN
       ZFREEGR=( PVAR_MX  (JI,JJ,IK5000) &
                -PVAR_MX  (JI,JJ,IK350 ))&
              /( PZMASS_MX(JI,JJ,IK5000) &
                -PZMASS_MX(JI,JJ,IK350 ))
+  ELSE
+      ZFREEGR=PCLIMGR
+  END IF
 !
 !-------------------------------------------------------------------------------
 !
-- 
GitLab