An abstract data type which represents large masses of ice, such as ice shelves and ice sheets.
Returns the thickness of the ice in the glacier across the domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
The value of whatever property of the glacier is being returned.
Returns the density of the ice, which is assumed to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
The value of whatever property of the glacier is being returned.
Returns the temperature of the ice, which is assumed to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
The value of whatever property of the glacier is being returned.
Computes the residual of the system of equations describing the glacier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | 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
Applies a preconditioner to the passed state vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | 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
.
Solves for the velocity field using the current thickness.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | 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 |
Sets the state of the glacier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(inout) | :: | this | |||
real(kind=r8), | intent(in), | dimension(:) | :: | state_vector | A real array containing the data describing the state of the glacier. |
Sets the time record for this glacier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | 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 glacier's state vector
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
The value of whatever property of the glacier is being returned.
Returns the glacier's state vector, a 1D array with all necessary data to describe its state.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
The state vector of the glacier
Read the glacier data from an HDF5 file on the disc.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(inout) | :: | this | |||
integer(kind=hid_t), | intent(in) | :: | file_id | The identifier for the HDF5 file/group from which the data will be read. |
||
character(len=*), | intent(in) | :: | group_name | The name of the group in the HDF5 file from which to read glacier's data. |
||
integer, | intent(out) | :: | error | Flag indicating whether routine ran without error. If no error occurs then has value 0. |
Writes the data describing the glacier to the disc as an HDF5 file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | 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 glacier's data. |
||
integer, | intent(out) | :: | error | Flag indicating whether routine ran without error. If no error occurs then has value 0. |
Calculates the appropriate time step for integration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(glacier), | intent(in) | :: | this |
A time step which will allow integration of the ice shelf without causing numerical instability.
Copies the data from one glacier 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.
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 |
type, abstract, public :: glacier
!* Author: Christopehr MacMackin
! Date: April 2016
!
! An abstract data type which represents large masses of ice, such
! as ice shelves and ice sheets.
!
contains
procedure(get_scalar), deferred :: ice_thickness
!! Returns the thickness of the ice in the glacier across the domain.
procedure(get_r8), deferred :: ice_density
!! Returns the density of the ice, which is assumed to be uniform.
procedure(get_r8), deferred :: ice_temperature
!! Returns the temperature of the ice, which is assumed to be uniform.
procedure(get_residual), deferred :: residual
!! Computes the residual of the system of equations describing the
!! glacier.
procedure(precond), deferred :: precondition
!! Applies a preconditioner to the passed state vector.
procedure(solve_vel), deferred :: solve_velocity
!! Solves for the velocity field using the current thickness.
procedure(setter), deferred :: update
!! Sets the state of the glacier.
procedure(time_setter), deferred :: set_time
!! Sets the time record for this glacier.
procedure(get_i), deferred :: data_size
!! Returns the number of elements in the glacier's state vector
procedure(get_r81d), deferred :: state_vector
!! Returns the glacier's state vector, a 1D array with all necessary
!! data to describe its state.
procedure(read_dat), deferred :: read_data
!! Read the glacier data from an HDF5 file on the disc.
procedure(write_dat), deferred :: write_data
!! Writes the data describing the glacier to the disc as an HDF5 file.
procedure(t_step), deferred :: time_step
!! Calculates the appropriate time step for integration.
procedure(assign_ice), private, deferred :: assign
!! Copies the data from one glacier 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.
generic :: assignment(=) => assign
procedure :: integrate => glacier_integrate
!! Performs a time-step of the integration, taking the state of
!! the glacier to the specified time using the provided
!! melt-rate data.
procedure :: integrate_layers => glacier_integrate_layers
!! Dummy routine which can be over-ridden to integrate internal
!! layers of the glacier to the specified time.
end type glacier