A data structure representing glaciers, either as ice shelves or (eventually) ice sheets. It will allow coupled systems of glaciers as well as different basal couplings with the ocean or ground. This type is a subclass of the FOODIE integrand, allowing it to take advantage of that set of integration libraries for evolution in time.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(glacier), | private, | allocatable | :: | ice | A model for the ice shelf or ice sheet |
||
class(basal_surface), | private, | allocatable | :: | sub_ice | A model for the ground or ocean underneath the ice |
||
real(kind=r8), | private | :: | time | The time in the simulation |
|||
logical, | private | :: | first_integration | Indicates whether the cryosphere has been integrated before or not. |
|||
real(kind=r8), | private | :: | dt_factor | = | 1.0_r8 | A factor by which to reduce the time step |
|
real(kind=r8), | private | :: | min_dt_factor | = | 1e-3_r8 | The smallest time step reduction to allow |
|
logical, | private | :: | performing_time_step | True if in the process of trying to get a time-step to successfully integrate. |
Initialise a cryosphere object from the provided components. This object will model the evolution of a glacier/ice shelf/ice sheet and its surroundings.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(out) | :: | this | |||
class(glacier), | intent(inout), | allocatable | :: | ice | An object modelling the ice sheet or shelf component of this system. Will be deallocated on return. |
|
class(basal_surface), | intent(inout), | allocatable | :: | sub_ice | An object modelling the component of this system beneath the ice. Will be deallocated on return. |
Calculates an appropriate time step with which to integrate the cryosphere so as not to cause numerical instability.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this |
Reuces the time step by a factor of 2, unless doing so would take it below the minimum value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this |
Increases the time step by a factor of 2, unless doing so would take it above the maximum.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this |
Returns the state vector for the current state of the cryosphere. This takes the form of a 1D array. This routine is mainly useful for unit-testing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(in) | :: | this |
Integrates the cryosphere forward until the specified time
is
reached.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this | |||
real(kind=r8), | intent(in) | :: | time | The time to which to integrate the cryosphere |
Reads the data describing the cryosphere from an HDF5 file on
the disc. h5open_f
must have been called once prior to using
this method. After the method has been used, h5close_f
must be
called once before the end of the program.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | infile | The file from which to read the data describing the state of the cryosphere |
||
logical, | intent(in), | optional | :: | set_time | If present and |
Reads the data describing the ice component of the cryosphere
from an HDF5 file on the disc. Data on anything below the ice is
ignored. h5open_f
must have been called once prior to using
this method. After the method has been used, h5close_f
must be
called once before the end of the program.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | infile | The file from which to read the data describing the state of the cryosphere |
||
logical, | intent(in), | optional | :: | set_time | If present and |
Reads the data describing the part of the cryosphere beneath the
ice from an HDF5 file on the disc. Data on the ice itself is
ignored. h5open_f
must have been called once prior to using
this method. After the method has been used, h5close_f
must be
called once before the end of the program.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | infile | The file from which to read the data describing the state of the cryosphere |
||
logical, | intent(in), | optional | :: | set_time | If present and |
Writes the data describing the cryosphere to the disc as an HDF5
file. h5open_f
must have been called once prior to using this
method. After the method has been used, h5close_f
must be
called once before the end of the program.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | outfile | The file to which to write the data describing the state of the cryosphere |
Returns the current time of the cryosphere system.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(cryosphere), | intent(in) | :: | this |
type, public :: cryosphere
!* Author: Christopher MacMackin
! Date: April 2016
!
! A data structure representing glaciers, either as ice shelves or
! (eventually) ice sheets. It will allow coupled systems of
! glaciers as well as different basal couplings with the ocean or
! ground. This type is a subclass of the
! [FOODIE](https://github.com/Fortran-FOSS-Programmers/FOODIE)
! [integrand](http://fortran-foss-programmers.github.io/FOODIE/type/integrand.html),
! allowing it to take advantage of that set of integration
! libraries for evolution in time.
!
private
class(glacier), allocatable :: ice
!! A model for the ice shelf or ice sheet
class(basal_surface), allocatable :: sub_ice
!! A model for the ground or ocean underneath the ice
real(r8) :: time
!! The time in the simulation
logical :: first_integration
!! Indicates whether the cryosphere has been integrated before
!! or not.
real(r8) :: dt_factor = 1.0_r8
!! A factor by which to reduce the time step
real(r8) :: min_dt_factor = 1e-3_r8
!! The smallest time step reduction to allow
logical :: performing_time_step
!! True if in the process of trying to get a time-step to
!! successfully integrate.
contains
procedure :: initialise
procedure :: time_step
procedure :: reduce_time_step
procedure :: increase_time_step
procedure :: state_vector
procedure :: integrate
procedure :: read_data
procedure :: read_ice
procedure :: read_sub_ice
procedure :: write_data
procedure :: get_time
end type cryosphere