ppm_limit_edges Subroutine

private pure subroutine ppm_limit_edges(q_m1, q_c, q_p1, ql_raw, qr_raw, q_t, q_b)

The PPM edge limiter of one interior layer: clip both interface estimates into the monotone bounds of the three adjacent means, flatten a local extremum to PCM, and apply the Colella & Woodward (1984) parabola limiter.

Arguments

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

Layer means of layers k-1, k, k+1.

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

Layer means of layers k-1, k, k+1.

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

Layer means of layers k-1, k, k+1.

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

Interface estimates at the layer’s deeper / shallower interface.

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

Interface estimates at the layer’s deeper / shallower interface.

real(kind=wp), intent(out) :: q_t

Limited top (shallower) / bottom (deeper) edge values.

real(kind=wp), intent(out) :: q_b

Limited top (shallower) / bottom (deeper) edge values.


Called by

proc~~ppm_limit_edges~~CalledByGraph proc~ppm_limit_edges ppm_limit_edges proc~ppm_edges_layer ppm_edges_layer proc~ppm_edges_layer->proc~ppm_limit_edges proc~compute_fv_mom6_reconstruct_impl compute_fv_mom6_reconstruct_impl proc~compute_fv_mom6_reconstruct_impl->proc~ppm_edges_layer 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 :: dq
real(kind=wp), private :: dq_l
real(kind=wp), private :: dq_r
real(kind=wp), private :: q6
real(kind=wp), private :: q_hi
real(kind=wp), private :: q_lo
real(kind=wp), private :: ql
real(kind=wp), private :: qr

Source Code

   pure subroutine ppm_limit_edges(q_m1, q_c, q_p1, ql_raw, qr_raw, q_t, q_b)
      !$acc routine seq
      !! The PPM edge limiter of one interior layer: clip both interface
      !! estimates into the monotone bounds of the three adjacent means,
      !! flatten a local extremum to PCM, and apply the Colella & Woodward
      !! (1984) parabola limiter.
      real(wp), intent(in)  :: q_m1, q_c, q_p1
         !! Layer means of layers k-1, k, k+1.
      real(wp), intent(in)  :: ql_raw, qr_raw
         !! Interface estimates at the layer's deeper / shallower interface.
      real(wp), intent(out) :: q_t, q_b
         !! Limited top (shallower) / bottom (deeper) edge values.

      real(wp) :: q_lo, q_hi, ql, qr, dq, dq_l, dq_r, q6

      q_lo = min(q_m1, q_c, q_p1)
      q_hi = max(q_m1, q_c, q_p1)
      ql = max(q_lo, min(q_hi, ql_raw))
      qr = max(q_lo, min(q_hi, qr_raw))
      dq = qr - ql
      dq_l = q_c - ql
      dq_r = qr - q_c
      if (dq_l*dq_r <= 0.0_wp) then
         ! Local extremum -> flatten to PCM.
         ql = q_c
         qr = q_c
      else
         q6 = 6.0_wp*q_c - 3.0_wp*(ql + qr)
         if (abs(q6) > abs(dq)) then
            if (q6*dq > 0.0_wp) then
               ql = 3.0_wp*q_c - 2.0_wp*qr
            else
               qr = 3.0_wp*q_c - 2.0_wp*ql
            end if
         end if
      end if
      q_b = ql     ! deeper edge
      q_t = qr     ! shallower edge
   end subroutine ppm_limit_edges