From c51fc8fd79bb6e2ce936dc6d8e6d01f21082508c Mon Sep 17 00:00:00 2001
From: Gaelle DELAUTIER <gaelle.delautier@meteo.fr>
Date: Fri, 18 May 2018 11:19:44 +0200
Subject: [PATCH] Gaelle 18/5/2018 : bug with khko

---
 src/MNH/shallow_mf.f90 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/MNH/shallow_mf.f90 b/src/MNH/shallow_mf.f90
index 52831c2d7..0cf0767da 100644
--- a/src/MNH/shallow_mf.f90
+++ b/src/MNH/shallow_mf.f90
@@ -312,9 +312,11 @@ ENDIF
 
 ! Thermodynamics functions
 ZFRAC_ICE(:,:) = 0.
-WHERE(PRM(:,:,2)+PRM(:,:,4) > 1.E-20)
-  ZFRAC_ICE(:,:) = PRM(:,:,4) / (PRM(:,:,2)+PRM(:,:,4))
-ENDWHERE
+IF (SIZE(PRM,3).GE.4) THEN
+  WHERE(PRM(:,:,2)+PRM(:,:,4) > 1.E-20)
+    ZFRAC_ICE(:,:) = PRM(:,:,4) / (PRM(:,:,2)+PRM(:,:,4))
+  ENDWHERE
+ENDIF
 CALL COMPUTE_FRAC_ICE(HFRAC_ICE,ZFRAC_ICE(:,:),PTHM(:,:)*PEXNM(:,:))
 
 ! Conservative variables at t-dt
-- 
GitLab