Appearance
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
- prism_probes_object
- build_stencils
- close_files
- initialize
- open_files
- sample_host
- save_history
- tent_weights
- label
- plane_axes
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
PROBES_SECTION_NAME | character(len=6) | parameter | Main section. |
ROW_FORMAT | character(len=*) | parameter | Format of the values of a history row. |
Derived Types
prism_probes_object
PRISM field probes: configuration, local stencils, history writer.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
probes_number | integer(kind=I4P) | Number of probes, points and plane probes. | |
points_number | integer(kind=I4P) | Number of single points (the first probes). | |
planes_number | integer(kind=I4P) | Number of planes (their probes follow the points). | |
save_every | integer(kind=I4P) | Saving cadence in iterations. | |
nv | integer(kind=I4P) | Number of sampled variables. | |
is_built | logical | Stencils built on the current grid. | |
output_basename | character(len=:) | allocatable | Basename of output files. |
point | real(kind=R8P) | allocatable | Probe points, grid units [3,probes_number]. |
point_input | real(kind=R8P) | allocatable | Probe points, input units [3,probes_number]. |
plane_axis | character(len=1) | allocatable | Normal axis of each plane, x/y/z [planes_number]. |
plane_abscissa | real(kind=R8P) | allocatable | Abscissa of each plane along its normal, input units. |
plane_n | integer(kind=I4P) | allocatable | Lattice of each plane, (n1,n2) [2,planes_number]. |
plane_first | integer(kind=I4P) | allocatable | First probe of each plane [planes_number+1]. |
unit | integer(kind=I4P) | allocatable | History file units (rank 0), points then planes. |
first | integer(kind=I4P) | allocatable | First local cell of each probe [probes_number+1]. |
cell | integer(kind=I4P) | allocatable | Local cells, (b,i,j,k) [4,entries]. |
weight | real(kind=R8P) | allocatable | Local cell weights, normalised [entries]. |
value | real(kind=R8P) | allocatable | Sampled values, local sums then global [nv,probes_number]. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
build_stencils | pass(self) | Build the local stencils on the current grid. |
close_files | pass(self) | Close the history files. |
initialize | pass(self) | Initialize the probes from the input file. |
label | pass(self) | Input name of a probe, for the messages. |
open_files | pass(self) | Open the history files and write their headers. |
sample_host | pass(self) | Sample the host fields (local sums). |
save_history | pass(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. | |
grid | type(grid_object) | in | Grid. | |
field | type(field_object) | in | Field (cell centres, steps). | |
ni | integer(kind=I4P) | in | Interior cells per block. | |
nj | integer(kind=I4P) | in | Interior cells per block. | |
nk | integer(kind=I4P) | in | Interior cells per block. | |
blocks_number | integer(kind=I4P) | in | Local blocks. |
Call graph
close_files
Close the history files.
fortran
subroutine close_files(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
output_basename | character(len=*) | in | Basename of output files. | |
grid | type(grid_object) | in | Grid, for the domain check. | |
L0 | real(kind=R8P) | in | optional | Adimensionalization 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. | |
q_name | type(string) | in | Names 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. | |
ngc | integer(kind=I4P) | in | Number of ghost cells. | |
q | real(kind=R8P) | in | Fields [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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | inout | Probes. | |
it | integer(kind=I4P) | in | Current iteration. | |
time | real(kind=R8P) | in | Current 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x | real(kind=R8P) | in | Point abscissa. | |
xc | real(kind=R8P) | in | Cell centres. | |
dx | real(kind=R8P) | in | Cell step. | |
is_null | logical | in | Null axis. | |
w | real(kind=R8P) | out | Weights. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_probes_object) | in | Probes. | |
p | integer(kind=I4P) | in | Probe. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
axis | character(len=1) | in | Normal axis. |
Call graph