Skip to content

selah_kernels_flat ​

SELAH, L1: the flat kernels, the stage operations over a whole contiguous rank-1 array.

For state that has no ghost cells and no mask: particles (position, velocity), perfectly-matched-layer slabs, any array the caller flattens. Every element is updated; the operations and their summation orders are those of the box kernels (selah_kernels_box). In a device build every array argument must be device resident.

Source: src/lib/selah_kernels_flat.F90

Dependencies

Contents ​

Subroutines ​

copy_flat ​

y = x.

fortran
subroutine copy_flat(x, y)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R_P)inSource.
yreal(kind=R_P)inoutDestination.

Call graph

axpy_flat ​

y = y + alpha x.

fortran
subroutine axpy_flat(alpha, x, y)

Arguments

NameTypeIntentAttributesDescription
alphareal(kind=R_P)inCoefficient.
xreal(kind=R_P)inIncrement.
yreal(kind=R_P)inoutUpdated array.

lincomb_flat ​

y = alpha x + beta y.

fortran
subroutine lincomb_flat(alpha, x, beta, y)

Arguments

NameTypeIntentAttributesDescription
alphareal(kind=R_P)inCoefficient of x.
xreal(kind=R_P)inFirst array.
betareal(kind=R_P)inCoefficient of y.
yreal(kind=R_P)inoutSecond array, overwritten.

stage_state_flat ​

u = q + sum_{k=1..n} dt coef(k) regs(:,k); n = 0 is a copy (see stage_state_box).

fortran
subroutine stage_state_flat(n, dt, coef, q, regs, u)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inRegisters summed.
dtreal(kind=R_P)inTime step.
coefreal(kind=R_P)inCoefficients [n or more].
qreal(kind=R_P)inSolution.
regsreal(kind=R_P)inResidual registers [size(q), n or more].
ureal(kind=R_P)inoutStage state.

Call graph

step_update_flat ​

q = q + dt sum_{k=1..n} coef(k) regs(:,k), fused with dq = sum_k coef(k) regs(:,k) when dq is present.

fortran
subroutine step_update_flat(n, dt, coef, regs, q, dq)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inRegisters summed.
dtreal(kind=R_P)inTime step.
coefreal(kind=R_P)inWeights [n or more].
regsreal(kind=R_P)inResidual registers [size(q), n or more].
qreal(kind=R_P)inoutSolution, advanced.
dqreal(kind=R_P)inoutoptionalStep residual.

shu_osher_2r_stage_flat ​

q = a q0 + b q + dt c r: a stage of a two-register Shu–Osher form.

fortran
subroutine shu_osher_2r_stage_flat(dt, a, b, c, q0, r, q)

Arguments

NameTypeIntentAttributesDescription
dtreal(kind=R_P)inTime step.
areal(kind=R_P)inStage coefficients.
breal(kind=R_P)inStage coefficients.
creal(kind=R_P)inStage coefficients.
q0real(kind=R_P)inSolution at the start of the step.
rreal(kind=R_P)inResidual of the current stage.
qreal(kind=R_P)inoutCurrent stage, advanced.

williamson_2n_stage_flat ​

dqr = a dqr + dt r; q = q + b dqr: a stage of a Williamson 2N form. With a = 0 dqr is not read (dqr = dt r).

fortran
subroutine williamson_2n_stage_flat(dt, a, b, r, dqr, q)

Arguments

NameTypeIntentAttributesDescription
dtreal(kind=R_P)inTime step.
areal(kind=R_P)inStage coefficients A_i, B_i.
breal(kind=R_P)inStage coefficients A_i, B_i.
rreal(kind=R_P)inResidual of the current stage.
dqrreal(kind=R_P)inoutThe Delta Q register.
qreal(kind=R_P)inoutCurrent stage, advanced.

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice