diff --git a/matlab/write_fort90.m b/matlab/write_fort90.m index 87fdab4b6dedeac1995b5dd1ecef4ae3624cbc74..f6d04f34c78bc4c005aae96ddff3ce0cc6ffdf2f 100644 --- a/matlab/write_fort90.m +++ b/matlab/write_fort90.m @@ -28,6 +28,7 @@ fprintf(fid,[' nsave_0d = ', num2str(OUTPUTS.nsave_0d),'\n']); fprintf(fid,[' nsave_1d = ', num2str(OUTPUTS.nsave_1d),'\n']); fprintf(fid,[' nsave_2d = ', num2str(OUTPUTS.nsave_2d),'\n']); fprintf(fid,[' nsave_5d = ', num2str(OUTPUTS.nsave_5d),'\n']); +fprintf(fid,[' nsave_cp = ', num2str(OUTPUTS.nsave_cp),'\n']); fprintf(fid,[' write_Na00 = ', OUTPUTS.write_Na00,'\n']); fprintf(fid,[' write_moments = ', OUTPUTS.write_moments,'\n']); fprintf(fid,[' write_phi = ', OUTPUTS.write_phi,'\n']); diff --git a/src/diagnose.F90 b/src/diagnose.F90 index 47f83a16178768af567f94e7d84dde9c4ca4f1bf..073bd3c283487d3db44b92032f29012b6bae152c 100644 --- a/src/diagnose.F90 +++ b/src/diagnose.F90 @@ -255,12 +255,12 @@ SUBROUTINE diagnose(kstep) END IF ! 2.5 Backups - nsave_cp = INT(5/dt) - IF (MOD(cstep, nsave_cp) == 0) THEN - CALL checkpoint_save(cp_counter) - cp_counter = cp_counter + 1 + IF (nsave_cp .NE. 0) THEN + IF (MOD(cstep, nsave_cp) == 0) THEN + CALL checkpoint_save(cp_counter) + cp_counter = cp_counter + 1 + ENDIF ENDIF - !_____________________________________________________________________________ ! 3. Final diagnostics diff --git a/src/diagnostics_par_mod.F90 b/src/diagnostics_par_mod.F90 index 30a6424bc0195528dbd5d80d11f47d92f957c55c..5a6d168c9eb25a3e327b0f8e6711a471f91321cd 100644 --- a/src/diagnostics_par_mod.F90 +++ b/src/diagnostics_par_mod.F90 @@ -11,8 +11,7 @@ MODULE diagnostics_par LOGICAL, PUBLIC, PROTECTED :: write_non_lin=.TRUE. LOGICAL, PUBLIC, PROTECTED :: write_doubleprecision=.FALSE. - INTEGER, PUBLIC, PROTECTED :: nsave_0d , nsave_1d , nsave_2d , nsave_5d - INTEGER, PUBLIC :: nsave_cp = 1e4 + INTEGER, PUBLIC, PROTECTED :: nsave_0d , nsave_1d , nsave_2d , nsave_5d, nsave_cp ! HDF5 file CHARACTER(len=256), PUBLIC :: resfile0 = "results" ! Head of main result file name @@ -35,7 +34,7 @@ CONTAINS USE prec_const IMPLICIT NONE - NAMELIST /OUTPUT_PAR/ nsave_0d , nsave_1d , nsave_2d , nsave_5d + NAMELIST /OUTPUT_PAR/ nsave_0d , nsave_1d , nsave_2d , nsave_5d, nsave_cp NAMELIST /OUTPUT_PAR/ write_Na00, write_moments, write_phi, write_non_lin, write_doubleprecision NAMELIST /OUTPUT_PAR/ resfile0, rstfile0, job2load diff --git a/wk/setup.m b/wk/setup.m index 6a2205ae4a198aa21c8c0e3761feae89a531dcc8..1d84c183a2a4c43dc59d6a274158ae8722369cfa 100644 --- a/wk/setup.m +++ b/wk/setup.m @@ -84,6 +84,7 @@ OUTPUTS.nsave_0d = floor(1.0/SPS0D/DT); OUTPUTS.nsave_1d = 0; OUTPUTS.nsave_2d = floor(1.0/SPS2D/DT); OUTPUTS.nsave_5d = floor(1.0/SPS5D/DT); +OUTPUTS.nsave_cp = floor(1.0/SPSCP/DT); OUTPUTS.write_Na00 = '.true.'; OUTPUTS.write_moments = '.true.'; OUTPUTS.write_phi = '.true.';