Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
The radial coordinate map, from the logical coordinate s to the physical
radius r, and its inverse.
These are the host-side definition of the map a LOG_RADIUS build uses,
and the one place it is written down:
log_r0 == 0 : r = exp(s) (s = ln(r))
log_r0 > 0 : r = sign(s)r0(exp(|s|) - 1) (s = ln(1 + r/r0))
The offset form is the one that reaches the axis. Its pivot is deliberate:
s = 0 corresponds to r = 0 exactly, so the map is odd, and the mesh in
the ghost layer beyond a cylindrical axis is the exact mirror of the mesh
inside it. That is what the pole copy in getbc assumes when it fills ghost
cell j from interior cell j of the block half a revolution away - the two
have to occupy mirrored volumes, or the copied cell average belongs to a
cell of a different size. The naive map r = exp(s) - r0 is not odd:
its ghost cells shrink outward while the cells they mirror grow, and the
first ghost cell is then misplaced by several percent of a cell width.
The odd branch is only ever taken in that ghost layer; s >= 0 everywhere
in the physical domain of an offset build. Device code that only ever
sees the domain therefore uses the cheaper equivalent
r = log_ra*exp(s) + log_rb instead of calling these.
A case's mod_usr should use these rather than writing exp/log by hand:
xprobmin1 and xprobmax1 hold the logical radial bounds in a LOG_RADIUS
build, so r_of_s is how a case recovers a physical radius from them.
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.
Source Code
pure elemental function r_of_s(s)result(r)use mod_global_parametersdouble precision,intent(in)::sdouble precision::rif(log_r0>zero)thenr=dsign(one,s)*log_r0*(dexp(dabs(s))-one)elser=dexp(s)end if end function r_of_s