diff --git a/src/globals/globals_vars.f90 b/src/globals/globals_vars.f90 index 994a9d480..d88e8fd49 100644 --- a/src/globals/globals_vars.f90 +++ b/src/globals/globals_vars.f90 @@ -22,13 +22,16 @@ MODULE MOD_Globals_Vars ! GLOBAL VARIABLES !----------------------------------------------------------------------------------------------------------------------------------- CHARACTER(LEN=6),PARAMETER :: ProgramName = 'PICLas' !> name of this program -INTEGER,PARAMETER :: MajorVersion = 2 !> FileVersion number saved in each hdf5 file with hdf5 header -INTEGER,PARAMETER :: MinorVersion = 9 !> FileVersion number saved in each hdf5 file with hdf5 header +INTEGER,PARAMETER :: MajorVersion = 3 !> FileVersion number saved in each hdf5 file with hdf5 header +INTEGER,PARAMETER :: MinorVersion = 0 !> FileVersion number saved in each hdf5 file with hdf5 header INTEGER,PARAMETER :: PatchVersion = 0 !> FileVersion number saved in each hdf5 file with hdf5 header -REAL,PARAMETER :: FileVersion = REAL(MajorVersion,8)+REAL(MinorVersion,8)/10.+REAL(PatchVersion,8)/100. !> FileVersion - !> number saved in each hdf5 file with hdf5 header +REAL,PARAMETER :: FileVersionReal = REAL(MajorVersion,8)+REAL(MinorVersion,8)/10.+REAL(PatchVersion,8)/100. + !> OLD number saved in each hdf5 file with hdf5 header +INTEGER,PARAMETER :: FileVersionInt = PatchVersion+MinorVersion*100+MajorVersion*10000 + !> NEWnumber saved in each hdf5 file with hdf5 header CHARACTER(LEN=10) :: PiclasVersionStr !> PiclasVersionStrnumber saved in each hdf5 file with hdf5 header -REAL :: FileVersionHDF5 !> FileVersion number read from hdf5 restart file +REAL :: FileVersionHDF5Real !> OLD FileVersion number read from hdf5 restart file +REAL :: FileVersionHDF5Int !> NEW FileVersion number read from hdf5 restart file REAL :: WallTime !> Wall time needed by a simulation (is not reset by !> performing a load balance step, only by user restart) REAL :: InitializationWallTime !> Wall time needed to initialize a simulation (or diff --git a/src/io_hdf5/hdf5_input.f90 b/src/io_hdf5/hdf5_input.f90 index 60b207006..a696081a9 100644 --- a/src/io_hdf5/hdf5_input.f90 +++ b/src/io_hdf5/hdf5_input.f90 @@ -78,7 +78,7 @@ MODULE MOD_HDF5_Input CONTAINS -FUNCTION ISVALIDHDF5FILE(FileName,FileVersionOpt) +FUNCTION ISVALIDHDF5FILE(FileName,FileVersionRealOpt,FileVersionIntOpt) !=================================================================================================================================== ! Subroutine to check if a file is a valid PICLas HDF5 file !=================================================================================================================================== @@ -89,30 +89,31 @@ FUNCTION ISVALIDHDF5FILE(FileName,FileVersionOpt) !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CHARACTER(LEN=*),INTENT(IN) :: FileName -REAL,INTENT(IN),OPTIONAL :: FileVersionOpt +REAL,INTENT(IN),OPTIONAL :: FileVersionRealOpt +INTEGER,INTENT(IN),OPTIONAL :: FileVersionIntOpt !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES LOGICAL :: isValidHDF5File !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES -REAL :: FileVersion,FileVersionRef +REAL :: FileVersionReal,FileVersionRealRef +INTEGER :: FileVersionInt,FileVersionIntRef INTEGER(HID_T) :: Plist_ID CHARACTER(LEN=255) :: ProgramName LOGICAL :: help !=================================================================================================================================== isValidHDF5File=.TRUE. iError=0 -FileVersionRef=1.0 -IF(PRESENT(FileVersionOpt)) FileVersionRef=FileVersionOpt +FileVersionRealRef=-1.0 +IF(PRESENT(FileVersionRealOpt)) FileVersionRealRef=FileVersionRealOpt +FileVersionIntRef=-1 +IF(PRESENT(FileVersionRealOpt)) FileVersionIntRef=FileVersionIntOpt ! Disable error messages CALL H5ESET_AUTO_F(0, iError) ! Initialize FORTRAN predefined datatypes CALL H5OPEN_F(iError) -IF(iError.NE.0)& - CALL Abort(& - __STAMP__& - ,'ERROR: COULD NOT OPEN FILE!') +IF(iError.NE.0) CALL Abort(__STAMP__,'ERROR: COULD NOT OPEN FILE!') ! Open HDF5 file CALL H5FOPEN_F(TRIM(FileName), H5F_ACC_RDONLY_F, File_ID, iError,access_prp = Plist_ID) @@ -130,11 +131,20 @@ FUNCTION ISVALIDHDF5FILE(FileName,FileVersionOpt) ! Check file version ------------------------------------------------------------------------------------------------------------- ! Open the attribute "File_Version" of root group - CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersion) - !IF(FileVersion .LT. FileVersionRef)THEN - ! isValidHDF5File=.FALSE. - ! SWRITE(UNIT_stdOut,'(A)')' ERROR: FILE VERSION TOO OLD! FileName: '//TRIM(FileName) - !END IF + IF(FileVersionRealRef.GT.0.0)THEN + CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionReal) + !IF(FileVersionReal .LT. FileVersionRealRef)THEN + ! isValidHDF5File=.FALSE. + ! SWRITE(UNIT_stdOut,'(A)')' ERROR: FILE VERSION TOO OLD! FileName: '//TRIM(FileName) + !END IF + END IF ! FileVersionRealRef.GT.0.0 + IF(FileVersionIntRef.GT.0)THEN + CALL ReadAttribute(File_ID,'Piclas_VersionInt',1,IntScalar=FileVersionInt) + !IF(FileVersionReal .LT. FileVersionIntRef)THEN + ! isValidHDF5File=.FALSE. + ! SWRITE(UNIT_stdOut,'(A)')' ERROR: FILE VERSION TOO OLD! FileName: '//TRIM(FileName) + !END IF + END IF ! FileVersionIntRef.GT.0.0 ! Close the file. CALL H5FCLOSE_F(File_ID, iError) ! Close FORTRAN predefined datatypes diff --git a/src/io_hdf5/hdf5_output.f90 b/src/io_hdf5/hdf5_output.f90 index 1391a84af..892c2e03f 100644 --- a/src/io_hdf5/hdf5_output.f90 +++ b/src/io_hdf5/hdf5_output.f90 @@ -432,7 +432,7 @@ SUBROUTINE WriteHDF5Header(FileType_in,File_ID) ! Subroutine to write a distinct file header to each HDF5 file !=================================================================================================================================== ! MODULES -USE MOD_Globals_Vars ,ONLY: ProgramName,FileVersion,ProjectName,PiclasVersionStr +USE MOD_Globals_Vars ,ONLY: ProgramName,FileVersionReal,FileVersionInt,ProjectName,PiclasVersionStr USE MOD_Globals_Vars ,ONLY: MajorVersion,MinorVersion,PatchVersion ! IMPLICIT VARIABLE HANDLING IMPLICIT NONE @@ -459,10 +459,11 @@ SUBROUTINE WriteHDF5Header(FileType_in,File_ID) CALL WriteAttributeToHDF5(File_ID,'File_Type' ,1,StrScalar=(/tmp255/)) tmp255=TRIM(ProjectName) CALL WriteAttributeToHDF5(File_ID,'Project_Name',1,StrScalar=(/tmp255/)) -CALL WriteAttributeToHDF5(File_ID,'File_Version',1,RealScalar=FileVersion) +CALL WriteAttributeToHDF5(File_ID,'File_Version',1,RealScalar=FileVersionReal) WRITE(UNIT=PiclasVersionStr,FMT='(I0,A1,I0,A1,I0)') MajorVersion,".",MinorVersion,".",PatchVersion tmp255=TRIM(PiclasVersionStr) CALL WriteAttributeToHDF5(File_ID,'Piclas_Version',1,StrScalar=(/tmp255/)) +CALL WriteAttributeToHDF5(File_ID,'Piclas_VersionInt',1,IntegerScalar=FileVersionInt) END SUBROUTINE WriteHDF5Header diff --git a/src/loadbalance/loaddistribution.f90 b/src/loadbalance/loaddistribution.f90 index 82569bf63..836a87760 100644 --- a/src/loadbalance/loaddistribution.f90 +++ b/src/loadbalance/loaddistribution.f90 @@ -191,7 +191,8 @@ SUBROUTINE ApplyWeightDistributionMethod(ElemTimeExists) LOGICAL :: PartIntExists REAL :: timeWeight(1:nGlobalElems) LOGICAL :: FileVersionExists -REAL :: FileVersionHDF5 +REAL :: FileVersionHDF5Real +INTEGER :: FileVersionHDF5Int INTEGER(KIND=IK),ALLOCATABLE :: PartIntGlob(:,:) INTEGER :: ElemPerProc(0:nProcessors-1) #endif /*PARTICLES*/ @@ -227,25 +228,31 @@ SUBROUTINE ApplyWeightDistributionMethod(ElemTimeExists) !check file version CALL DatasetExists(File_ID,'File_Version',FileVersionExists,attrib=.TRUE.) IF(FileVersionExists)THEN - CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5) + CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5Real) + + ! Depending on the file version, PartInt may have switched dimensions + IF(FileVersionHDF5Real.LT.2.8)THEN + ALLOCATE(PartIntTmp(1:nGlobalElems,PartIntSize)) + ! Check integer KIND=8 possibility + CALL ReadArray('PartInt',2,(/INT(nGlobalElems,IK),INT(PartIntSize,IK)/),0_IK,1,IntegerArray=PartIntTmp) + ! Switch dimensions + DO iElem = 1, nGlobalElems + PartIntGlob(:,iElem) = PartIntTmp(iElem,:) + END DO ! iElem = FirstElemInd, LastElemInd + DEALLOCATE(PartIntTmp) + ELSE + ! Check integer KIND=8 possibility + CALL ReadArray('PartInt',2,(/INT(PartIntSize,IK),INT(nGlobalElems,IK)/),0_IK,2,IntegerArray=PartIntGlob) + END IF ! FileVersionHDF5Real.LT.2.7 ELSE - CALL abort(__STAMP__,'Error in ApplyWeightDistributionMethod(): Attribute "File_Version" does not exist!') + CALL DatasetExists(File_ID,'Piclas_VersionInt',FileVersionExists,attrib=.TRUE.) + IF (FileVersionExists) THEN + CALL ReadAttribute(File_ID,'Piclas_VersionInt',1,IntScalar=FileVersionHDF5Int) + ELSE + CALL abort(__STAMP__,'Error in ApplyWeightDistributionMethod(): Attribute "Piclas_VersionInt" does not exist!') + END IF ENDIF - ! Depending on the file version, PartInt may have switched dimensions - IF(FileVersionHDF5.LT.2.8)THEN - ALLOCATE(PartIntTmp(1:nGlobalElems,PartIntSize)) - ! Check integer KIND=8 possibility - CALL ReadArray('PartInt',2,(/INT(nGlobalElems,IK),INT(PartIntSize,IK)/),0_IK,1,IntegerArray=PartIntTmp) - ! Switch dimensions - DO iElem = 1, nGlobalElems - PartIntGlob(:,iElem) = PartIntTmp(iElem,:) - END DO ! iElem = FirstElemInd, LastElemInd - DEALLOCATE(PartIntTmp) - ELSE - ! Check integer KIND=8 possibility - CALL ReadArray('PartInt',2,(/INT(PartIntSize,IK),INT(nGlobalElems,IK)/),0_IK,2,IntegerArray=PartIntGlob) - END IF ! FileVersionHDF5.LT.2.7 END IF CALL CloseDataFile() diff --git a/src/particles/restart/particle_readin.f90 b/src/particles/restart/particle_readin.f90 index d94c38ba6..8c5518644 100644 --- a/src/particles/restart/particle_readin.f90 +++ b/src/particles/restart/particle_readin.f90 @@ -101,7 +101,8 @@ SUBROUTINE ParticleReadin() LOGICAL :: VibQuantDataExists,changedVars,DGSourceExists LOGICAL :: ElecDistriDataExists,AD_DataExists,implemented LOGICAL :: FileVersionExists -REAL :: FileVersionHDF5 +REAL :: FileVersionHDF5Real +INTEGER :: FileVersionHDF5Int INTEGER :: PartDataSize_HDF5 ! number of entries in each line of PartData REAL,ALLOCATABLE :: PartSource_HDF5(:,:,:,:,:) ! Temporary arrays @@ -549,29 +550,35 @@ SUBROUTINE ParticleReadin() ! Check file version CALL DatasetExists(File_ID,'File_Version',FileVersionExists,attrib=.TRUE.) IF(FileVersionExists)THEN - CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5) + CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5Real) + + ! Associate construct for integer KIND=8 possibility + ASSOCIATE (& + PP_nElems => INT(PP_nElems,IK) ,& + PartIntSize => INT(PartIntSize,IK) ,& + offsetElem => INT(offsetElem,IK) ) + ! Depending on the file version, PartInt may have switched dimensions + IF(FileVersionHDF5Real.LT.2.8)THEN + ALLOCATE(PartIntTmp(FirstElemInd:LastElemInd,PartIntSize)) + CALL ReadArray('PartInt',2,(/PP_nElems,PartIntSize/),offsetElem,1,IntegerArray=PartIntTmp) + ! Switch dimensions + DO iElem = FirstElemInd, LastElemInd + PartInt(:,iElem) = PartIntTmp(iElem,:) + END DO ! iElem = FirstElemInd, LastElemInd + DEALLOCATE(PartIntTmp) + ELSE + CALL ReadArray('PartInt',2,(/PartIntSize,PP_nElems/),offsetElem,2,IntegerArray=PartInt) + END IF ! FileVersionHDF5Real.LT.2.7 + END ASSOCIATE ELSE - CALL abort(__STAMP__,'Error in ParticleRestart(): Attribute "File_Version" does not exist!') + CALL DatasetExists(File_ID,'Piclas_VersionInt',FileVersionExists,attrib=.TRUE.) + IF (FileVersionExists) THEN + CALL ReadAttribute(File_ID,'Piclas_VersionInt',1,IntScalar=FileVersionHDF5Int) + ELSE + CALL abort(__STAMP__,'Error in ParticleRestart(): Attribute "Piclas_VersionInt" does not exist!') + END IF ENDIF - ! Associate construct for integer KIND=8 possibility - ASSOCIATE (& - PP_nElems => INT(PP_nElems,IK) ,& - PartIntSize => INT(PartIntSize,IK) ,& - offsetElem => INT(offsetElem,IK) ) - ! Depending on the file version, PartInt may have switched dimensions - IF(FileVersionHDF5.LT.2.8)THEN - ALLOCATE(PartIntTmp(FirstElemInd:LastElemInd,PartIntSize)) - CALL ReadArray('PartInt',2,(/PP_nElems,PartIntSize/),offsetElem,1,IntegerArray=PartIntTmp) - ! Switch dimensions - DO iElem = FirstElemInd, LastElemInd - PartInt(:,iElem) = PartIntTmp(iElem,:) - END DO ! iElem = FirstElemInd, LastElemInd - DEALLOCATE(PartIntTmp) - ELSE - CALL ReadArray('PartInt',2,(/PartIntSize,PP_nElems/),offsetElem,2,IntegerArray=PartInt) - END IF ! FileVersionHDF5.LT.2.7 - END ASSOCIATE ! ------------------------------------------------ ! PartData diff --git a/src/posti/piclas2vtk/piclas2vtk.f90 b/src/posti/piclas2vtk/piclas2vtk.f90 index 08077afa7..364387740 100644 --- a/src/posti/piclas2vtk/piclas2vtk.f90 +++ b/src/posti/piclas2vtk/piclas2vtk.f90 @@ -868,7 +868,8 @@ SUBROUTINE ConvertPartData(InputStateFile) CHARACTER(LEN=255),ALLOCATABLE :: VarNamesParticle(:), tmpArray(:) CHARACTER(LEN=255) :: FileString REAL, ALLOCATABLE :: PartData(:,:) -REAL :: OutputTime, FileVersionHDF5 +REAL :: OutputTime, FileVersionHDFReal +INTEGER :: FileVersionHDF5Int LOGICAL :: FileVersionExists !=================================================================================================================================== @@ -879,34 +880,40 @@ SUBROUTINE ConvertPartData(InputStateFile) ! check file version CALL DatasetExists(File_ID,'File_Version',FileVersionExists,attrib=.TRUE.) IF (FileVersionExists) THEN - CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5) + CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDFReal) + + IF(FileVersionHDFReal.LT.1.5)THEN + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' Restart file is too old! "File_Version" in restart file < 1.5!' + SWRITE(UNIT_StdOut,'(A)')' The format used in the restart file is not compatible with this version of PICLas.' + SWRITE(UNIT_StdOut,'(A)')' Among others, the particle format (PartData) has changed.' + SWRITE(UNIT_StdOut,'(A)')' Run python script ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py --help' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' for info regarding the usage and run the script against the restart file, e.g., ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py ProjectName_State_000.0000xxxxxx.h5' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' to update the format and file version number.' + SWRITE(UNIT_StdOut,'(A)')' Note that the format can be changed back to the old one by running the script a second time.' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' + CALL abort(& + __STAMP__& + ,'Error in InitRestart(): "File_Version" in restart file < 1.5. See error message above to fix. File version in restart file =',& + RealInfoOpt=FileVersionHDFReal) + END IF ! FileVersionHDFReal.LT.1.5 ELSE - CALL abort(__STAMP__,'Error in InitRestart(): Attribute "File_Version" does not exist!') + CALL DatasetExists(File_ID,'Piclas_VersionInt',FileVersionExists,attrib=.TRUE.) + IF (FileVersionExists) THEN + CALL ReadAttribute(File_ID,'Piclas_VersionInt',1,IntScalar=FileVersionHDF5Int) + ELSE + CALL abort(__STAMP__,'Error in InitRestart(): Attribute "Piclas_VersionInt" does not exist!') + END IF END IF -IF(FileVersionHDF5.LT.1.5)THEN - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' Restart file is too old! "File_Version" in restart file < 1.5!' - SWRITE(UNIT_StdOut,'(A)')' The format used in the restart file is not compatible with this version of PICLas.' - SWRITE(UNIT_StdOut,'(A)')' Among others, the particle format (PartData) has changed.' - SWRITE(UNIT_StdOut,'(A)')' Run python script ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py --help' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' for info regarding the usage and run the script against the restart file, e.g., ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py ProjectName_State_000.0000xxxxxx.h5' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' to update the format and file version number.' - SWRITE(UNIT_StdOut,'(A)')' Note that the format can be changed back to the old one by running the script a second time.' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' - CALL abort(& - __STAMP__& - ,'Error in InitRestart(): "File_Version" in restart file < 1.5. See error message above to fix. File version in restart file =',& - RealInfoOpt=FileVersionHDF5) -END IF ! FileVersionHDF5.LT.1.5 ! Read-in of dimensions of the particle array (1: Number of particles, 2: Number of variables) CALL GetDataSize(File_ID,'PartData',nDims,HSize) diff --git a/src/restart/restart.f90 b/src/restart/restart.f90 index ee52ed4b4..bcaafc9c7 100644 --- a/src/restart/restart.f90 +++ b/src/restart/restart.f90 @@ -89,7 +89,7 @@ SUBROUTINE InitRestart() !=================================================================================================================================== ! MODULES USE MOD_Globals -USE MOD_Globals_Vars ,ONLY: FileVersionHDF5 +USE MOD_Globals_Vars ,ONLY: FileVersionHDF5Real USE MOD_PreProc USE MOD_ReadInTools ,ONLY: GETLOGICAL,GETSTR #if USE_LOADBALANCE @@ -122,6 +122,7 @@ SUBROUTINE InitRestart() LOGICAL :: DG_SolutionUExists #endif /*USE_HDG*/ LOGICAL :: FileVersionExists +INTEGER :: FileVersionHDF5Int !=================================================================================================================================== IF((.NOT.InterpolationInitIsDone).OR.RestartInitIsDone)THEN CALL abort(__STAMP__,'InitRestart not ready to be called or already called.',999,999.) @@ -188,33 +189,39 @@ SUBROUTINE InitRestart() ! check file version CALL DatasetExists(File_ID,'File_Version',FileVersionExists,attrib=.TRUE.) IF (FileVersionExists) THEN - CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5) + CALL ReadAttribute(File_ID,'File_Version',1,RealScalar=FileVersionHDF5Real) + + IF(FileVersionHDF5Real.LT.1.5)THEN + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' Restart file is too old! "File_Version" in restart file < 1.5!' + SWRITE(UNIT_StdOut,'(A)')' The format used in the restart file is not compatible with this version of PICLas.' + SWRITE(UNIT_StdOut,'(A)')' Among others, the particle format (PartData) has changed.' + SWRITE(UNIT_StdOut,'(A)')' Run python script ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py --help' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' for info regarding the usage and run the script against the restart file, e.g., ' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py ProjectName_State_000.0000xxxxxx.h5' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' to update the format and file version number.' + SWRITE(UNIT_StdOut,'(A)')' Note that the format can be changed back to the old one by running the script a second time.' + SWRITE(UNIT_StdOut,'(A)')' ' + SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' + CALL abort(__STAMP__,& + 'Error in InitRestart(): "File_Version" in restart file < 1.5. See error message above to fix. File version in restart file =',& + RealInfoOpt=FileVersionHDF5Real) + END IF ! FileVersionHDF5Real.LT.1.5 ELSE - CALL abort(__STAMP__,'Error in InitRestart(): Attribute "File_Version" does not exist!') + CALL DatasetExists(File_ID,'Piclas_VersionInt',FileVersionExists,attrib=.TRUE.) + IF (FileVersionExists) THEN + CALL ReadAttribute(File_ID,'Piclas_VersionInt',1,IntScalar=FileVersionHDF5Int) + ELSE + CALL abort(__STAMP__,'Error in InitRestart(): Attribute "Piclas_VersionInt" does not exist!') + END IF END IF - IF(FileVersionHDF5.LT.1.5)THEN - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' Restart file is too old! "File_Version" in restart file < 1.5!' - SWRITE(UNIT_StdOut,'(A)')' The format used in the restart file is not compatible with this version of PICLas.' - SWRITE(UNIT_StdOut,'(A)')' Among others, the particle format (PartData) has changed.' - SWRITE(UNIT_StdOut,'(A)')' Run python script ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py --help' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' for info regarding the usage and run the script against the restart file, e.g., ' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' python ./tools/flip_PartState/flip_PartState.py ProjectName_State_000.0000xxxxxx.h5' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' to update the format and file version number.' - SWRITE(UNIT_StdOut,'(A)')' Note that the format can be changed back to the old one by running the script a second time.' - SWRITE(UNIT_StdOut,'(A)')' ' - SWRITE(UNIT_StdOut,'(A)')' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' - CALL abort(__STAMP__,& - 'Error in InitRestart(): "File_Version" in restart file < 1.5. See error message above to fix. File version in restart file =',& - RealInfoOpt=FileVersionHDF5) - END IF ! FileVersionHDF5.LT.1.5 CALL CloseDataFile() ELSE RestartTime = 0.