Calculates the time step for integrating the ice shelf, using the CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_shelf), | intent(in) | :: | this |
The time-step to use
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