weno7_recon Function

public pure function weno7_recon(q1, q2, q3, q4, q5, q6, q7, q8, adv_vel) result(qf)

7th-order WENO-Z reconstruction (MOM6 weno_seven_h_weight_reconstruction) of an 8-point corner stencil onto the face between the two central points q4,q5, upwind-biased on adv_vel. Four 4-point candidates blended by WENO-Z (ideal weights 4/35, 18/35, 12/35, 1/35; Balsara-Shu smoothness; tau = |(b0-b3) + 3(b1-b2)|). Applied to the absolute vorticity directly. Radius 4 (nghost>=4).

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) :: q7
real(kind=wp), intent(in) :: q8
real(kind=wp), intent(in) :: adv_vel

Return Value real(kind=wp)


Calls

proc~~weno7_recon~~CallsGraph proc~weno7_recon weno7_recon proc~beta7_0 beta7_0 proc~weno7_recon->proc~beta7_0 proc~beta7_1 beta7_1 proc~weno7_recon->proc~beta7_1 proc~beta7_2 beta7_2 proc~weno7_recon->proc~beta7_2 proc~beta7_3 beta7_3 proc~weno7_recon->proc~beta7_3 proc~fac_weno fac_weno proc~weno7_recon->proc~fac_weno

Called by

proc~~weno7_recon~~CalledByGraph proc~weno7_recon weno7_recon proc~coriolis_adv_compute_tendencies_sadourny coriolis_adv_compute_tendencies_sadourny proc~coriolis_adv_compute_tendencies_sadourny->proc~weno7_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 :: b3
real(kind=wp), private :: c0
real(kind=wp), private :: c1
real(kind=wp), private :: c2
real(kind=wp), private :: c3
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
real(kind=wp), private :: w3

Source Code

   pure function weno7_recon(q1, q2, q3, q4, q5, q6, q7, q8, adv_vel) result(qf)
      !! 7th-order WENO-Z reconstruction (MOM6 `weno_seven_h_weight_reconstruction`)
      !! of an 8-point corner stencil onto the face between the two central points
      !! `q4,q5`, upwind-biased on `adv_vel`.  Four 4-point candidates blended by
      !! WENO-Z (ideal weights 4/35, 18/35, 12/35, 1/35; Balsara-Shu smoothness;
      !! tau = |(b0-b3) + 3(b1-b2)|).  Applied to the absolute vorticity directly.
      !! Radius 4 (nghost>=4).
      !$acc routine seq
      real(wp), intent(in) :: q1, q2, q3, q4, q5, q6, q7, q8
      real(wp), intent(in) :: adv_vel
      real(wp) :: qf
      real(wp) :: c0, c1, c2, c3, b0, b1, b2, b3, tau, w0, w1, w2, w3, sinv

      if (adv_vel > 0.0_wp) then
         c0 = (6.0_wp*q4 + 26.0_wp*q5 - 10.0_wp*q6 + 2.0_wp*q7)/24.0_wp
         b0 = beta7_0(q4, q5, q6, q7)
         c1 = (-2.0_wp*q3 + 14.0_wp*q4 + 14.0_wp*q5 - 2.0_wp*q6)/24.0_wp
         b1 = beta7_1(q3, q4, q5, q6)
         c2 = (2.0_wp*q2 - 10.0_wp*q3 + 26.0_wp*q4 + 6.0_wp*q5)/24.0_wp
         b2 = beta7_2(q2, q3, q4, q5)
         c3 = (-6.0_wp*q1 + 26.0_wp*q2 - 46.0_wp*q3 + 50.0_wp*q4)/24.0_wp
         b3 = beta7_3(q1, q2, q3, q4)
      else
         c0 = (6.0_wp*q5 + 26.0_wp*q4 - 10.0_wp*q3 + 2.0_wp*q2)/24.0_wp
         b0 = beta7_0(q5, q4, q3, q2)
         c1 = (-2.0_wp*q6 + 14.0_wp*q5 + 14.0_wp*q4 - 2.0_wp*q3)/24.0_wp
         b1 = beta7_1(q6, q5, q4, q3)
         c2 = (2.0_wp*q7 - 10.0_wp*q6 + 26.0_wp*q5 + 6.0_wp*q4)/24.0_wp
         b2 = beta7_2(q7, q6, q5, q4)
         c3 = (-6.0_wp*q8 + 26.0_wp*q7 - 46.0_wp*q6 + 50.0_wp*q5)/24.0_wp
         b3 = beta7_3(q8, q7, q6, q5)
      end if

      tau = abs((b0 - b3) + 3.0_wp*(b1 - b2))
      w0 = (4.0_wp/35.0_wp)*fac_weno(tau, b0)
      w1 = (18.0_wp/35.0_wp)*fac_weno(tau, b1)
      w2 = (12.0_wp/35.0_wp)*fac_weno(tau, b2)
      w3 = (1.0_wp/35.0_wp)*fac_weno(tau, b3)
      sinv = 1.0_wp/((w0 + w1) + (w2 + w3))
      qf = ((w0*c0) + (w1*c1) + (w2*c2) + (w3*c3))*sinv
   end function weno7_recon