Returns the residual when the current state of the glacier is run through the system of equations describing it. The residual takes the form of a 1D array, with each element respresenting the residual for one of the equations in the system.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this | |||
class(glacier), | intent(in), | dimension(:) | :: | previous_states | The states of the glacier in the previous time steps. The first element of the array should be the most recent. The default implementation will only make use of the most recent state, but the fact that this is an array allows overriding methods to use older states for higher-order integration methods. |
|
class(scalar_field), | intent(in) | :: | melt_rate | Thickness of the ice above the glacier. |
||
class(scalar_field), | intent(in) | :: | basal_drag_parameter | A paramter, e.g. coefficient of friction, needed to calculate the drag on basal surface of the glacier. |
||
real(kind=r8), | intent(in) | :: | water_density | The density of the water below the glacier. |
The residual of the system of equations describing the glacier.
function sheet_residual(this, previous_states, melt_rate, basal_drag_parameter, &
water_density) result(residual)
!* Author: Christopher MacMackin
! Date: April 2016
!
! Returns the residual when the current state of the glacier is run
! through the system of equations describing it. The residual takes the
! form of a 1D array, with each element respresenting the residual for
! one of the equations in the system.
!
class(ice_sheet), intent(in) :: this
class(glacier), dimension(:), intent(in) :: previous_states
!! The states of the glacier in the previous time steps. The
!! first element of the array should be the most recent. The
!! default implementation will only make use of the most recent
!! state, but the fact that this is an array allows overriding
!! methods to use older states for higher-order integration
!! methods.
class(scalar_field), intent(in) :: melt_rate
!! Thickness of the ice above the glacier.
class(scalar_field), intent(in) :: basal_drag_parameter
!! A paramter, e.g. coefficient of friction, needed to calculate the
!! drag on basal surface of the glacier.
real(r8), intent(in) :: water_density
!! The density of the water below the glacier.
real(r8), dimension(:), allocatable :: residual
!! The residual of the system of equations describing the glacier.
end function sheet_residual