constructor Function

private function constructor(domain, resolution, thickness, velocity, viscosity_law, lambda, chi) result(this)

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.

Arguments

Type IntentOptional AttributesName
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}$

Return Value type(ice_sheet)

An ice sheet object with its domain and initial conditions set according to the arguments of the constructor function.


Called by

proc~~constructor~10~~CalledByGraph proc~constructor~10 constructor interface~ice_sheet ice_sheet interface~ice_sheet->proc~constructor~10

Contents

Source Code


Source Code

  function constructor(domain, resolution, thickness, velocity, &
                       viscosity_law, lambda, chi) result(this)
    !* Author: Christopher MacMackin
    !  Date: April 2016
    !
    ! 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.
    !
    real(r8), dimension(:,:), intent(in)            :: 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, dimension(:), intent(in)               :: 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(r8), intent(in), optional                  :: lambda
      !! The dimensionless ratio 
      !! $\lambda \equiv \frac{\rho_0m_0x_0}{\rho_iH-0u_0}$
    real(r8), intent(in), optional                  :: chi
      !! The dimensionless ratio
      !! $\chi \equiv \frac{\rho_igh_0x_x}{2\eta_0u_0}$
    type(ice_sheet)                                 :: this
      !! An ice sheet object with its domain and initial conditions set
      !! according to the arguments of the constructor function.
  end function constructor