Skip to content
Snippets Groups Projects
Commit de2eb440 authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann
Browse files

cp at end of sim only if not crashed simulation

parent e06013d4
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ MODULE basic ...@@ -16,6 +16,7 @@ MODULE basic
INTEGER :: cstep = 0 ! Current step number (Init from restart file) INTEGER :: cstep = 0 ! Current step number (Init from restart file)
LOGICAL :: RESTART = .FALSE. ! Signal end of run LOGICAL :: RESTART = .FALSE. ! Signal end of run
LOGICAL :: nlend = .FALSE. ! Signal end of run LOGICAL :: nlend = .FALSE. ! Signal end of run
LOGICAL :: crash = .FALSE. ! Signal end of crashed run
INTEGER :: ierr ! flag for MPI error INTEGER :: ierr ! flag for MPI error
INTEGER :: my_id ! identification number of current process INTEGER :: my_id ! identification number of current process
......
...@@ -261,7 +261,7 @@ SUBROUTINE diagnose(kstep) ...@@ -261,7 +261,7 @@ SUBROUTINE diagnose(kstep)
! Close all diagnostic files ! Close all diagnostic files
CALL closef(fidres) CALL closef(fidres)
IF (nsave_cp .GT. 0) THEN IF ((nsave_cp .GT. 0) .AND. (.NOT. crashed)) THEN
CALL checkpoint_save(cp_counter) CALL checkpoint_save(cp_counter)
CALL closef(fidrst) CALL closef(fidrst)
ENDIF ENDIF
......
...@@ -14,6 +14,7 @@ SUBROUTINE tesend ...@@ -14,6 +14,7 @@ SUBROUTINE tesend
& ierr) & ierr)
IF( mlend ) THEN IF( mlend ) THEN
nlend = .TRUE. nlend = .TRUE.
crash = .TRUE.
IF (my_id .EQ. 0) WRITE(*,'(/a)') 'rhs are NaN/Inf' IF (my_id .EQ. 0) WRITE(*,'(/a)') 'rhs are NaN/Inf'
IF (my_id .EQ. 0) WRITE(*,*) 'Run terminated at cstep=',cstep IF (my_id .EQ. 0) WRITE(*,*) 'Run terminated at cstep=',cstep
RETURN RETURN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment