From 831f56a26bd88fc6137147441d615c335c830e5b Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Tue, 10 Mar 2020 15:37:53 +0100
Subject: [PATCH] Philippe 10/03/2020: minor: check value of dummy variable in
 FIELDLIST_GOTO_MODEL

---
 src/LIB/SURCOUCHE/src/mode_field.f90 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_field.f90 b/src/LIB/SURCOUCHE/src/mode_field.f90
index c6eca9e5c..a106f785d 100644
--- a/src/LIB/SURCOUCHE/src/mode_field.f90
+++ b/src/LIB/SURCOUCHE/src/mode_field.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 2016-2019 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2016-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.
@@ -3886,6 +3886,9 @@ IF (.NOT.LFIELDLIST_ISINIT) THEN
   RETURN
 END IF
 !
+if (kfrom > nmodel_allocated .or. kto > nmodel_allocated ) &
+  call Print_msg( NVERB_FATAL, 'GEN', 'FIELDLIST_GOTO_MODEL', 'kfrom or kto > nmodel_allocated' )
+!
 ! Initialize some pointers
 !
 !PW: TODO: check if still necessary as XRHODREFZ and XTHVREFZ are now initialiazed in ini_modeln even for KMI/=1 (29/01/2019)
-- 
GitLab