From 58edac29a68352a488f287084657252e22dfad8b Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Mon, 19 Mar 2018 15:00:07 +0100
Subject: [PATCH] Philippe 19/03/2018: IO: Z-split files: pass also the
 optional HFORMAT argument (necessary for LFI2CDF)

---
 src/LIB/SURCOUCHE/src/mode_io.f90               | 5 +++--
 src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 | 4 +---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_io.f90 b/src/LIB/SURCOUCHE/src/mode_io.f90
index 3b8866f32..050b305af 100644
--- a/src/LIB/SURCOUCHE/src/mode_io.f90
+++ b/src/LIB/SURCOUCHE/src/mode_io.f90
@@ -636,8 +636,9 @@ CONTAINS
              CALL IO_FILE_FIND_BYNAME(TRIM(TPFILE%CNAME)//TRIM(CFILE),TZSPLITFILE,IRESP)
 
              IF (IRESP/=0) THEN !File not yet in filelist => add it (nothing to do if already in list)
-               CALL IO_FILE_ADD2LIST(TZSPLITFILE,TRIM(TPFILE%CNAME)//TRIM(CFILE),TPFILE%CTYPE,TPFILE%CMODE, &
-                                     KLFINPRAR=TPFILE%NLFINPRAR,KLFITYPE=TPFILE%NLFITYPE,KLFIVERB=TPFILE%NLFIVERB)
+               CALL IO_FILE_ADD2LIST(TZSPLITFILE,TRIM(TPFILE%CNAME)//TRIM(CFILE),TPFILE%CTYPE,TPFILE%CMODE,        &
+                                     KLFINPRAR=TPFILE%NLFINPRAR,KLFITYPE=TPFILE%NLFITYPE,KLFIVERB=TPFILE%NLFIVERB, &
+                                     HFORMAT=TPFILE%CFORMAT)
              END IF
              TPFILE%TFILES_IOZ(IFILE)%TFILE => TZSPLITFILE
              !Done outside of the previous IF to prevent problems with .OUT files
diff --git a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
index b8ebef4a5..1d3991a46 100644
--- a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
+++ b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90
@@ -624,7 +624,7 @@ END IF
 CALL IO_FILE_FIND_BYNAME(HNAME,TPFILE,IRESP,OOLD=GOLD)
 IF (IRESP==0) THEN
   !File has been found
-  !Check if really same one (LFI vs netCDF for LFI2CDF program)
+  !Check if really same one (LFI vs netCDF)
   IF (PRESENT(HFORMAT)) THEN
     IF ( (HFORMAT=='LFI' .AND. TPFILE%CFORMAT/='NETCDF4') .OR. (HFORMAT=='NETCDF4' .AND. TPFILE%CFORMAT/='LFI') ) THEN
       CALL PRINT_MSG(NVERB_FATAL,'IO','IO_FILE_ADD2LIST','file '//TRIM(HNAME)//' already in filelist')
@@ -663,8 +663,6 @@ IF (PRESENT(HFORMAT)) THEN
   IF(CPROGRAM=='LFICDF') THEN
     IF (HFORMAT/='LFI' .AND. HFORMAT/='NETCDF4') &
       CALL PRINT_MSG(NVERB_ERROR,'IO','IO_FILE_ADD2LIST','invalid HFORMAT ('//TRIM(HFORMAT)//')')
-  ELSE
-    CALL PRINT_MSG(NVERB_WARNING,'IO','IO_FILE_ADD2LIST','optional argument HFORMAT not tested for CPROGRAM='//TRIM(CPROGRAM))
   END IF
 ELSE
   IF(CPROGRAM=='LFICDF') &
-- 
GitLab