Skip to content

adam_prism_leapfrog_pic_object

ADAM, leapfrog class definition.

Considering the following ODE system:

Ut=R(t,U)

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:

Un+2=Un+2ΔtR(tn+1,Un+1)

Optionally, the Robert-Asselin-Williams (RAW) filter (see [3]) is applied to the computed integration steps:

Δ=ν2(Un2Un+1+Un+2)Un+1=Un+1+ΔαUn+2=Un+2+Δ(α1)

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

Variables

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=8)parameterINI (config) file section name containing time configs.

Derived Types

prism_leapfrog_pic_object

Leapfrog class definition.

Components

NameTypeAttributesDescription
mpihtype(mpih_object)MPI handler.
nureal(kind=R8P)Robert-Asselin filter coefficient.
alphareal(kind=R8P)Robert-Asselin-Williams filter coefficient.
is_filteredlogicalFlag to check if the integration if RAW filtered.
q_pic_oldreal(kind=R8P)allocatablePic variables, old time steps.
fieldtype(field_object)pointerThe field.
gridtype(grid_object)pointerThe grid.
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.
nbinteger(kind=I4P)pointerTotal blocks number for MPI.
blocks_numberinteger(kind=I4P)pointerActual blocks number.
nsinteger(kind=I4P)pointerNumber of fluids specie.
nvinteger(kind=I4P)pointerNumber of conservative variables.
pictype(prism_pic_object)pointerThe PIC object.
particle_numberinteger(kind=I4P)pointerNumber of particles.

Type-Bound Procedures

NameAttributesDescription
assign_steppass(self)Assign q to old steps.
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize class.
integratepass(self)Integrate.
load_from_filepass(self)Load config from file.

Subroutines

initialize

Initialize class.

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

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_leapfrog_pic_object)inoutLeapfrog object.
file_parameterstype(file_ini)inoptionalSimulation parameters ini file handler.
schemecharacter(len=*)inoptionalRunge-Kutta scheme.
gridtype(grid_object)intargetThe grid.
fieldtype(field_object)intargetThe field.
pictype(prism_pic_object)intargetThe PIC object.

Call graph

load_from_file

Load config from file.

fortran
subroutine load_from_file(self, file_parameters, go_on_fail)

Arguments

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

Call graph

assign_step

Assign q to leapfrog old step.

fortran
subroutine assign_step(self, s, q_pic, phi)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_leapfrog_pic_object)inoutLeapfrog object.
sinteger(kind=I4P)inCurrent step number.
q_picreal(kind=R8P)inPic variables.
phireal(kind=R8P)inoptionalIB distance.

Call graph

integrate

Integrate.

fortran
subroutine integrate(self, dt, q_pic, pic_fields)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_leapfrog_pic_object)inoutLeapfrog object.
dtreal(kind=R8P)inTime step.
q_picreal(kind=R8P)inoutPic variables.
pic_fieldsreal(kind=R8P)inFields 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

NameTypeIntentAttributesDescription
selfclass(prism_leapfrog_pic_object)inLeapfrog object.

Call graph

dotproduct

Compute the scalar (dot) product.

Returns: real(kind=R8P)

fortran
function dotproduct(a, b) result(dot)

Arguments

NameTypeIntentAttributesDescription
areal(kind=R8P)inLeft hand side.
breal(kind=R8P)inLeft hand side.

Call graph

crossproduct

Returns: real(kind=R8P)

fortran
function crossproduct(a, b) result(cross)

Arguments

NameTypeIntentAttributesDescription
areal(kind=R8P)inLeft hand side.
breal(kind=R8P)inLeft 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

NameTypeIntentAttributesDescription
areal(kind=R8P)inInput vector

Call graph