Skip to content

adam_flume_diagnostics_object ​

ADAM, FLUME diagnostics class definition: conservation and div(B) histories.

Writes one row per save step to <output_basename>-conservation_history.dat: iteration, time and the volume integral of every conservative variable. MHD runs also write, on the same cadence, <output_basename>-divb_history.dat: iteration, time, max|div B|, sum |div B| dV and the maximum over the seam-local cells (issue #41, D-10, section 9). With divb_flux (GLM and EGLM, issue #68 A2) four columns follow: the D_flux norms (max, sum dV, seam-local max) and max(h |D_flux|) / max|B|, where D_flux is the divergence the cleaning acts on, that of the interface normal field B_n = F_psi / s of the scheme's own psi face fluxes (s = c_h^2 GLM, c_h EGLM), the coarse faces of the 2:1 seams taking the fine fluxes (the reflux). Rows are written as they come, nothing is accumulated in memory. The values are computed (and MPI-reduced) by the backends; only rank 0 writes. With self-gravity (issue #81) the conservation history gains two columns: the gravitational energy W = 1/2 sum rho Phi dV (Phi solved from the committed state) and E + W, the energy the scheme conserves.

Source: src/app/flume/common/adam_flume_diagnostics_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=11)parameterINI (config) file section name.

Derived Types ​

flume_diagnostics_object ​

FLUME diagnostics class definition: conservation history.

Components ​

NameTypeAttributesDescription
conservation_history_saveinteger(kind=I4P)Conservation history save cadence (<= 0: disabled).
ghost_poisonlogicalPoison the ghosts before each field write (verification, #65).
divb_fluxlogicalAdd the D_flux columns to the div(B) history (issue #68 A2).
conservation_unitinteger(kind=I4P)Conservation history file unit.
divb_unitinteger(kind=I4P)div(B) history file unit (MHD only).

Type-Bound Procedures ​

NameAttributesDescription
close_filepass(self)Close the history file.
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize diagnostics.
load_from_filepass(self)Load config from file.
open_filepass(self)Open the history file and write its header.
save_conservation_rowpass(self)Write one conservation history row.
save_divb_rowpass(self)Write one div(B) history row.

Subroutines ​

close_file ​

Close the history files.

fortran
subroutine close_file(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inoutDiagnostics.

Call graph

initialize ​

Initialize diagnostics.

fortran
subroutine initialize(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inoutDiagnostics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

load_from_file ​

Load config from file; every key is required.

fortran
subroutine load_from_file(self, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inoutDiagnostics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

open_file ​

Open the history files and write their headers (append, without header, on restart).

fortran
subroutine open_file(self, output_basename, q_name, is_restart, with_divb, with_self_gravity)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inoutDiagnostics.
output_basenamecharacter(len=*)inOutput files base name.
q_nametype(string)inConservative variables names.
is_restartlogicalinRestarted run flag.
with_divblogicalinOpen the div(B) history too (MHD).
with_self_gravitylogicalinoptionalAdd the W and E + W columns.

Call graph

save_conservation_row ​

Write one conservation history row (rank 0 only; integrals already MPI-reduced).

fortran
subroutine save_conservation_row(self, it, time, integrals)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inDiagnostics.
itinteger(kind=I4P)inTime iteration.
timereal(kind=R8P)inTime.
integralsreal(kind=R8P)inVolume integrals of the conservative variables.

Call graph

save_divb_row ​

Write one div(B) history row (rank 0 only; norms already MPI-reduced).

fortran
subroutine save_divb_row(self, it, time, norms)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inDiagnostics.
itinteger(kind=I4P)inTime iteration.
timereal(kind=R8P)inTime.
normsreal(kind=R8P)inmax|div B|, sum |div B| dV, seam-local max|div B|, and

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_diagnostics_object)inDiagnostics.

Call graph