Reuces the time step by a factor of 2, unless doing so would take it below the minimum value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this |
subroutine reduce_time_step(this)
!* Author: Christopher MacMackin
! Date: April 2017
!
! Reuces the time step by a factor of 2, unless doing so would
! take it below the minimum value.
!
class(cryosphere), intent(inout) :: this
real(r8) :: new_factor
new_factor = 0.7_r8 * this%dt_factor
if (new_factor < this%min_dt_factor) then
this%dt_factor = this%min_dt_factor
call logger%warning('cryosphere%reduce_time_step','Attempting to '// &
'reduce time step factor below minimum value '// &
'of '//trim(str(this%min_dt_factor)))
else
this%dt_factor = new_factor
end if
#ifdef DEBUG
call logger%debug('cryosphere%reduce_time_step','Reducing time '// &
'step by factor of '//trim(str(this%dt_factor)))
#endif
end subroutine reduce_time_step