redi_ppm_edge Function

private pure function redi_ppm_edge(hkm1, hk, hkp1, hkp2, ak, akp1, pk, pkp1, h_neglect) result(e)

PPM quasi-fourth-order edge value at interface k+1/2 (MOM6 ppm_edge; Colella & Woodward 1984 eq. 1.6).

Arguments

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

widths of cells k-1..k+2

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

widths of cells k-1..k+2

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

widths of cells k-1..k+2

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

widths of cells k-1..k+2

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

cell averages k, k+1

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

cell averages k, k+1

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

PLM slopes k, k+1

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

PLM slopes k, k+1

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

negligible thickness floor

Return Value real(kind=wp)


Called by

proc~~redi_ppm_edge~~CalledByGraph proc~redi_ppm_edge redi_ppm_edge proc~redi_interface_scalar redi_interface_scalar proc~redi_interface_scalar->proc~redi_ppm_edge proc~redi_build_column redi_build_column proc~redi_build_column->proc~redi_interface_scalar proc~redi_tracer_column redi_tracer_column proc~redi_tracer_column->proc~redi_interface_scalar proc~redi_face_coeffs redi_face_coeffs proc~redi_face_coeffs->proc~redi_build_column proc~redi_face_flux redi_face_flux proc~redi_face_flux->proc~redi_tracer_column proc~redi_apply_flux_impl redi_apply_flux_impl proc~redi_apply_flux_impl->proc~redi_face_flux proc~redi_calc_coeffs_x redi_calc_coeffs_x proc~redi_calc_coeffs_x->proc~redi_face_coeffs proc~redi_calc_coeffs_y redi_calc_coeffs_y proc~redi_calc_coeffs_y->proc~redi_face_coeffs proc~redi_apply_flux redi_apply_flux proc~redi_apply_flux->proc~redi_apply_flux_impl proc~redi_calc_coeffs redi_calc_coeffs proc~redi_calc_coeffs->proc~redi_calc_coeffs_x proc~redi_calc_coeffs->proc~redi_calc_coeffs_y

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: f1
real(kind=wp), private :: f2
real(kind=wp), private :: f3
real(kind=wp), private :: f4
real(kind=wp), private :: r_2hk_hkp1
real(kind=wp), private :: r_hk_2hkp1
real(kind=wp), private :: r_hk_hkp1

Source Code

   pure function redi_ppm_edge(hkm1, hk, hkp1, hkp2, ak, akp1, pk, pkp1, h_neglect) result(e)
      !$acc routine seq
      real(wp), intent(in) :: hkm1, hk, hkp1, hkp2  !! widths of cells k-1..k+2
      real(wp), intent(in) :: ak, akp1              !! cell averages k, k+1
      real(wp), intent(in) :: pk, pkp1              !! PLM slopes k, k+1
      real(wp), intent(in) :: h_neglect             !! negligible thickness floor
      real(wp) :: e
      real(wp) :: r_hk_hkp1, r_2hk_hkp1, r_hk_2hkp1
      real(wp) :: f1, f2, f3, f4

      r_hk_hkp1 = hk + hkp1
      if (r_hk_hkp1 <= 0.0_wp) then
         e = 0.5_wp*(ak + akp1)
         return
      end if
      r_hk_hkp1 = 1.0_wp/r_hk_hkp1
      if (hk < hkp1) then
         e = ak + (hk*r_hk_hkp1)*(akp1 - ak)
      else
         e = akp1 + (hkp1*r_hk_hkp1)*(ak - akp1)
      end if

      r_2hk_hkp1 = 1.0_wp/((2.0_wp*hk + hkp1) + h_neglect)
      r_hk_2hkp1 = 1.0_wp/((hk + 2.0_wp*hkp1) + h_neglect)
      f1 = 1.0_wp/((hk + hkp1) + (hkm1 + hkp2))
      f2 = 2.0_wp*(hkp1*hk)*r_hk_hkp1* &
           ((hkm1 + hk)*r_2hk_hkp1 - (hkp2 + hkp1)*r_hk_2hkp1)
      f3 = hk*(hkm1 + hk)*r_2hk_hkp1
      f4 = hkp1*(hkp1 + hkp2)*r_hk_2hkp1

      e = e + f1*(f2*(akp1 - ak) - (f3*pkp1 - f4*pk))
   end function redi_ppm_edge