wright_rho Function

private pure function wright_rho(t, s, p) result(rho)

Wright (1997) in-situ density (kg/m^3) – term for term the Wright branch of eos_density_point, without the handle.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: t

Temperature (degC), salinity (PSU), pressure (Pa).

real(kind=wp), intent(in) :: s

Temperature (degC), salinity (PSU), pressure (Pa).

real(kind=wp), intent(in) :: p

Temperature (degC), salinity (PSU), pressure (Pa).

Return Value real(kind=wp)


Called by

proc~~wright_rho~~CalledByGraph proc~wright_rho wright_rho proc~boole_dpa_intz_layer_wright boole_dpa_intz_layer_wright proc~boole_dpa_intz_layer_wright->proc~wright_rho proc~boole_dpa_face_wright boole_dpa_face_wright proc~boole_dpa_face_wright->proc~boole_dpa_intz_layer_wright proc~compute_fv_mom6_reconstruct_impl compute_fv_mom6_reconstruct_impl proc~compute_fv_mom6_reconstruct_impl->proc~boole_dpa_intz_layer_wright proc~compute_fv_mom6_reconstruct_impl->proc~boole_dpa_face_wright proc~ocean_pressure_force_compute ocean_pressure_force_compute proc~ocean_pressure_force_compute->proc~compute_fv_mom6_reconstruct_impl proc~run_stage run_stage proc~run_stage->proc~ocean_pressure_force_compute proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_pressure_force_compute proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: T_sq
real(kind=wp), private :: alpha_0
real(kind=wp), private :: lambda
real(kind=wp), private :: p_0
real(kind=wp), private :: p_plus_p0

Source Code

   pure function wright_rho(t, s, p) result(rho)
      !$acc routine seq
      !! Wright (1997) in-situ density (kg/m^3) -- term for term the
      !! Wright branch of `eos_density_point`, without the handle.
      real(wp), intent(in) :: t, s, p
         !! Temperature (degC), salinity (PSU), pressure (Pa).
      real(wp) :: rho

      real(wp) :: T_sq, alpha_0, p_0, lambda, p_plus_p0

      T_sq = t*t
      alpha_0 = WRIGHT_A0 + WRIGHT_A1*t + WRIGHT_A2*s
      p_0 = WRIGHT_B0 + WRIGHT_B1*t + WRIGHT_B2*T_sq + WRIGHT_B3*T_sq*t + &
            WRIGHT_B4*s + WRIGHT_B5*s*t
      lambda = WRIGHT_C0 + WRIGHT_C1*t + WRIGHT_C2*T_sq + WRIGHT_C3*T_sq*t + &
               WRIGHT_C4*s + WRIGHT_C5*s*t
      p_plus_p0 = p + p_0
      rho = p_plus_p0/(lambda + alpha_0*p_plus_p0)
   end function wright_rho