Commits

Glenn Hammond  committed f478f2c

Added TS_STOP_MAX_TIME_STEP as a flag for stopping simulation. Forces simulation to stop even if cuts are taken.

  • Participants
  • Parent commits d768a17

Comments (0)

Files changed (2)

File src/pflotran/timestepper_BE.F90

       ! if a cut occurs on the last time step, the stop_flag will have been
       ! set to TS_STOP_END_SIMULATION.  Set back to TS_CONTINUE to prevent
       ! premature ending of simulation.
-      stop_flag = TS_CONTINUE
+      if (stop_flag /= TS_STOP_MAX_TIME_STEP) stop_flag = TS_CONTINUE
 
       if (icut > this%max_time_step_cuts .or. &
           this%dt < 1.d-20) then

File src/pflotran/timestepper_base.F90

  
   PetscInt, parameter, public :: TS_CONTINUE = 0
   PetscInt, parameter, public :: TS_STOP_END_SIMULATION = 1
-  PetscInt, parameter, public :: TS_STOP_FAILURE = 2
+  PetscInt, parameter, public :: TS_STOP_MAX_TIME_STEP = 2
+  PetscInt, parameter, public :: TS_STOP_FAILURE = 3
 
   type, public :: stepper_base_type
   
   
   if (cumulative_time_steps >= max_time_step-1) then
     nullify(cur_waypoint)
+    stop_flag = TS_STOP_MAX_TIME_STEP
   endif
 
   ! update maximum time step size to current waypoint value
   if (associated(cur_waypoint)) then
     dt_max = cur_waypoint%dt_max
-  else
+  else if (stop_flag /= TS_STOP_MAX_TIME_STEP) then
     stop_flag = TS_STOP_END_SIMULATION ! stop after end of time step
   endif