Skip to content

adam_prism_probes_object ​

ADAM, PRISM field probes: time histories of the fields at fixed points and on planes of points.

The input is optional: without a [probes] section, or with neither points nor planes, there are no probes.

ini
[probes]
save_every = 5                    ; cadence in iterations (> 0), the last step is always saved
point_1    = -0.04 0.0 0.0        ; a probe at x y z
point_2    = 0.0 0.01 0.0
plane_1    = x 0.4364 48 48       ; a plane of probes normal to x at x = 0.4364: the centres of a uniform 48 x 48
                                  ; lattice over the domain extent along the other two axes (y first, then z)

Coordinates are in the units of the [grid] extents (divided by L0 in an adimensional model, as the grid). The keys point_N and plane_N are numbered from 1 without gaps (the first missing number ends the list). The plane lattice spans the whole domain along its two axes: with n equal to the cells of the grid along an axis its points are the cell centres of the uniform grid; a plane normal to y runs over (x, z), normal to z over (x, y). Each probe samples the whole q by trilinear interpolation, written as tent weights on the cell centres, w = prod_d max(0, 1 - |x_d - xc_d| / dx_d) (null axes excluded), the weights of the domain-center B diagnostic. Every rank sums the cells of its own blocks and a reduction to rank 0 recombines the interpolation across blocks and ranks: no ghost cell is read. The weights are normalised by their global sum, so within half a cell of the domain boundary, periodic faces included, the interpolation uses the interior cells only. The stencils (local cells and weights) are built once on the current grid by build_stencils; a regrid must rebuild them.

Output, rank 0 only: one file per point, <basename>-probe_NN.dat (one row per save: it, time, the variables), and one file per plane, <basename>-plane_NN.dat (per save, one row per probe of the plane: it, time, i, j, the variables, i running fastest), NN with at least two digits. The rows are not flushed: a flush per file and per save costs a file-system round trip each (on a shared file system with thousands of files, seconds to tens of seconds per save, with every rank waiting for rank 0). The runtime buffers reach the files when full and at close_files; after a crash the rows still buffered are lost. The former input, probes_number and one [probe_N] section per probe, is refused.

Source: src/app/prism/common/adam_prism_probes_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
PROBES_SECTION_NAMEcharacter(len=6)parameterMain section.
ROW_FORMATcharacter(len=*)parameterFormat of the values of a history row.

Derived Types ​

prism_probes_object ​

PRISM field probes: configuration, local stencils, history writer.

Components ​

NameTypeAttributesDescription
probes_numberinteger(kind=I4P)Number of probes, points and plane probes.
points_numberinteger(kind=I4P)Number of single points (the first probes).
planes_numberinteger(kind=I4P)Number of planes (their probes follow the points).
save_everyinteger(kind=I4P)Saving cadence in iterations.
nvinteger(kind=I4P)Number of sampled variables.
is_builtlogicalStencils built on the current grid.
output_basenamecharacter(len=:)allocatableBasename of output files.
pointreal(kind=R8P)allocatableProbe points, grid units [3,probes_number].
point_inputreal(kind=R8P)allocatableProbe points, input units [3,probes_number].
plane_axischaracter(len=1)allocatableNormal axis of each plane, x/y/z [planes_number].
plane_abscissareal(kind=R8P)allocatableAbscissa of each plane along its normal, input units.
plane_ninteger(kind=I4P)allocatableLattice of each plane, (n1,n2) [2,planes_number].
plane_firstinteger(kind=I4P)allocatableFirst probe of each plane [planes_number+1].
unitinteger(kind=I4P)allocatableHistory file units (rank 0), points then planes.
firstinteger(kind=I4P)allocatableFirst local cell of each probe [probes_number+1].
cellinteger(kind=I4P)allocatableLocal cells, (b,i,j,k) [4,entries].
weightreal(kind=R8P)allocatableLocal cell weights, normalised [entries].
valuereal(kind=R8P)allocatableSampled values, local sums then global [nv,probes_number].

Type-Bound Procedures ​

NameAttributesDescription
build_stencilspass(self)Build the local stencils on the current grid.
close_filespass(self)Close the history files.
initializepass(self)Initialize the probes from the input file.
labelpass(self)Input name of a probe, for the messages.
open_filespass(self)Open the history files and write their headers.
sample_hostpass(self)Sample the host fields (local sums).
save_historypass(self)Reduce the local sums and write the history rows.

Subroutines ​

build_stencils ​

Build the local stencils on the current grid; collective (normalises the weights by their global sum).

fortran
subroutine build_stencils(self, grid, field, ni, nj, nk, blocks_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.
gridtype(grid_object)inGrid.
fieldtype(field_object)inField (cell centres, steps).
niinteger(kind=I4P)inInterior cells per block.
njinteger(kind=I4P)inInterior cells per block.
nkinteger(kind=I4P)inInterior cells per block.
blocks_numberinteger(kind=I4P)inLocal blocks.

Call graph

close_files ​

Close the history files.

fortran
subroutine close_files(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.

Call graph

initialize ​

Initialize the probes from the input file; the [probes] section is optional (absent = no probes).

fortran
subroutine initialize(self, file_parameters, output_basename, grid, L0)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
output_basenamecharacter(len=*)inBasename of output files.
gridtype(grid_object)inGrid, for the domain check.
L0real(kind=R8P)inoptionalAdimensionalization length, as the grid's.

Call graph

open_files ​

Open the history files (rank 0) and write their headers.

fortran
subroutine open_files(self, q_name)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.
q_nametype(string)inNames of the sampled variables.

Call graph

sample_host ​

Sample the host fields: local weighted sums of the stencil cells.

fortran
subroutine sample_host(self, ngc, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.
ngcinteger(kind=I4P)inNumber of ghost cells.
qreal(kind=R8P)inFields [nv,ni,nj,nk,nb], with ghosts.

Call graph

save_history ​

Reduce the local sums to rank 0 and write the history rows (one per point, one per plane probe); collective.

fortran
subroutine save_history(self, it, time)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inoutProbes.
itinteger(kind=I4P)inCurrent iteration.
timereal(kind=R8P)inCurrent time.

Call graph

tent_weights ​

1-D tent weights of the cell centres xc at x; a null axis weighs every cell 1.

Attributes: pure

fortran
subroutine tent_weights(x, xc, dx, is_null, w)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inPoint abscissa.
xcreal(kind=R8P)inCell centres.
dxreal(kind=R8P)inCell step.
is_nulllogicalinNull axis.
wreal(kind=R8P)outWeights.

Call graph

Functions ​

label ​

Input name of probe p: point_N, or plane_N (i,j).

Attributes: pure

Returns: character(len=:)

fortran
function label(self, p) result(name)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_probes_object)inProbes.
pinteger(kind=I4P)inProbe.

Call graph

plane_axes ​

Axes of a plane: its normal, then the first and the second lattice axes.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function plane_axes(axis) result(a)

Arguments

NameTypeIntentAttributesDescription
axischaracter(len=1)inNormal axis.

Call graph