From 415d081e42bc2ae80aca53f7b33c9ccc8f4c11ae Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Tue, 15 Sep 2020 20:05:05 -0300 Subject: [PATCH 1/2] EVOLUTION: Get umax from the block interiors only. Signed-off-by: Grzegorz Kowal --- sources/evolution.F90 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sources/evolution.F90 b/sources/evolution.F90 index c5b33aa..0a55fc2 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -1072,8 +1072,13 @@ module evolution umax = 0.0d+00 pdata => list_data do while (associated(pdata)) - umax = max(umax, maxval(abs(pdata%u0(:,:,:,:))), & - maxval(abs(pdata%u1(:,:,:,:)))) +#if NDIMS == 3 + umax = max(umax, maxval(abs(pdata%u0(:,nb:ne,nb:ne,nb:ne))), & + maxval(abs(pdata%u1(:,nb:ne,nb:ne,nb:ne)))) +#else /* NDIMS == 3 */ + umax = max(umax, maxval(abs(pdata%u0(:,nb:ne,nb:ne, : ))), & + maxval(abs(pdata%u1(:,nb:ne,nb:ne, : )))) +#endif /* NDIMS == 3 */ pdata => pdata%next end do ! over data blocks @@ -2141,8 +2146,13 @@ module evolution umax = 0.0d+00 pdata => list_data do while (associated(pdata)) - umax = max(umax, maxval(abs(pdata%u0(:,:,:,:))), & - maxval(abs(pdata%u1(:,:,:,:)))) +#if NDIMS == 3 + umax = max(umax, maxval(abs(pdata%u0(:,nb:ne,nb:ne,nb:ne))), & + maxval(abs(pdata%u1(:,nb:ne,nb:ne,nb:ne)))) +#else /* NDIMS == 3 */ + umax = max(umax, maxval(abs(pdata%u0(:,nb:ne,nb:ne, : ))), & + maxval(abs(pdata%u1(:,nb:ne,nb:ne, : )))) +#endif /* NDIMS == 3 */ pdata => pdata%next end do ! over data blocks From 2450ec2a3432c031dc03e110fd362537678a5a6c Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Tue, 15 Sep 2020 20:06:49 -0300 Subject: [PATCH 2/2] IO: Store dte in the restart snapshots. Signed-off-by: Grzegorz Kowal --- sources/io.F90 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sources/io.F90 b/sources/io.F90 index 086df8b..630f819 100644 --- a/sources/io.F90 +++ b/sources/io.F90 @@ -1260,7 +1260,7 @@ module io use blocks , only : change_blocks_process use coordinates , only : nn => bcells, ncells use coordinates , only : xmin, xmax, ymin, ymax, zmin, zmax - use evolution , only : step, time, dt, dtn + use evolution , only : step, time, dt, dtn, dte use evolution , only : niterations, nrejections, errs use forcing , only : nmodes, fcoefs, einj use hash , only : xxh64 @@ -1413,6 +1413,8 @@ module io read(svalue, fmt = *) dt case('dtn') read(svalue, fmt = *) dtn + case('dte') + read(svalue, fmt = *) dte case('niterations') read(svalue, fmt = *) niterations case('nrejections') @@ -2076,7 +2078,7 @@ module io #endif /* NDIMS == 3 */ use coordinates , only : bdims => domain_base_dims use equations , only : eqsys, eos, nv - use evolution , only : step, time, dt, dtn, cfl, glm_alpha, errs + use evolution , only : step, time, dt, dtn, dte, cfl, glm_alpha, errs use evolution , only : atol, rtol, mrej, niterations, nrejections use forcing , only : nmodes, fcoefs, einj use iso_fortran_env, only : error_unit @@ -2226,6 +2228,7 @@ module io call write_attribute_xml(lun, "time" , time) call write_attribute_xml(lun, "dt" , dt) call write_attribute_xml(lun, "dtn" , dtn) + call write_attribute_xml(lun, "dte" , dte) call write_attribute_xml(lun, "cfl" , cfl) call write_attribute_xml(lun, "glm_alpha", glm_alpha) call write_attribute_xml(lun, "absolute_tolerance", atol) @@ -2545,7 +2548,7 @@ module io #endif /* NDIMS == 3 */ use coordinates , only : bdims => domain_base_dims use equations , only : eqsys, eos, nv, pvars, adiabatic_index, csnd - use evolution , only : step, time, dt, dtn, cfl, glm_alpha + use evolution , only : step, time, dt, cfl, glm_alpha use iso_fortran_env, only : error_unit use mpitools , only : nprocs, nproc use parameters , only : get_parameter_file @@ -2682,7 +2685,6 @@ module io call write_attribute_xml(lun, "step" , step) call write_attribute_xml(lun, "time" , time) call write_attribute_xml(lun, "dt" , dt) - call write_attribute_xml(lun, "dtn" , dtn) call write_attribute_xml(lun, "cfl" , cfl) call write_attribute_xml(lun, "glm_alpha", glm_alpha) write(lun,"(a)") '' @@ -4010,7 +4012,7 @@ module io use coordinates , only : xmin, xmax, ymin, ymax, zmin, zmax use coordinates , only : periodic use equations , only : eqsys, eos, adiabatic_index, csnd - use evolution , only : step, time, dt, dtn, cfl, glm_alpha, errs + use evolution , only : step, time, dt, dtn, dte, cfl, glm_alpha, errs use evolution , only : atol, rtol, mrej, niterations, nrejections use forcing , only : nmodes, einj, fcoefs use hdf5 , only : hid_t @@ -4114,6 +4116,7 @@ module io call write_attribute(gid, 'time', time) call write_attribute(gid, 'dt' , dt ) call write_attribute(gid, 'dtn' , dtn ) + call write_attribute(gid, 'dte' , dte ) call write_attribute(gid, 'cfl' , cfl ) call write_attribute(gid, 'glm_alpha', glm_alpha) if (eos == 'adi') then @@ -4210,7 +4213,7 @@ module io use blocks , only : get_mblocks, get_dblocks, get_nleafs use coordinates , only : ncells use coordinates , only : xmin, xmax, ymin, ymax, zmin, zmax - use evolution , only : step, time, dt, dtn + use evolution , only : step, time, dt, dtn, dte use evolution , only : niterations, nrejections, errs use forcing , only : nmodes, fcoefs use hdf5 , only : hid_t @@ -4286,6 +4289,7 @@ module io call read_attribute(gid, 'time', time) call read_attribute(gid, 'dt' , dt ) call read_attribute(gid, 'dtn' , dtn ) + call read_attribute(gid, 'dte' , dte ) call read_attribute(gid, 'errs(1)', errs(1)) call read_attribute(gid, 'errs(2)', errs(2)) call read_attribute(gid, 'errs(3)', errs(3))