constructor Function

private function constructor(temperature, salinity) result(this)

Produces an ambient object which will return the specified salinity and temeprature values.

Arguments

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

The temperature of the ambient ocean. Default is 0.

real(kind=r8), intent(in), optional :: salinity

The salinity of the ambient ocean. Default is 0.

Return Value type(uniform_ambient_conditions)


Calls

proc~~constructor~12~~CallsGraph proc~constructor~12 constructor uniform_scalar_field uniform_scalar_field proc~constructor~12->uniform_scalar_field

Called by

proc~~constructor~12~~CalledByGraph proc~constructor~12 constructor interface~uniform_ambient_conditions uniform_ambient_conditions interface~uniform_ambient_conditions->proc~constructor~12

Contents

Source Code


Source Code

  function constructor(temperature, salinity) result(this)
    !* Author: Chris MacMackin
    !  Date: November 2016
    !
    ! Produces an ambient object which will return the specified
    ! salinity and temeprature values.
    !
    real(r8), intent(in), optional :: temperature
      !! The temperature of the ambient ocean. Default is 0.
    real(r8), intent(in), optional :: salinity
      !! The salinity of the ambient ocean. Default is 0.
    type(uniform_ambient_conditions) :: this
    if (present(temperature)) then
      this%temperature = uniform_scalar_field(temperature)
    else
      this%temperature = uniform_scalar_field(0.0_r8)
    end if
    if (present(salinity)) then
      this%salinity = uniform_scalar_field(salinity)
    else
      this%salinity = uniform_scalar_field(0.0_r8)
    end if
  end function constructor