private pure subroutine boundary_half_jump(h_self, h_nbr, dq_up, d)
Linear-exact half-jump across a BOUNDARY cell (k=1 or k=nz),
where a centred stencil has no second neighbour.
dq_up is the cell-mean increment toward the SURFACE across the
two cell centres (q(2)-q(1) at the bed, q(nz)-q(nz-1) at the
surface). The centres are (h_self + h_nbr)/2 apart, so the
per-metre slope is dq_up/((h_self+h_nbr)/2) and the half-jump
across this cell is
d = dq_up * h_self / (h_self + h_nbr)
giving edges q ± d that reproduce a profile linear in z EXACTLY,
for any thickness pair. The default closure — a PCM flatten —
does not: it leaves a first-order reconstruction error in the two
cells adjacent to the boundary. Same device (and same clamp) as
rdb_ocean_pgf_reconstruct :: boundary_edges_linear, which fixed
the mirror-image defect in the FV pressure-gradient quadrature.
Clamp |d| <= |dq_up|: since h_self/(h_self+h_nbr) < 1 it never
bites on a real thickness pair — it is armour against a degenerate
h_nbr <= 0.
Arguments
Type
Intent
Optional
Attributes
Name
real(kind=wp),
intent(in)
::
h_self
Thickness of the boundary cell itself.
real(kind=wp),
intent(in)
::
h_nbr
Thickness of its single interior neighbour.
real(kind=wp),
intent(in)
::
dq_up
Cell-mean increment toward the surface (neighbour -> self at
the surface cell, self -> neighbour at the bed cell).
real(kind=wp),
intent(out)
::
d
Half-jump across the boundary cell; edges are q ± d.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Source Code
pure subroutine boundary_half_jump(h_self,h_nbr,dq_up,d)!$acc routine seq!! Linear-exact half-jump across a BOUNDARY cell (k=1 or k=nz),!! where a centred stencil has no second neighbour.!!!! `dq_up` is the cell-mean increment toward the SURFACE across the!! two cell centres (`q(2)-q(1)` at the bed, `q(nz)-q(nz-1)` at the!! surface). The centres are `(h_self + h_nbr)/2` apart, so the!! per-metre slope is `dq_up/((h_self+h_nbr)/2)` and the half-jump!! across this cell is!!!! d = dq_up * h_self / (h_self + h_nbr)!!!! giving edges `q ± d` that reproduce a profile linear in z EXACTLY,!! for any thickness pair. The default closure — a PCM flatten —!! does not: it leaves a first-order reconstruction error in the two!! cells adjacent to the boundary. Same device (and same clamp) as!! `rdb_ocean_pgf_reconstruct :: boundary_edges_linear`, which fixed!! the mirror-image defect in the FV pressure-gradient quadrature.!!!! Clamp `|d| <= |dq_up|`: since `h_self/(h_self+h_nbr) < 1` it never!! bites on a real thickness pair — it is armour against a degenerate!! `h_nbr <= 0`.real(wp),intent(in)::h_self!! Thickness of the boundary cell itself.real(wp),intent(in)::h_nbr!! Thickness of its single interior neighbour.real(wp),intent(in)::dq_up!! Cell-mean increment toward the surface (neighbour -> self at!! the surface cell, self -> neighbour at the bed cell).real(wp),intent(out)::d!! Half-jump across the boundary cell; edges are `q ± d`.d=dq_up*h_self/max(h_self+h_nbr,H_NEGLECT)d=sign(min(abs(d),abs(dq_up)),d)end subroutine boundary_half_jump