diff --git a/src/MNH/ini_lesn.f90 b/src/MNH/ini_lesn.f90
index 3edab69448681b01f6d1199c2d01a762d9be2323..b0c6b31325e20e2f9110f9eb6c54d55814d7be9b 100644
--- a/src/MNH/ini_lesn.f90
+++ b/src/MNH/ini_lesn.f90
@@ -1,6 +1,6 @@
-!MNH_LIC Copyright 1994-2018 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2000-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 version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
 !-----------------------------------------------------------------
 !     ####################
@@ -34,6 +34,7 @@
 !!                    10/2016 (C.Lac) Add droplet deposition
 !!  Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O
 !!                     02/2019 (C. Lac) Add rain fraction as a LES diagnostic
+!  P. Wautelet 12/08/2020: bugfix: use NUNDEF instead of XUNDEF for integer variables
 !! --------------------------------------------------------------------------
 !
 !*      0. DECLARATIONS
@@ -394,7 +395,7 @@ END IF
 !            --------------------
 !
 IF (ANY(NLES_LEVELS(:)/=NUNDEF)) THEN
-  NLES_K = COUNT (NLES_LEVELS(:)/=XUNDEF)
+  NLES_K = COUNT (NLES_LEVELS(:)/=NUNDEF)
   CLES_LEVEL_TYPE='K'
 ELSE
   IF (NLES_K==0) THEN
@@ -442,8 +443,8 @@ END IF
 !*      5.2  Case of model levels (highest priority)
 !            --------------------
 !
-IF (ANY(NSPECTRA_LEVELS(:)/=XUNDEF)) THEN
-  NSPECTRA_K = COUNT (NSPECTRA_LEVELS(:)/=XUNDEF)
+IF (ANY(NSPECTRA_LEVELS(:)/=NUNDEF)) THEN
+  NSPECTRA_K = COUNT (NSPECTRA_LEVELS(:)/=NUNDEF)
   CSPECTRA_LEVEL_TYPE='K'
 END IF
 !