Skip to content

adam_rk_object ​

ADAM, RK class definition.

Source: src/lib/common/adam_rk_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
RK_1character(len=13)parameterParameter of time scheme, Runge-Kutta 1.
RK_2character(len=13)parameterParameter of time scheme, Runge-Kutta 2.
RK_3character(len=13)parameterParameter of time scheme, Runge-Kutta 3.
RK_SSP_11character(len=18)parameterParameter of time scheme, Runge-Kutta SSP 11 (forward Euler).
RK_SSP_22character(len=18)parameterParameter of time scheme, Runge-Kutta SSP 22.
RK_SSP_33character(len=18)parameterParameter of time scheme, Runge-Kutta SSP 33.
RK_SSP_54character(len=18)parameterParameter of time scheme, Runge-Kutta SSP 54.
RK_YOSHIDAcharacter(len=19)parameterParameter of time scheme, Runge-Kutta Yoshida, symplectic 4.
INI_SECTION_NAMEcharacter(len=11)parameterINI (config) file section name containing configs.

Derived Types ​

rk_object ​

RK class definition.

Components ​

NameTypeAttributesDescription
schemecharacter(len=:)allocatableRK scheme.
nrkinteger(kind=I4P)Runge-Kutta stages number.
arkreal(kind=R8P)allocatableRunge-Kutta low storage alpha coefficients.
brkreal(kind=R8P)allocatableRunge-Kutta low storage beta coefficients.
crkreal(kind=R8P)allocatableRunge-Kutta low storage beta coefficients.
alphreal(kind=R8P)allocatableRunge-Kutta SSP alpha coefficients.
betareal(kind=R8P)allocatableRunge-Kutta SSP beta coefficients.
gammreal(kind=R8P)allocatableRunge-Kutta SSP gamma coefficients.
ssareal(kind=R8P)allocatableRunge-Kutta sympletic-splitting part A coefficients.
ssbreal(kind=R8P)allocatableRunge-Kutta sympletic-splitting part B coefficients.
q_rkreal(kind=R8P)allocatableField cell centered variables, RK stages.
blocks_zeroedinteger(kind=I4P)Block slots of q_rk zeroed so far (issue #45).
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.

Type-Bound Procedures ​

NameAttributesDescription
assign_stagepass(self)Assign q to RK stage.
compute_stagepass(self)Compute RK stage.
compute_stage_lspass(self)Compute RK stage, low storage scheme.
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize class.
initialize_stagespass(self)Initialize RK stages.
load_from_filepass(self)Load config from file.
update_qpass(self)Update RK q.

Subroutines ​

assign_stage ​

Assign q to RK stage.

fortran
subroutine assign_stage(self, field, s, q, phi)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inoutRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
sinteger(kind=I4P)inCurrent stage number.
qreal(kind=R8P)inConservative variables.
phireal(kind=R8P)inoptionalIB distance.

Call graph

compute_stage ​

Compute RK stage.

fortran
subroutine compute_stage(self, field, s, dt, phi)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inoutRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
sinteger(kind=I4P)inCurrent stage number.
dtreal(kind=R8P)inCurrent time step.
phireal(kind=R8P)inoptionalIB distance.

Call graph

compute_stage_ls ​

Compute RK stage, low storage scheme. The first (only) stage is assumed to be the previous time step q solution.

fortran
subroutine compute_stage_ls(self, field, s, dt, phi, dq, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
sinteger(kind=I4P)inCurrent RK stage.
dtreal(kind=R8P)inCurrent time step.
phireal(kind=R8P)inoptionalIB distance.
dqreal(kind=R8P)inConservative variables residuals.
qreal(kind=R8P)inoutConservative variables stage.

Call graph

initialize ​

Initialize class.

fortran
subroutine initialize(self, field, grid, file_parameters, scheme)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inoutRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)intargetGrid (sibling realm component, threaded in).
file_parameterstype(file_ini)inoptionalSimulation parameters ini file handler.
schemecharacter(len=*)inoptionalRunge-Kutta scheme.

Call graph

initialize_stages ​

Initialize RK stages: every stage starts the step as a copy of q in the interior cells.

A block slot is zeroed, ghost cells included, the first time it is active (issue #45). The stage updates write the interior only, and neither the ghost exchange (edge and corner ghosts on null axes) nor the alpha-cadence seam fill (it fills q only) writes every stage ghost cell, while the local ghost fill reads some of them as sources (8-cell restriction). q_rk is not initialized at allocation (zeroing the whole fill-the-node buffer would commit all of it), so those reads saw uninitialized memory (valgrind), zero only when the page happened to be fresh. Zeroing once, not every step, keeps the ghost values a previous step wrote and later steps read before rewriting them; never-written cells read zero, as in the FNL twin (q_rk_gpu is allocated zeroed).

fortran
subroutine initialize_stages(self, field, q)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inoutRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
qreal(kind=R8P)inConservative variables.

Call graph

load_from_file ​

Load config from file.

fortran
subroutine load_from_file(self, file_parameters, go_on_fail)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inoutRK object.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
go_on_faillogicalinoptionalGo on if load fails.

Call graph

update_q ​

Update RK q.

fortran
subroutine update_q(self, field, dt, phi, q, dq)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inRK object.
fieldtype(field_object)inField (sibling realm component, threaded in).
dtreal(kind=R8P)inCurrent time step.
phireal(kind=R8P)inoptionalIB distance.
qreal(kind=R8P)inoutConservative variables.
dqreal(kind=R8P)inoutoptionalConservative variables residuals.

Call graph

Functions ​

rk_stored_stages_number ​

Return the number of block-sized stage fields rk_object%initialize allocates for a scheme.

Low-storage schemes keep one stage, SSP schemes keep all nrk stages, Yoshida keeps none. It lets an app size its memory budget (realm_object%initialize(fields_number=...)) before the RK object exists; the SSP values must match the nrk set in initialize. An unknown scheme returns -1.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function rk_stored_stages_number(scheme) result(stages_number)

Arguments

NameTypeIntentAttributesDescription
schemecharacter(len=*)inRunge-Kutta scheme name.

Call graph

description ​

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(rk_object)inRK object.

Call graph