diff --git a/src/LIB/SURCOUCHE/src/modd_io.f90 b/src/LIB/SURCOUCHE/src/modd_io.f90 index a3bfbd886c473c907cf6d7d2a751f8f8752c3460..b7b9966ada53e1785dd9fe81666d56ee2401e601 100644 --- a/src/LIB/SURCOUCHE/src/modd_io.f90 +++ b/src/LIB/SURCOUCHE/src/modd_io.f90 @@ -85,6 +85,8 @@ TYPE TFILEDATA !the 2 sub-files are abcd.Z001 and abcd.Z002 TYPE(TFILE_ELT),DIMENSION(:),ALLOCATABLE :: TFILES_IOZ !Corresponding Z-splitted files ! + INTEGER :: NMODEL = 0 !Model number corresponding to the file (field not always set) + ! ! 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) diff --git a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 index 1d3991a46b5b0f6d9840464b745880f69c550842..c6ecbd17eed7ab2f6385ada7522f3d26cc3c06d0 100644 --- a/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 +++ b/src/LIB/SURCOUCHE/src/mode_io_manage_struct.f90 @@ -573,8 +573,9 @@ END SUBROUTINE POPULATE_STRUCT ! END SUBROUTINE IO_PREPARE_BAKOUT_STRUCT ! -SUBROUTINE IO_FILE_ADD2LIST(TPFILE,HNAME,HTYPE,HMODE, & - HFORM,HACCESS,HFORMAT,KLFINPRAR,KLFITYPE,KLFIVERB,KRECL,TPDADFILE,TPDATAFILE,OOLD) +SUBROUTINE IO_FILE_ADD2LIST(TPFILE,HNAME,HTYPE,HMODE, & + HFORM,HACCESS,HFORMAT,KLFINPRAR,KLFITYPE,KLFIVERB,KRECL, & + KMODEL,TPDADFILE,TPDATAFILE,OOLD) ! USE MODD_BAKOUT, ONLY: LOUT_COMPRESS,LOUT_REDUCE_FLOAT_PRECISION,NOUT_COMPRESS_LEVEL USE MODD_CONF, ONLY: CPROGRAM @@ -592,6 +593,7 @@ INTEGER(KIND=LFI_INT), OPTIONAL,INTENT(IN) :: KLFINPRAR !Number of predicted INTEGER, OPTIONAL,INTENT(IN) :: KLFITYPE !Type of the file (used to generate list of files to transfers) INTEGER, OPTIONAL,INTENT(IN) :: KLFIVERB !LFI verbosity level INTEGER, OPTIONAL,INTENT(IN) :: KRECL !Record length +INTEGER, OPTIONAL,INTENT(IN) :: KMODEL !Model number TYPE(TFILEDATA),POINTER,OPTIONAL,INTENT(IN) :: TPDADFILE !Corresponding dad file TYPE(TFILEDATA),POINTER,OPTIONAL,INTENT(IN) :: TPDATAFILE!Corresponding data file (used only for DES files) LOGICAL, OPTIONAL,INTENT(IN) :: OOLD !FALSE if new file (should not be found) @@ -836,6 +838,8 @@ SELECT CASE(TPFILE%CTYPE) END IF END SELECT ! +IF(PRESENT(KMODEL)) TPFILE%NMODEL = KMODEL +! TPFILE%LOPENED = .FALSE. TPFILE%NOPEN = 0 TPFILE%NCLOSE = 0 diff --git a/src/MNH/open_nestpgd_files.f90 b/src/MNH/open_nestpgd_files.f90 index e8d5a26a920fbc7f009bda72fbff5c853156b52a..743e498a2ecc5297fe6db08a7c99e4cb64df2fdb 100644 --- a/src/MNH/open_nestpgd_files.f90 +++ b/src/MNH/open_nestpgd_files.f90 @@ -310,11 +310,11 @@ DO JPGD=1,NMODEL IF (NDAD(JPGD)>=1) THEN TZDADFILE => TPFILENESTPGD(NDAD(JPGD))%TZFILE CALL IO_FILE_ADD2LIST(TPFILENESTPGD(JPGD)%TZFILE,TRIM(YPGD(JPGD))//'.nest'//ADJUSTL(YNEST),'PREPNESTPGD', & - 'WRITE',KLFITYPE=1,KLFIVERB=NVERB,TPDADFILE=TZDADFILE) + 'WRITE',KLFITYPE=1,KLFIVERB=NVERB,KMODEL=JPGD,TPDADFILE=TZDADFILE) ELSE NULLIFY(TZDADFILE) CALL IO_FILE_ADD2LIST(TPFILENESTPGD(JPGD)%TZFILE,TRIM(YPGD(JPGD))//'.nest'//ADJUSTL(YNEST),'PREPNESTPGD', & - 'WRITE',KLFITYPE=1,KLFIVERB=NVERB) + 'WRITE',KLFITYPE=1,KLFIVERB=NVERB,KMODEL=JPGD) END IF END DO !