roquet_recon_dpa_intz Subroutine

public pure subroutine roquet_recon_dpa_intz(rho0, rho_ref, e_top, dz, t_t, t_b, t_mean, s_t, s_b, s_mean, parabolic, dpa, intz_dpa)

boole_dpa_intz_layer (the reconstruct-for-pressure in-layer 5-point Boole rule over a PLM / PPM T/S profile) specialised to Roquet SpV: the same five sub-points, weights and summation order, with the density 1/SV from this module’s copy of the SpV value (rdb_roq_ts_coeffs + rdb_roq_spv_p, rdb_roquet_spv.inc) – no eos_t handle, no per-point variant dispatch, and a body the compiler inlines into the kernel. T and S vary through the layer, so unlike roquet_pcm_dpa_intz there is no (T, S) hoist: each point is a full EOS evaluation.

Arguments

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

Pressure-estimate density / anomaly reference (kg/m^3).

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

Pressure-estimate density / anomaly reference (kg/m^3).

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

Shallower-interface height / layer thickness (m).

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

Shallower-interface height / layer thickness (m).

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

T / S top edge, bottom edge, layer mean.

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

T / S top edge, bottom edge, layer mean.

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

T / S top edge, bottom edge, layer mean.

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

T / S top edge, bottom edge, layer mean.

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

T / S top edge, bottom edge, layer mean.

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

T / S top edge, bottom edge, layer mean.

logical, intent(in) :: parabolic

.true. -> PPM curvature.

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

As boole_dpa_intz_layer.

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

As boole_dpa_intz_layer.


Calls

proc~~roquet_recon_dpa_intz~~CallsGraph proc~roquet_recon_dpa_intz roquet_recon_dpa_intz rdb_roq_spv_p rdb_roq_spv_p proc~roquet_recon_dpa_intz->rdb_roq_spv_p rdb_roq_ts_coeffs rdb_roq_ts_coeffs proc~roquet_recon_dpa_intz->rdb_roq_ts_coeffs

Called by

proc~~roquet_recon_dpa_intz~~CalledByGraph proc~roquet_recon_dpa_intz roquet_recon_dpa_intz proc~compute_fv_mom6_reconstruct_impl compute_fv_mom6_reconstruct_impl proc~compute_fv_mom6_reconstruct_impl->proc~roquet_recon_dpa_intz proc~roquet_recon_dpa_face roquet_recon_dpa_face proc~compute_fv_mom6_reconstruct_impl->proc~roquet_recon_dpa_face proc~roquet_recon_dpa_face->proc~roquet_recon_dpa_intz 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 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 :: gxrho
integer, private :: n
real(kind=wp), private :: p5
real(kind=wp), private :: r5(N_BOOLE)
real(kind=wp), private :: rho_anom
real(kind=wp), private :: s5
real(kind=wp), private :: s6
real(kind=wp), private :: sv0
real(kind=wp), private :: sv1
real(kind=wp), private :: sv2
real(kind=wp), private :: sv3
real(kind=wp), private :: t5
real(kind=wp), private :: t6
real(kind=wp), private :: wt_b
real(kind=wp), private :: wt_t

Source Code

   pure subroutine roquet_recon_dpa_intz(rho0, rho_ref, e_top, dz, &
                                         t_t, t_b, t_mean, s_t, s_b, s_mean, &
                                         parabolic, dpa, intz_dpa)
      !$acc routine seq
      !! `boole_dpa_intz_layer` (the reconstruct-for-pressure in-layer 5-point
      !! Boole rule over a PLM / PPM T/S profile) specialised to Roquet SpV:
      !! the same five sub-points, weights and summation order, with the
      !! density `1/SV` from this module's copy of the SpV value
      !! (`rdb_roq_ts_coeffs` + `rdb_roq_spv_p`, `rdb_roquet_spv.inc`) -- no
      !! `eos_t` handle, no per-point variant dispatch, and a body the
      !! compiler inlines into the kernel.  T and S vary through the layer,
      !! so unlike `roquet_pcm_dpa_intz` there is no (T, S) hoist: each point
      !! is a full EOS evaluation.
      real(wp), intent(in)  :: rho0, rho_ref
         !! Pressure-estimate density / anomaly reference (kg/m^3).
      real(wp), intent(in)  :: e_top, dz
         !! Shallower-interface height / layer thickness (m).
      real(wp), intent(in)  :: t_t, t_b, t_mean, s_t, s_b, s_mean
         !! T / S top edge, bottom edge, layer mean.
      logical, intent(in)   :: parabolic
         !! .true. -> PPM curvature.
      real(wp), intent(out) :: dpa, intz_dpa
         !! As `boole_dpa_intz_layer`.

      real(wp) :: gxrho, wt_t, wt_b, t6, s6, t5, s5, p5, rho_anom
      real(wp) :: sv0, sv1, sv2, sv3
      real(wp) :: r5(N_BOOLE)
      integer  :: n

      gxrho = GRAVITY*rho0

      ! PPM curvature (zero for PLM).
      t6 = 0.0_wp
      s6 = 0.0_wp
      if (parabolic) then
         t6 = 3.0_wp*(2.0_wp*t_mean - (t_t + t_b))
         s6 = 3.0_wp*(2.0_wp*s_mean - (s_t + s_b))
      end if

      !GCC$ unroll 5
      do n = 1, N_BOOLE
         wt_t = 0.25_wp*real(N_BOOLE - n, wp)   ! 1, .75, .5, .25, 0
         wt_b = 1.0_wp - wt_t
         t5 = wt_t*t_t + wt_b*t_b + t6*wt_t*wt_b
         s5 = wt_t*s_t + wt_b*s_b + s6*wt_t*wt_b
         p5 = -gxrho*(e_top - 0.25_wp*real(n - 1, wp)*dz)
         call rdb_roq_ts_coeffs(t5, s5, sv0, sv1, sv2, sv3)
         r5(n) = 1.0_wp/rdb_roq_spv_p(sv0, sv1, sv2, sv3, p5) - rho_ref
      end do

      rho_anom = (1.0_wp/90.0_wp)*(7.0_wp*(r5(1) + r5(5)) &
                                   + 32.0_wp*(r5(2) + r5(4)) + 12.0_wp*r5(3))
      dpa = GRAVITY*dz*rho_anom
      intz_dpa = 0.5_wp*GRAVITY*dz*dz*(rho_anom &
                                       - (1.0_wp/90.0_wp)*(16.0_wp*(r5(4) - r5(2)) + 7.0_wp*(r5(5) - r5(1))))
   end subroutine roquet_recon_dpa_intz