Appearance
adam_rk_object
ADAM, RK class definition.
Source: src/lib/common/adam_rk_object.F90
Dependencies
Contents
- rk_object
- assign_stage
- compute_stage
- compute_stage_ls
- initialize
- initialize_stages
- load_from_file
- update_q
- rk_stored_stages_number
- description
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
RK_1 | character(len=13) | parameter | Parameter of time scheme, Runge-Kutta 1. |
RK_2 | character(len=13) | parameter | Parameter of time scheme, Runge-Kutta 2. |
RK_3 | character(len=13) | parameter | Parameter of time scheme, Runge-Kutta 3. |
RK_SSP_11 | character(len=18) | parameter | Parameter of time scheme, Runge-Kutta SSP 11 (forward Euler). |
RK_SSP_22 | character(len=18) | parameter | Parameter of time scheme, Runge-Kutta SSP 22. |
RK_SSP_33 | character(len=18) | parameter | Parameter of time scheme, Runge-Kutta SSP 33. |
RK_SSP_54 | character(len=18) | parameter | Parameter of time scheme, Runge-Kutta SSP 54. |
RK_YOSHIDA | character(len=19) | parameter | Parameter of time scheme, Runge-Kutta Yoshida, symplectic 4. |
INI_SECTION_NAME | character(len=11) | parameter | INI (config) file section name containing configs. |
Derived Types
rk_object
RK class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
scheme | character(len=:) | allocatable | RK scheme. |
nrk | integer(kind=I4P) | Runge-Kutta stages number. | |
ark | real(kind=R8P) | allocatable | Runge-Kutta low storage alpha coefficients. |
brk | real(kind=R8P) | allocatable | Runge-Kutta low storage beta coefficients. |
crk | real(kind=R8P) | allocatable | Runge-Kutta low storage beta coefficients. |
alph | real(kind=R8P) | allocatable | Runge-Kutta SSP alpha coefficients. |
beta | real(kind=R8P) | allocatable | Runge-Kutta SSP beta coefficients. |
gamm | real(kind=R8P) | allocatable | Runge-Kutta SSP gamma coefficients. |
ssa | real(kind=R8P) | allocatable | Runge-Kutta sympletic-splitting part A coefficients. |
ssb | real(kind=R8P) | allocatable | Runge-Kutta sympletic-splitting part B coefficients. |
q_rk | real(kind=R8P) | allocatable | Field cell centered variables, RK stages. |
blocks_zeroed | integer(kind=I4P) | Block slots of q_rk zeroed so far (issue #45). | |
ngc | integer(kind=I4P) | pointer | Number of ghost cells. |
ni | integer(kind=I4P) | pointer | Number of cells in i direction. |
nj | integer(kind=I4P) | pointer | Number of cells in j direction. |
nk | integer(kind=I4P) | pointer | Number of cells in k direction. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
assign_stage | pass(self) | Assign q to RK stage. |
compute_stage | pass(self) | Compute RK stage. |
compute_stage_ls | pass(self) | Compute RK stage, low storage scheme. |
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize class. |
initialize_stages | pass(self) | Initialize RK stages. |
load_from_file | pass(self) | Load config from file. |
update_q | pass(self) | Update RK q. |
Subroutines
assign_stage
Assign q to RK stage.
fortran
subroutine assign_stage(self, field, s, q, phi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | inout | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
s | integer(kind=I4P) | in | Current stage number. | |
q | real(kind=R8P) | in | Conservative variables. | |
phi | real(kind=R8P) | in | optional | IB distance. |
Call graph
compute_stage
Compute RK stage.
fortran
subroutine compute_stage(self, field, s, dt, phi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | inout | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
s | integer(kind=I4P) | in | Current stage number. | |
dt | real(kind=R8P) | in | Current time step. | |
phi | real(kind=R8P) | in | optional | IB 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | in | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
s | integer(kind=I4P) | in | Current RK stage. | |
dt | real(kind=R8P) | in | Current time step. | |
phi | real(kind=R8P) | in | optional | IB distance. |
dq | real(kind=R8P) | in | Conservative variables residuals. | |
q | real(kind=R8P) | inout | Conservative variables stage. |
Call graph
initialize
Initialize class.
fortran
subroutine initialize(self, field, grid, file_parameters, scheme)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | inout | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
grid | type(grid_object) | in | target | Grid (sibling realm component, threaded in). |
file_parameters | type(file_ini) | in | optional | Simulation parameters ini file handler. |
scheme | character(len=*) | in | optional | Runge-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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | inout | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
q | real(kind=R8P) | in | Conservative variables. |
Call graph
load_from_file
Load config from file.
fortran
subroutine load_from_file(self, file_parameters, go_on_fail)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | inout | RK object. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
go_on_fail | logical | in | optional | Go on if load fails. |
Call graph
update_q
Update RK q.
fortran
subroutine update_q(self, field, dt, phi, q, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | in | RK object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
dt | real(kind=R8P) | in | Current time step. | |
phi | real(kind=R8P) | in | optional | IB distance. |
q | real(kind=R8P) | inout | Conservative variables. | |
dq | real(kind=R8P) | inout | optional | Conservative 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
scheme | character(len=*) | in | Runge-Kutta scheme name. |
Call graph
description
Return a pretty-formatted object description.
Attributes: pure
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(rk_object) | in | RK object. |
Call graph