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.
Return a block's whole geometry - positions and metrics alike - from the
device to the host, for every grid the host is about to read.
This is the output-time counterpart of sync_positions_host: saveamrfile
calls it in the same place it pulls back bg%w, which covers the log, the
snapshot, the slices, the collapsed views and autoconvert, and the
standalone convert path does the same before generate_plotfile.
The fetch is unconditional and covers the whole grid in one pass, on
purpose. Remembering "the host is already up to date" in a flag cannot be
made honest, because the geometry is per block: any such flag would have
to be cleared after refreshing whatever set of blocks happened to be
listed at the time, and the next regrid or selectgrids can put a block
that was not in that set straight back in front of host code. Doing every
grid at once also keeps this to a few update directives per block rather
than paying the per-call overhead once per reader.
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
subroutine sync_geometry_host()use mod_global_parametersinteger::iigrid! Index igrids(iigrid) directly rather than through a local igrid: a! variable whose only uses are inside GPU directives looks dead to the! Fortran front end, the assignment to it is dropped, and the update then! silently targets the wrong block. sync_positions_host below is written! the same way for the same reason.do iigrid=1,igridstailend do end subroutine sync_geometry_host