Skip to content
Snippets Groups Projects
Commit 13646901 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 26/10/2018: IO: store MNH version in file structure metadata

parent fd80c847
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,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)
INTEGER :: NMODEL = 0 !Model number corresponding to the file (field not always set)
INTEGER,DIMENSION(3) :: NMNHVERSION = (/0,0,0/) !MesoNH version used to create the file
!
! 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)
......
......@@ -152,7 +152,7 @@ SELECT CASE(TPFILE%CTYPE)
!
CALL FMOPEN_ll(TPFILE,IRESP,OPARALLELIO=OPARALLELIO,HPROGRAM_ORIG=HPROGRAM_ORIG)
!
!Compare MNHVERSION of file with current version
!Compare MNHVERSION of file with current version and store it in file metadata
IF (TRIM(TPFILE%CMODE) == 'READ') THEN
IMNHVERSION(:) = 0
!Use TZFIELD because TFIELDLIST could be not initialised
......@@ -211,9 +211,13 @@ SELECT CASE(TPFILE%CTYPE)
CALL PRINT_MSG(NVERB_DEBUG,'IO','IO_FILE_OPEN_ll','file '//TRIM(TPFILE%CNAME)//&
' was written with the same version of MesoNH ('//TRIM(YMNHVERSION_CURR)//')')
END IF
!
TPFILE%NMNHVERSION(:) = IMNHVERSION(:)
END IF
END SELECT
!
IF (TRIM(TPFILE%CMODE) == 'WRITE') TPFILE%NMNHVERSION(:) = NMNHVERSION(:)
!
IF (PRESENT(KRESP)) KRESP = IRESP
!
END SUBROUTINE IO_FILE_OPEN_ll
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment