function compute_total_tracer_efp(hTr, areaT, nghost) result(total)
!! EFP twin of `compute_total_tracer`. See `compute_total_h_efp`
!! for the k-slab blocking design; ghost exclusion + extent clamping
!! copied verbatim from `compute_total_tracer`.
real(wp), intent(in) :: hTr(:, :, :)
real(wp), intent(in) :: areaT(:, :)
integer, intent(in) :: nghost
type(efp_t) :: total
integer :: i, j, k, nx, ny, nz, i_lo, i_hi, j_lo, j_hi
integer(int64) :: e1, e2, e3, e4, e5, e6, epoison
integer(int64) :: d1, d2, d3, d4, d5, d6, dpoison
integer(int64) :: slab_e(EFP_DIGITS)
real(real64) :: val
nx = min(size(hTr, 1), size(areaT, 1))
ny = min(size(hTr, 2), size(areaT, 2))
nz = size(hTr, 3)
i_lo = nghost + 1
i_hi = nx - nghost
j_lo = nghost + 1
j_hi = ny - nghost
call efp_summands_guard(i_hi - i_lo + 1, j_hi - j_lo + 1, "compute_total_tracer_efp")
total%v = 0_int64
total%poison = 0_int64
do k = 1, nz
e1 = 0_int64
e2 = 0_int64
e3 = 0_int64
e4 = 0_int64
e5 = 0_int64
e6 = 0_int64
epoison = 0_int64
!$acc parallel loop collapse(2) reduction(+:e1,e2,e3,e4,e5,e6,epoison) &
!$acc& private(val, d1, d2, d3, d4, d5, d6, dpoison) present(hTr, areaT)
do j = j_lo, j_hi
do i = i_lo, i_hi
val = real(hTr(i, j, k), real64)*real(areaT(i, j), real64)
call efp_decompose_impl(val, d1, d2, d3, d4, d5, d6, dpoison)
e1 = e1 + d1
e2 = e2 + d2
e3 = e3 + d3
e4 = e4 + d4
e5 = e5 + d5
e6 = e6 + d6
epoison = epoison + dpoison
end do
end do
slab_e = [e1, e2, e3, e4, e5, e6]
call efp_carry(slab_e)
total%v = total%v + slab_e
total%poison = total%poison + epoison
call efp_carry(total%v)
end do
end function compute_total_tracer_efp