From deace60b9790f2f3c3c5d10858ef814f77673256 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Thu, 8 Mar 2018 10:26:23 +0100
Subject: [PATCH] Philippe 08/03/2018: IO: add NLFININAR field to TFILEDATA
 (needed by LFI2CDF)

---
 src/LIB/SURCOUCHE/src/modd_io.f90 | 1 +
 src/LIB/SURCOUCHE/src/mode_fm.f90 | 4 ++--
 src/LIB/SURCOUCHE/src/mode_io.f90 | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/LIB/SURCOUCHE/src/modd_io.f90 b/src/LIB/SURCOUCHE/src/modd_io.f90
index e9f052e3d..fddb02428 100644
--- a/src/LIB/SURCOUCHE/src/modd_io.f90
+++ b/src/LIB/SURCOUCHE/src/modd_io.f90
@@ -86,6 +86,7 @@ TYPE TFILEDATA
   TYPE(TFILE_ELT),DIMENSION(:),ALLOCATABLE :: TFILES_IOZ !Corresponding Z-splitted files
   !
   ! Fields for LFI files
+  INTEGER(KIND=LFI_INT) :: NLFININAR = 0  !Number of articles of the LFI file (only accurate if file opened in read mode)
   INTEGER(KIND=LFI_INT) :: NLFINPRAR = 0  !Number of predicted articles of the LFI file (non crucial)
   INTEGER               :: NLFITYPE  = -1 !Type of the file (used to generate list of files to transfers)
   INTEGER               :: NLFIVERB  = 1  !LFI verbosity level
diff --git a/src/LIB/SURCOUCHE/src/mode_fm.f90 b/src/LIB/SURCOUCHE/src/mode_fm.f90
index 0a2e51729..d381a8328 100644
--- a/src/LIB/SURCOUCHE/src/mode_fm.f90
+++ b/src/LIB/SURCOUCHE/src/mode_fm.f90
@@ -252,7 +252,7 @@ INTEGER :: IERR
 !JUAN
 INTEGER(KIND=LFI_INT) :: IRESOU,INUMBR8
 INTEGER(KIND=LFI_INT) :: IMELEV,INPRAR
-INTEGER(KIND=LFI_INT) :: ININAR ! Number of articles present in LFI file (unused here)
+INTEGER(KIND=LFI_INT) :: ININAR ! Number of articles present in LFI file
 LOGICAL               :: GNAMFI8,GFATER8,GSTATS8
 INTEGER               :: INB_PROCIO
 !JUAN
@@ -370,7 +370,7 @@ IF (TPFILE%LMASTER) THEN
           IMELEV,            &
           INPRAR,            &
           ININAR)
-     
+     TPFILE%NLFININAR = ININAR
   IF (IRESOU /= 0 ) THEN
         IRESP = IRESOU
      ENDIF
diff --git a/src/LIB/SURCOUCHE/src/mode_io.f90 b/src/LIB/SURCOUCHE/src/mode_io.f90
index 6e1695126..e6a938507 100644
--- a/src/LIB/SURCOUCHE/src/mode_io.f90
+++ b/src/LIB/SURCOUCHE/src/mode_io.f90
@@ -708,7 +708,7 @@ CONTAINS
                         IMELEV,            &
                         INPRAR,            &
                         ININAR8)
-                   !KNINAR = ININAR8
+                   TZSPLITFILE%NLFININAR = ININAR8
                 END IF
              ENDIF
              !
-- 
GitLab