Appearance
adam_prism_leapfrog_pic_object
ADAM, leapfrog class definition.
Considering the following ODE system:
where (U_t = \frac{dU}{dt}), U is the vector of state variables being a function of the time-like independent variable t, R is the (vectorial) residual function, the leapfrog class scheme implemented (see [3]) is:
Optionally, the Robert-Asselin-Williams (RAW) filter (see [3]) is applied to the computed integration steps:
Note that for (\alpha=1) the filter reverts back to the standard Robert-Asselin scheme. The filter coefficients should be taken as (\nu \in (0,1]) and (\alpha \in (0.5,1]). The default values are
- (\nu=0.01)
- (\alpha=0.53)
@note The value of (\Delta t) must be provided, it not being computed by the integrator.
The schemes are explicit. The filter coefficients (\nu,,\alpha ) define the actual scheme.
Bibliography
[1] The integration of a low order spectral form of the primitive meteorological equations, Robert, A. J., J. Meteor. Soc. Japan,vol. 44, pages 237--245, 1966.
[2] Frequency filter for time integrations, Asselin, R., Monthly Weather Review, vol. 100, pages 487--490, 1972.
[3] The RAW filter: An improvement to the Robert–Asselin filter in semi-implicit integrations, Williams, P.D., Monthly Weather Review, vol. 139(6), pages 1996--2007, June 2011.
Source: src/app/prism/common/adam_prism_leapfrog_pic_object.F90
Dependencies
Contents
- prism_leapfrog_pic_object
- initialize
- load_from_file
- assign_step
- integrate
- description
- dotproduct
- crossproduct
- sq_norm
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=8) | parameter | INI (config) file section name containing time configs. |
Derived Types
prism_leapfrog_pic_object
Leapfrog class definition.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
mpih | type(mpih_object) | MPI handler. | |
nu | real(kind=R8P) | Robert-Asselin filter coefficient. | |
alpha | real(kind=R8P) | Robert-Asselin-Williams filter coefficient. | |
is_filtered | logical | Flag to check if the integration if RAW filtered. | |
q_pic_old | real(kind=R8P) | allocatable | Pic variables, old time steps. |
field | type(field_object) | pointer | The field. |
grid | type(grid_object) | pointer | The grid. |
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. |
nb | integer(kind=I4P) | pointer | Total blocks number for MPI. |
blocks_number | integer(kind=I4P) | pointer | Actual blocks number. |
ns | integer(kind=I4P) | pointer | Number of fluids specie. |
nv | integer(kind=I4P) | pointer | Number of conservative variables. |
pic | type(prism_pic_object) | pointer | The PIC object. |
particle_number | integer(kind=I4P) | pointer | Number of particles. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
assign_step | pass(self) | Assign q to old steps. |
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize class. |
integrate | pass(self) | Integrate. |
load_from_file | pass(self) | Load config from file. |
Subroutines
initialize
Initialize class.
fortran
subroutine initialize(self, file_parameters, scheme, grid, field, pic)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_leapfrog_pic_object) | inout | Leapfrog object. | |
file_parameters | type(file_ini) | in | optional | Simulation parameters ini file handler. |
scheme | character(len=*) | in | optional | Runge-Kutta scheme. |
grid | type(grid_object) | in | target | The grid. |
field | type(field_object) | in | target | The field. |
pic | type(prism_pic_object) | in | target | The PIC object. |
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(prism_leapfrog_pic_object) | inout | Leapfrog 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
assign_step
Assign q to leapfrog old step.
fortran
subroutine assign_step(self, s, q_pic, phi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_leapfrog_pic_object) | inout | Leapfrog object. | |
s | integer(kind=I4P) | in | Current step number. | |
q_pic | real(kind=R8P) | in | Pic variables. | |
phi | real(kind=R8P) | in | optional | IB distance. |
Call graph
integrate
Integrate.
fortran
subroutine integrate(self, dt, q_pic, pic_fields)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_leapfrog_pic_object) | inout | Leapfrog object. | |
dt | real(kind=R8P) | in | Time step. | |
q_pic | real(kind=R8P) | inout | Pic variables. | |
pic_fields | real(kind=R8P) | in | Fields value at particle locations. |
Call graph
Functions
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(prism_leapfrog_pic_object) | in | Leapfrog object. |
Call graph
dotproduct
Compute the scalar (dot) product.
Returns: real(kind=R8P)
fortran
function dotproduct(a, b) result(dot)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Left hand side. | |
b | real(kind=R8P) | in | Left hand side. |
Call graph
crossproduct
Returns: real(kind=R8P)
fortran
function crossproduct(a, b) result(cross)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Left hand side. | |
b | real(kind=R8P) | in | Left hand side. |
Call graph
sq_norm
Return the square of the norm of vector.
Returns: real(kind=R8P)
fortran
function sq_norm(a) result(sq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Input vector |
Call graph