pure subroutine fill_ghost_north_res(hTr, h_layer, tres_n, &
nx_total, ny_total, nz, &
j_n, i0, i1, nghost, it, n_tr)
!! Reservoir-based ghost fill, north edge.
integer, intent(in) :: nx_total, ny_total, nz, nghost, it, n_tr
real(wp), intent(inout) :: hTr(nx_total, ny_total, nz)
real(wp), intent(in) :: h_layer(nx_total, ny_total, nz)
real(wp), intent(in) :: tres_n(nx_total, nz, n_tr)
integer, intent(in) :: j_n, i0, i1
integer :: i, k, g
real(wp) :: hTr_bc
do concurrent(k=1:nz, i=i0:i1, g=1:nghost) local(hTr_bc)
hTr_bc = tres_n(i, k, it)*h_layer(i, ny_total - g + 1, k)
hTr(i, ny_total - g + 1, k) = hTr_bc
end do
end subroutine fill_ghost_north_res