shelf_time_step Function

private function shelf_time_step(this) result(dt)

Calculates the time step for integrating the ice shelf, using the CFL condition.

Arguments

Type IntentOptional AttributesName
class(ice_shelf), intent(in) :: this

Return Value real(kind=r8)

The time-step to use


Calls

proc~~shelf_time_step~~CallsGraph proc~shelf_time_step shelf_time_step str str proc~shelf_time_step->str

Contents

Source Code


Source Code

  function shelf_time_step(this) result(dt)
    !* Author: Chris MacMackin
    !  Date: December 2016
    !
    ! Calculates the time step for integrating the ice shelf, using
    ! the CFL condition.
    !
    class(ice_shelf), intent(in) :: this
    class(scalar_field), pointer :: u, dx1
    class(vector_field), pointer :: dx
    real(r8) :: dt
      !! The time-step to use
    u => this%velocity%component(1)
    dx => this%velocity%grid_spacing()
    dx1 => dx%component(1)
    call dx1%guard_temp()
    dt = min(minval(abs(this%courant*dx1/u)), this%max_dt)
    call dx1%clean_temp()
    call logger%trivia('ice_shelf%time_step','Calculated time step of '// &
                        trim(str(dt))//' using Courant number of '//       &
                        trim(str(this%courant)))
  end function shelf_time_step