prescribed_eos Derived Type

type, public, extends(equation_of_state) :: prescribed_eos

An equation of state, depending only on salinity, where the salinity is prescribed such that for some specified thickness . The salinity is related to the density by the haline contraction coefficient . The only real use for this is testing and debugging the plume model.


Inherits

type~~prescribed_eos~~InheritsGraph type~prescribed_eos prescribed_eos type~equation_of_state equation_of_state type~prescribed_eos->type~equation_of_state scalar_field scalar_field type~prescribed_eos->scalar_field density

Contents

Source Code


Components

TypeVisibility AttributesNameInitial
class(scalar_field), private, allocatable:: density

The density calculated from the prescribed salinity

real(kind=r8), private :: beta_s

The haline contraction coefficient


Constructor

public interface prescribed_eos

  • private function constructor(const, beta_s, thickness) result(this)

    Arguments

    Type IntentOptional AttributesName
    real(kind=r8), intent(in) :: const

    The constant to which is equal.

    real(kind=r8), intent(in) :: beta_s

    The haline contraction coefficient, , relating salinity and density.

    class(scalar_field), intent(in) :: thickness

    The thickness of the plume, from which the salinity is calculated.

    Return Value type(prescribed_eos)


Type-Bound Procedures

procedure, public :: water_density => prescribed_water_density

  • private function prescribed_water_density(this, temperature, salinity) result(density)

    Author
    Chris MacMackin
    Date
    March 2017

    Returns the density corresponding to the prescribed salinity, as calculated in the constructor.

    Arguments

    Type IntentOptional AttributesName
    class(prescribed_eos), intent(in) :: this
    class(scalar_field), intent(in) :: temperature

    A field containing the temperature of the water

    class(scalar_field), intent(in) :: salinity

    A field containing the salinity of the water

    Return Value class(scalar_field), pointer

    A field containing the density of the water

procedure, public, pass(rhs) :: prescribed_assign

  • private subroutine prescribed_assign(lhs, rhs)

    Author
    Chris MacMackin
    Date
    March 2017

    Assigns this object to another equation of state object, allowing the definided assignment for the precalculated density field to work correctly.

    Arguments

    Type IntentOptional AttributesName
    class(equation_of_state), intent(out) :: lhs
    class(prescribed_eos), intent(in) :: rhs

generic, public :: assignment(=) => prescribed_assign

  • private subroutine prescribed_assign(lhs, rhs)

    Author
    Chris MacMackin
    Date
    March 2017

    Assigns this object to another equation of state object, allowing the definided assignment for the precalculated density field to work correctly.

    Arguments

    Type IntentOptional AttributesName
    class(equation_of_state), intent(out) :: lhs
    class(prescribed_eos), intent(in) :: rhs

procedure, public :: water_density_derivative => prescribed_water_deriv

  • private function prescribed_water_deriv(this, temperature, d_temperature, salinity, d_salinity, dir) result(d_density)

    Author
    Chris MacMackin
    Date
    July 2017

    Calculates the derivative of the water density.

    Arguments

    Type IntentOptional AttributesName
    class(prescribed_eos), intent(in) :: this
    class(scalar_field), intent(in) :: temperature

    A field containing the temperature of the water

    class(scalar_field), intent(in) :: d_temperature

    A field containing the derivative of the temperature of the water, in teh same direction as dir

    class(scalar_field), intent(in) :: salinity

    A field containing the salinity of the water

    class(scalar_field), intent(in) :: d_salinity

    A field containing the derivative of the salinity of the water, in the same direction as dir

    integer, intent(in) :: dir

    The direction in which to take the derivative

    Return Value class(scalar_field), pointer

    A field containing the density of the water

procedure, public :: haline_contraction => prescribed_haline_contraction

  • private function prescribed_haline_contraction(this, temperature, salinity) result(coef)

    Author
    Chris MacMackin
    Date
    June 2017

    Returns the haline contraction coefficient.

    Arguments

    Type IntentOptional AttributesName
    class(prescribed_eos), intent(in) :: this
    class(scalar_field), intent(in) :: temperature
    class(scalar_field), intent(in) :: salinity

    Return Value class(scalar_field), allocatable

procedure, public :: thermal_contraction => prescribed_thermal_contraction

  • private function prescribed_thermal_contraction(this, temperature, salinity) result(coef)

    Author
    Chris MacMackin
    Date
    June 2017

    Returns the thermal contraction coefficient.

    Arguments

    Type IntentOptional AttributesName
    class(prescribed_eos), intent(in) :: this
    class(scalar_field), intent(in) :: temperature
    class(scalar_field), intent(in) :: salinity

    Return Value class(scalar_field), allocatable

Source Code

  type, extends(equation_of_state), public :: prescribed_eos
    !* Author: Chris MacMackin
    !  Date: March 2017
    !
    ! An equation of state, depending only on salinity, where the
    ! salinity is prescribed such that \(SD = {\rm constant}\) for
    ! some specified thickness \(D\). The salinity is related to the
    ! density by the haline contraction coefficient \(\beta_S\). The
    ! only real use for this is testing and debugging the plume model.
    !
    private
    class(scalar_field), allocatable :: density
      !! The density calculated from the prescribed salinity
    real(r8)                         :: beta_s
      !! The haline contraction coefficient
  contains
    procedure :: water_density => prescribed_water_density
    procedure, pass(rhs) :: prescribed_assign
    generic :: assignment(=) => prescribed_assign
    procedure :: water_density_derivative => prescribed_water_deriv
    procedure :: haline_contraction => prescribed_haline_contraction
    procedure :: thermal_contraction => prescribed_thermal_contraction
  end type prescribed_eos