[cig-commits] r22234 - seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D
xie.zhinan at geodynamics.org
xie.zhinan at geodynamics.org
Wed Jun 12 09:28:50 PDT 2013
Author: xie.zhinan
Date: 2013-06-12 09:28:50 -0700 (Wed, 12 Jun 2013)
New Revision: 22234
Modified:
seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90
Log:
fix error of it_begin and it_end
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90 2013-06-12 16:10:48 UTC (rev 22233)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90 2013-06-12 16:28:50 UTC (rev 22234)
@@ -2038,6 +2038,19 @@
! this makes indexing and timing easier to match with adjoint wavefields indexing.
#ifdef UNDO_ATT
if(NUMBER_OF_THIS_RUN > 1) stop 'now we do not support NUMBER_OF_THIS_RUN > 1 case in UNDO_ATT '
+ ! define correct time steps if restart files
+ 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'
+
+ 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
+ ! Last run may be a bit larger
+ it_end = NSTEP
+ endif
#else
call read_forward_arrays_startrun(myrank,NSTEP, &
SIMULATION_TYPE,NUMBER_OF_RUNS,NUMBER_OF_THIS_RUN, &
More information about the CIG-COMMITS
mailing list