weno5_recon Function

public pure function weno5_recon(q1, q2, q3, q4, q5, q6, adv_vel) result(qf)

5th-order WENO-Z reconstruction (MOM6 weno_five_h_weight_reconstruction) of a 6-point corner stencil onto the face between the two central points q3,q4, upwind-biased on adv_vel. Three 3-point candidates blended by WENO-Z (ideal weights 3/10, 3/5, 1/10; tau = |b0-b2|). Applied to the absolute vorticity directly (see weno3_recon). Radius 3 (nghost>=3).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: q1
real(kind=wp), intent(in) :: q2
real(kind=wp), intent(in) :: q3
real(kind=wp), intent(in) :: q4
real(kind=wp), intent(in) :: q5
real(kind=wp), intent(in) :: q6
real(kind=wp), intent(in) :: adv_vel

Return Value real(kind=wp)


Calls

proc~~weno5_recon~~CallsGraph proc~weno5_recon weno5_recon proc~beta5_0 beta5_0 proc~weno5_recon->proc~beta5_0 proc~beta5_1 beta5_1 proc~weno5_recon->proc~beta5_1 proc~beta5_2 beta5_2 proc~weno5_recon->proc~beta5_2 proc~fac_weno fac_weno proc~weno5_recon->proc~fac_weno

Called by

proc~~weno5_recon~~CalledByGraph proc~weno5_recon weno5_recon proc~coriolis_adv_compute_tendencies_sadourny coriolis_adv_compute_tendencies_sadourny proc~coriolis_adv_compute_tendencies_sadourny->proc~weno5_recon proc~coriolis_adv_compute_tendencies coriolis_adv_compute_tendencies proc~coriolis_adv_compute_tendencies->proc~coriolis_adv_compute_tendencies_sadourny proc~run_stage run_stage proc~run_stage->proc~coriolis_adv_compute_tendencies proc~run_stage_split run_stage_split proc~run_stage_split->proc~coriolis_adv_compute_tendencies 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 proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: b0
real(kind=wp), private :: b1
real(kind=wp), private :: b2
real(kind=wp), private :: c0
real(kind=wp), private :: c1
real(kind=wp), private :: c2
real(kind=wp), private :: sinv
real(kind=wp), private :: tau
real(kind=wp), private :: w0
real(kind=wp), private :: w1
real(kind=wp), private :: w2

Source Code

   pure function weno5_recon(q1, q2, q3, q4, q5, q6, adv_vel) result(qf)
      !! 5th-order WENO-Z reconstruction (MOM6 `weno_five_h_weight_reconstruction`)
      !! of a 6-point corner stencil onto the face between the two central points
      !! `q3,q4`, upwind-biased on `adv_vel`.  Three 3-point candidates blended by
      !! WENO-Z (ideal weights 3/10, 3/5, 1/10; tau = |b0-b2|).  Applied to the
      !! absolute vorticity directly (see `weno3_recon`).  Radius 3 (nghost>=3).
      !$acc routine seq
      real(wp), intent(in) :: q1, q2, q3, q4, q5, q6
      real(wp), intent(in) :: adv_vel
      real(wp) :: qf
      real(wp) :: c0, c1, c2, b0, b1, b2, tau, w0, w1, w2, sinv

      if (adv_vel > 0.0_wp) then
         c0 = (2.0_wp*q3 + 5.0_wp*q4 - q5)/6.0_wp
         b0 = beta5_0(q3, q4, q5)
         c1 = (-q2 + 5.0_wp*q3 + 2.0_wp*q4)/6.0_wp
         b1 = beta5_1(q2, q3, q4)
         c2 = (2.0_wp*q1 - 7.0_wp*q2 + 11.0_wp*q3)/6.0_wp
         b2 = beta5_2(q1, q2, q3)
      else
         c0 = (2.0_wp*q4 + 5.0_wp*q3 - q2)/6.0_wp
         b0 = beta5_0(q4, q3, q2)
         c1 = (-q5 + 5.0_wp*q4 + 2.0_wp*q3)/6.0_wp
         b1 = beta5_1(q5, q4, q3)
         c2 = (2.0_wp*q6 - 7.0_wp*q5 + 11.0_wp*q4)/6.0_wp
         b2 = beta5_2(q6, q5, q4)
      end if

      tau = abs(b0 - b2)
      w0 = 0.3_wp*fac_weno(tau, b0)
      w1 = 0.6_wp*fac_weno(tau, b1)
      w2 = 0.1_wp*fac_weno(tau, b2)
      sinv = 1.0_wp/((w0 + w1) + w2)
      qf = ((w0*c0) + (w1*c1) + (w2*c2))*sinv
   end function weno5_recon