A concrete implementation of the glacier type, using a vertically integrated model of an ice sheet. This model is 1-dimensional only.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(cheb1d_scalar_field), | private | :: | thickness | Thickness of ice sheet, $h$ |
|||
type(cheb1d_vector_field), | private | :: | velocity | Flow velocity of ice sheet, $\vec{u}$ |
|||
real(kind=r8), | private | :: | lambda | The dimensionless ratio $\lambda \equiv \frac{\rho_0m_0x_0}{\rho_iH-0u_0}$ |
|||
real(kind=r8), | private | :: | chi | The dimensionless ratio $\chi \equiv \frac{\rho_igh_0x_x}{2\eta_0u_0}$ |
|||
class(abstract_viscosity), | private, | allocatable | :: | viscosity_law | An object representing the model used for ice viscosity. |
||
real(kind=r8), | private | :: | time | The time at which the ice sheet is in this state |
Creates a new ice_sheet object with initial conditions provided by the arguments. At present only a 1D model is supported. If information is provided for higher dimensions then it will be ignored.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(in), | dimension(:,:) | :: | domain | An array containing the upper and lower limits of the domain for the ice sheet. The first index represents the dimension for which the boundaries apply. If the second index is 1 then it corresponds to the lower bound. If the second index is 2 then it corresponds to the upper bound. |
|
integer, | intent(in), | dimension(:) | :: | resolution | The number of data points in each dimension |
|
procedure(thickness_func) | :: | thickness | A function which calculates the initial value of the thickness of the ice sheet at a given location. |
|||
procedure(velocity_func) | :: | velocity | A function which calculates the initial value of the velocity (vector) of the ice at a given location in an ice sheet. |
|||
class(abstract_viscosity), | intent(in), | optional | :: | viscosity_law | An object which calculates the viscosity of the ice. |
|
real(kind=r8), | intent(in), | optional | :: | lambda | The dimensionless ratio $\lambda \equiv \frac{\rho_0m_0x_0}{\rho_iH-0u_0}$ |
|
real(kind=r8), | intent(in), | optional | :: | chi | The dimensionless ratio $\chi \equiv \frac{\rho_igh_0x_x}{2\eta_0u_0}$ |
An ice sheet object with its domain and initial conditions set according to the arguments of the constructor function.
Copies the data from one ice shelf into another. This is only needed due to a bug in gfortran which means that the intrinsic assignment for glacier types is not using the appropriate defined assignment for the field components.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_shelf), | intent(out) | :: | this | |||
class(glacier), | intent(in) | :: | rhs | The ice shelf to be assigned to this one. |
Performs a time-step of the integration, taking the state of the glacier to the specified time using the provided melt-rate data.
Integrates the glacier's state to time
. This is done using the
NITSOL package of iterative Krylov solvers. If a different
algorithm for the integration is desired, then this method may
be overridden in the concrete implementations of the glacier
type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(inout) | :: | this | |||
class(glacier), | intent(in), | dimension(:) | :: | old_states | Previous states of the glacier, with the most recent one first. |
|
class(scalar_field), | intent(in) | :: | basal_melt | The melt rate that the bottom of the glacier experiences during this time step. |
||
class(scalar_field), | intent(in) | :: | basal_drag | 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. |
||
real(kind=r8), | intent(in) | :: | time | The time to which the glacier should be integrated |
||
logical, | intent(out) | :: | success | True if the integration is successful, false otherwise |
Dummy routine which can be over-ridden to integrate internal layers of the glacier to the specified time.
Dummy routine which does nothing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(inout) | :: | this | |||
class(glacier), | intent(in), | dimension(:) | :: | old_states | Previous states of the glacier, with the most recent one first. |
|
real(kind=r8), | intent(in) | :: | time | The time to which the glacier should be integrated |
||
logical, | intent(out) | :: | success | True if the integration is successful, false otherwise |
Returns the thickness of the ice sheet across its domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The ice thickness.
Returns the density of the ice in the sheet, which is assumed to be uniform across its domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The ice density.
Returns the density of the ice in the sheet, which is assumed to be uniform across its domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The ice density.
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.
Updates the state of the ice sheet from its state vector. The state vector is a real array containing the value of each of the ice sheet's properties at each of the locations on the grid used in descretization.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(inout) | :: | this | |||
real(kind=r8), | intent(in), | dimension(:) | :: | state_vector | A real array containing the data describing the state of the glacier. |
Provides a preconditioner for the nonlinear solver trying to bring the residual to zero. The Jacobian is approximated as a block matrix, where each block is a tridiagonal matrix using a finite difference method for differentiation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(inout) | :: | 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 |
||
real(kind=r8), | intent(in), | dimension(:) | :: | delta_state | The change to the state vector which is being preconditioned. |
The result of applying the preconditioner to delta_state
.
Sets the time information held by the ice sheet object. This is the time at which the ice sheet is in its current state.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(inout) | :: | this | |||
real(kind=r8), | intent(in) | :: | time | The time at which the glacier is in the present state. |
Returns the number of elements in the ice sheet's state vector. This is the size of the vector returned by residual and state_vector and taken as an argument by update.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The number of elements in the ice sheet's state vector.
Returns the state vector for the current state of the ice sheet. This takes the form of a 1D array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The state vector describing the ice sheet.
Computes the ice sheet velocity at the current time with the current ice thickness.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(inout) | :: | this | |||
class(scalar_field), | intent(in) | :: | basal_drag | A paramter, e.g. coefficient of friction, needed to calculate the drag on basal surface of the glacier. |
||
logical, | intent(out) | :: | success | True if the integration is successful, false otherwise |
Reads the state of the ice shelf object from the specified group in an HDF5 file. This sets the thickness, the velocity, and parameter values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(inout) | :: | this | |||
integer(kind=hid_t), | intent(in) | :: | file_id | The identifier for the HDF5 file/group in which this data is meant to be written. |
||
character(len=*), | intent(in) | :: | group_name | The name to give the group in the HDF5 file storing the ice shelf's data. |
||
integer, | intent(out) | :: | error | Flag indicating whether routine ran without error. If no error occurs then has value 0. |
Writes the state of the ice sheet object to an HDF file in the specified group. This will consist of a thickness and a velocity dataset.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this | |||
integer(kind=hid_t), | intent(in) | :: | file_id | The identifier for the HDF5 file/group in which this data is meant to be written. |
||
character(len=*), | intent(in) | :: | group_name | The name to give the group in the HDF5 file storing the ice sheet's data. |
||
integer, | intent(out) | :: | error | Flag indicating whether routine ran without error. If no error occurs then has value 0. |
Calculates the time step for integrating the ice sheet, using the CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(in) | :: | this |
The time-step to use
Copies the data from one ice sheet into another. This is only needed due to a bug in gfortran which means that the intrinsic assignment for glacier types is not using the appropriate defined assignment for the field components.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ice_sheet), | intent(out) | :: | this | |||
class(glacier), | intent(in) | :: | rhs | The ice sheet to be assigned to this one. |
type, extends(glacier), public :: ice_sheet
!* Author: Chris MacMackin
! Date: April 2016
!
! A concrete implementation of the [[glacier]] type, using a vertically
! integrated model of an ice sheet. This model is 1-dimensional only.
!
private
type(cheb1d_scalar_field) :: thickness
!! Thickness of ice sheet, $h$
type(cheb1d_vector_field) :: velocity
!! Flow velocity of ice sheet, $\vec{u}$
real(r8) :: lambda
!! The dimensionless ratio
!! $\lambda \equiv \frac{\rho_0m_0x_0}{\rho_iH-0u_0}$
real(r8) :: chi
!! The dimensionless ratio
!! $\chi \equiv \frac{\rho_igh_0x_x}{2\eta_0u_0}$
class(abstract_viscosity), allocatable :: viscosity_law
!! An object representing the model used for ice viscosity.
real(r8) :: time
!! The time at which the ice sheet is in this state
contains
!$ procedure :: t => sheet_dt
!$ procedure :: local_error => sheet_local_error
!$ procedure :: integrand_multiply_integrand => sheet_m_sheet
!$ procedure :: integrand_multiply_real => sheet_m_real
!$ procedure, pass(rhs) :: real_multiply_integrand => real_m_sheet
!$ procedure :: add => sheet_add
!$ procedure :: sub => sheet_sub
!$ procedure :: assign_integrand => sheet_assign
procedure :: ice_thickness => sheet_thickness
!$ procedure :: ice_velocity => sheet_velocity
procedure :: ice_density => sheet_density
procedure :: ice_temperature => sheet_temperature
procedure :: residual => sheet_residual
procedure :: update => sheet_update
procedure :: precondition => sheet_precondition
procedure :: set_time => sheet_set_time
procedure :: data_size => sheet_data_size
procedure :: state_vector => sheet_state_vector
procedure :: solve_velocity => sheet_solve_velocity
procedure :: read_data => sheet_read_data
procedure :: write_data => sheet_write_data
procedure :: time_step => sheet_time_step
procedure, private :: assign => sheet_assign
end type ice_sheet