reduce_time_step Subroutine

private subroutine reduce_time_step(this)

Reuces the time step by a factor of 2, unless doing so would take it below the minimum value.

Arguments

Type IntentOptional AttributesName
class(cryosphere), intent(inout) :: this

Calls

proc~~reduce_time_step~~CallsGraph proc~reduce_time_step reduce_time_step str str proc~reduce_time_step->str

Contents

Source Code


Source Code

  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