From 708c24b617185565d33ba6cf08e7e602b2fec798 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 4 Jun 2020 13:53:55 +0200
Subject: [PATCH] Philippe 03/06/2020: bugfix: lima_precip_scavenging: correct
 array starts for PSVT and PRSVS

---
 src/MNH/lima_precip_scavenging.f90 | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/MNH/lima_precip_scavenging.f90 b/src/MNH/lima_precip_scavenging.f90
index ec318f4c8..e4c895a3c 100644
--- a/src/MNH/lima_precip_scavenging.f90
+++ b/src/MNH/lima_precip_scavenging.f90
@@ -1,3 +1,8 @@
+!MNH_LIC Copyright 2013-2020 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.
+!-----------------------------------------------------------------
 !      ##################################
        MODULE MODI_LIMA_PRECIP_SCAVENGING
 !      ##################################
@@ -6,7 +11,9 @@ INTERFACE
    SUBROUTINE LIMA_PRECIP_SCAVENGING (HCLOUD, KLUOUT, KTCOUNT, PTSTEP,        &
                                       PRRT, PRHODREF, PRHODJ, PZZ,            & 
                                       PPABST, PTHT, PSVT, PRSVS, PINPAP )
-!
+
+use modd_nsv, only: nsv_lima_beg
+
 CHARACTER(LEN=4),       INTENT(IN)    :: HCLOUD   ! cloud paramerization
 INTEGER,                INTENT(IN)    :: KLUOUT   ! unit for output listing
 INTEGER,                INTENT(IN)    :: KTCOUNT  ! iteration count
@@ -20,8 +27,8 @@ REAL, DIMENSION(:,:,:), INTENT(IN)    :: PZZ      ! Altitude
 REAL, DIMENSION(:,:,:), INTENT(IN)    :: PPABST   ! Absolute pressure at t
 REAL, DIMENSION(:,:,:), INTENT(IN)    :: PTHT     ! Theta at time t 
 !
-REAL, DIMENSION(:,:,:,:), INTENT(IN)    :: PSVT   ! Particle Concentration [kg-1]
-REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS  ! Total Number Scavenging Rate
+REAL, DIMENSION(:,:,:,NSV_LIMA_BEG:), INTENT(IN)    :: PSVT   ! Particle Concentration [kg-1]
+REAL, DIMENSION(:,:,:,NSV_LIMA_BEG:), INTENT(INOUT) :: PRSVS  ! Total Number Scavenging Rate
 !
 REAL, DIMENSION(:,:),   INTENT(INOUT) :: PINPAP
 !
@@ -90,7 +97,8 @@ END MODULE MODI_LIMA_PRECIP_SCAVENGING
 !!    -------------
 !!      Original             ??/??/13 
 !!
-!!  Philippe Wautelet 28/05/2018: corrected truncated integer division (3/2 -> 1.5)
+!  P.Wautelet 28/05/2018: corrected truncated integer division (3/2 -> 1.5)
+!  P.Wautelet 03/06/2020: bugfix: correct array starts for PSVT and PRSVS
 !-------------------------------------------------------------------------------
 !
 !*                  0.DECLARATIONS          
@@ -134,8 +142,8 @@ REAL, DIMENSION(:,:,:), INTENT(IN)    :: PZZ      ! Altitude
 REAL, DIMENSION(:,:,:), INTENT(IN)    :: PPABST   ! Absolute pressure at t
 REAL, DIMENSION(:,:,:), INTENT(IN)    :: PTHT     ! Theta at time t 
 !
-REAL, DIMENSION(:,:,:,:), INTENT(IN)    :: PSVT   ! Particle Concentration [/m**3]
-REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS  ! Total Number Scavenging Rate
+REAL, DIMENSION(:,:,:,NSV_LIMA_BEG:), INTENT(IN)    :: PSVT   ! Particle Concentration [/m**3]
+REAL, DIMENSION(:,:,:,NSV_LIMA_BEG:), INTENT(INOUT) :: PRSVS  ! Total Number Scavenging Rate
 !
 REAL, DIMENSION(:,:),   INTENT(INOUT) :: PINPAP
 !
-- 
GitLab