From f7e2d0b18a8ac78c3476d815990b017edf36e867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Vi=C3=A9?= <benoit.vie@meteo.fr>
Date: Wed, 8 Sep 2021 14:54:35 +0200
Subject: [PATCH] LSNOW=F fix & minor correction

---
 src/MNH/lima_ice_deposition.f90  | 5 +++++
 src/MNH/lima_snow_deposition.f90 | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/MNH/lima_ice_deposition.f90 b/src/MNH/lima_ice_deposition.f90
index 8c7c57e40..752feb93b 100644
--- a/src/MNH/lima_ice_deposition.f90
+++ b/src/MNH/lima_ice_deposition.f90
@@ -65,6 +65,7 @@ SUBROUTINE LIMA_ICE_DEPOSITION (PTSTEP, LDCOMPUTE,                        &
 !!    MODIFICATIONS
 !!    -------------
 !!      Original             15/03/2018
+!!      B. Vié               30/08/2021      Disable CNVS if LSNOW=F  
 !!
 !-------------------------------------------------------------------------------
 !
@@ -171,5 +172,9 @@ P_CI_CNVS(:) = - ZZW2(:)
 !
 END WHERE
 !
+IF (.NOT.LSNOW) THEN
+   P_RI_CNVS(:) = 0.
+   P_CI_CNVS(:) = 0.
+END IF
 !
 END SUBROUTINE LIMA_ICE_DEPOSITION
diff --git a/src/MNH/lima_snow_deposition.f90 b/src/MNH/lima_snow_deposition.f90
index 697f9ee74..d39f714d8 100644
--- a/src/MNH/lima_snow_deposition.f90
+++ b/src/MNH/lima_snow_deposition.f90
@@ -149,7 +149,7 @@ WHERE( GMICRO )
 !
    ZZW(:) = 0.0
    WHERE ( (PRST(:)>XRTMIN(5)) )
-      ZZW(:) = ( PSSI(:)/(PAI(:)) ) * &
+      ZZW(:) = ( PSSI(:)/(PAI(:)*PRHODREF(:)) ) * &
            ( X0DEPS*PLBDS(:)**XEX0DEPS + X1DEPS*PCJ(:)*PLBDS(:)**XEX1DEPS )
       ZZW(:) =    ZZW(:)*(0.5+SIGN(0.5,ZZW(:))) - ABS(ZZW(:))*(0.5-SIGN(0.5,ZZW(:)))
    END WHERE
-- 
GitLab