constructor Function

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)


Called by

proc~~constructor~8~~CalledByGraph proc~constructor~8 constructor interface~prescribed_eos prescribed_eos interface~prescribed_eos->proc~constructor~8

Contents

Source Code


Source Code

  function constructor(const, beta_s, thickness) result(this)
    real(r8), intent(in)            :: const
      !! The constant to which \(SD\) is equal.
    real(r8), intent(in)            :: beta_s
      !! The haline contraction coefficient, \(\beta_S\), relating
      !! salinity and density.
    class(scalar_field), intent(in) :: thickness
      !! The thickness of the plume, from which the salinity is calculated.
    type(prescribed_eos)            :: this
    call thickness%guard_temp()
    allocate(this%density, mold=thickness)
    this%density = const*beta_s/thickness
    this%beta_s = beta_s
    call thickness%clean_temp()
  end function constructor