sw_pe_cost_shape Function

public pure function sw_pe_cost_shape(tau) result(phi)

In-layer potential-energy-cost shape function Phi(tau) for the EPBL TKE ledger, tau = h/zeta the in-layer optical depth of a single band. It is the fraction of the pure-skin PE cost that homogenising an EXPONENTIALLY distributed in-layer heating actually incurs (Paulson & Simpson 1977 profile; the EPBL energetics of Reichl & Hallberg 2018):

Phi(tau) = [ tau·(1+e^-tau) - 2·(1-e^-tau) ] / [ tau·(1-e^-tau) ]

Limits: Phi(0) = 0 (heating already uniform through the layer ⇒ homogenising it costs nothing) and Phi(∞) = 1 (all heating at the layer top ⇒ full skin cost, recovering Roundabout’s existing ctke_sfc skin form exactly). The closed form is 0/0 as tau -> 0 and cancels catastrophically for small tau; a thin layer (h << zeta2 = 23 m) is the COMMON case, so the Taylor branch Phi ≈ (tau/6)·(1 - tau²/60) is mandatory below the tau = 1e-2 seam. !$acc routine seq for cross-module device calls (the EPBL prep sweep).

Arguments

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

Return Value real(kind=wp)


Called by

proc~~sw_pe_cost_shape~~CalledByGraph proc~sw_pe_cost_shape sw_pe_cost_shape proc~epbl_column_kernel epbl_column_kernel proc~epbl_column_kernel->proc~sw_pe_cost_shape proc~epbl_compute epbl_compute proc~epbl_compute->proc~epbl_column_kernel proc~vmix_apply_in_stage vmix_apply_in_stage proc~vmix_apply_in_stage->proc~epbl_compute proc~run_stage run_stage proc~run_stage->proc~vmix_apply_in_stage proc~run_stage_split run_stage_split proc~run_stage_split->proc~vmix_apply_in_stage 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, parameter :: C1_6 = 1.0_wp/6.0_wp
real(kind=wp), private, parameter :: C1_60 = 1.0_wp/60.0_wp
real(kind=wp), private, parameter :: TAU_TAYLOR = 1.0e-2_wp
real(kind=wp), private :: em1

Source Code

   pure function sw_pe_cost_shape(tau) result(phi)
      !! In-layer potential-energy-cost shape function `Phi(tau)` for the
      !! EPBL TKE ledger, `tau = h/zeta` the in-layer optical depth of a
      !! single band.  It is the fraction of the pure-skin PE cost that
      !! homogenising an EXPONENTIALLY distributed in-layer heating
      !! actually incurs (Paulson & Simpson 1977 profile; the EPBL
      !! energetics of Reichl & Hallberg 2018):
      !!
      !!   Phi(tau) = [ tau·(1+e^-tau) - 2·(1-e^-tau) ] / [ tau·(1-e^-tau) ]
      !!
      !! Limits: `Phi(0) = 0` (heating already uniform through the layer
      !! ⇒ homogenising it costs nothing) and `Phi(∞) = 1` (all heating
      !! at the layer top ⇒ full skin cost, recovering Roundabout's existing
      !! `ctke_sfc` skin form exactly).  The closed form is `0/0` as
      !! `tau -> 0` and cancels catastrophically for small `tau`; a thin
      !! layer (`h << zeta2 = 23 m`) is the COMMON case, so the Taylor
      !! branch `Phi ≈ (tau/6)·(1 - tau²/60)` is mandatory below the
      !! `tau = 1e-2` seam.  `!$acc routine seq` for cross-module device
      !! calls (the EPBL prep sweep).
      !$acc routine seq
      real(wp), intent(in) :: tau
      real(wp) :: phi
      real(wp) :: em1
      real(wp), parameter :: TAU_TAYLOR = 1.0e-2_wp
      real(wp), parameter :: C1_6 = 1.0_wp/6.0_wp
      real(wp), parameter :: C1_60 = 1.0_wp/60.0_wp
      if (tau <= TAU_TAYLOR) then
         phi = C1_6*tau*(1.0_wp - C1_60*tau*tau)
      else
         em1 = 1.0_wp - exp(-tau)
         phi = (tau*(1.0_wp + exp(-tau)) - 2.0_wp*em1)/(tau*em1)
      end if
   end function sw_pe_cost_shape