[cig-commits] r21285 - in seismo/3D/SPECFEM3D_GLOBE/trunk: DATA src/specfem3D
elliott.sales.de.andrade at geodynamics.org
elliott.sales.de.andrade at geodynamics.org
Tue Jan 22 15:21:30 PST 2013
Author: elliott.sales.de.andrade
Date: 2013-01-22 15:21:29 -0800 (Tue, 22 Jan 2013)
New Revision: 21285
Modified:
seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file
seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/read_forward_arrays.f90
Log:
Allow setting an unlimited NUMBER_OF_RUNS.
The limit to a maximum of just 3 NUMBER_OF_RUNS appears to be completely
arbitrary, and not required by any code. I set the upper limit as NSTEP,
though I think doing one run per time step is not a good idea. I don't
know what the largest calculation time per step is, so maybe that would
be useful for someone.
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file 2013-01-22 18:56:07 UTC (rev 21284)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file 2013-01-22 23:21:29 UTC (rev 21285)
@@ -82,7 +82,7 @@
# save mesh files to check the mesh
SAVE_MESH_FILES = .false.
-# restart files (number of runs can be 1, 2 or 3, choose 1 for no restart files)
+# restart files (number of runs can be 1 or higher, choose 1 for no restart files)
NUMBER_OF_RUNS = 1
NUMBER_OF_THIS_RUN = 1
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/read_forward_arrays.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/read_forward_arrays.f90 2013-01-22 18:56:07 UTC (rev 21284)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/read_forward_arrays.f90 2013-01-22 23:21:29 UTC (rev 21285)
@@ -99,33 +99,16 @@
character(len=150) outputname
! define correct time steps if restart files
- if(NUMBER_OF_RUNS < 1 .or. NUMBER_OF_RUNS > 3) stop 'number of restart runs can be 1, 2 or 3'
+ if(NUMBER_OF_RUNS < 1 .or. NUMBER_OF_RUNS > NSTEP) &
+ stop 'number of restart runs can not be less than 1 or greater than NSTEP'
if(NUMBER_OF_THIS_RUN < 1 .or. NUMBER_OF_THIS_RUN > NUMBER_OF_RUNS) stop 'incorrect run number'
if (SIMULATION_TYPE /= 1 .and. NUMBER_OF_RUNS /= 1) stop 'Only 1 run for SIMULATION_TYPE = 2/3'
- if(NUMBER_OF_RUNS == 3) then
- if(NUMBER_OF_THIS_RUN == 1) then
- it_begin = 1
- it_end = NSTEP/3
- else if(NUMBER_OF_THIS_RUN == 2) then
- it_begin = NSTEP/3 + 1
- it_end = 2*(NSTEP/3)
- else
- it_begin = 2*(NSTEP/3) + 1
- it_end = NSTEP
- endif
-
- else if(NUMBER_OF_RUNS == 2) then
- if(NUMBER_OF_THIS_RUN == 1) then
- it_begin = 1
- it_end = NSTEP/2
- else
- it_begin = NSTEP/2 + 1
- it_end = NSTEP
- endif
-
+ it_begin = (NUMBER_OF_THIS_RUN - 1) * (NSTEP / NUMBER_OF_RUNS) + 1
+ if (NUMBER_OF_THIS_RUN < NUMBER_OF_RUNS) then
+ it_end = NUMBER_OF_THIS_RUN * (NSTEP / NUMBER_OF_RUNS)
else
- it_begin = 1
+ ! Last run may be a bit larger
it_end = NSTEP
endif
More information about the CIG-COMMITS
mailing list