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
- copy_flat
- axpy_flat
- lincomb_flat
- stage_state_flat
- step_update_flat
- shu_osher_2r_stage_flat
- williamson_2n_stage_flat
Subroutines
copy_flat
y = x.
subroutine copy_flat(x, y)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x | real(kind=R_P) | in | Source. | |
y | real(kind=R_P) | inout | Destination. |
Call graph
axpy_flat
y = y + alpha x.
subroutine axpy_flat(alpha, x, y)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
alpha | real(kind=R_P) | in | Coefficient. | |
x | real(kind=R_P) | in | Increment. | |
y | real(kind=R_P) | inout | Updated array. |
lincomb_flat
y = alpha x + beta y.
subroutine lincomb_flat(alpha, x, beta, y)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
alpha | real(kind=R_P) | in | Coefficient of x. | |
x | real(kind=R_P) | in | First array. | |
beta | real(kind=R_P) | in | Coefficient of y. | |
y | real(kind=R_P) | inout | Second 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).
subroutine stage_state_flat(n, dt, coef, q, regs, u)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Registers summed. | |
dt | real(kind=R_P) | in | Time step. | |
coef | real(kind=R_P) | in | Coefficients [n or more]. | |
q | real(kind=R_P) | in | Solution. | |
regs | real(kind=R_P) | in | Residual registers [size(q), n or more]. | |
u | real(kind=R_P) | inout | Stage 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.
subroutine step_update_flat(n, dt, coef, regs, q, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Registers summed. | |
dt | real(kind=R_P) | in | Time step. | |
coef | real(kind=R_P) | in | Weights [n or more]. | |
regs | real(kind=R_P) | in | Residual registers [size(q), n or more]. | |
q | real(kind=R_P) | inout | Solution, advanced. | |
dq | real(kind=R_P) | inout | optional | Step residual. |
shu_osher_2r_stage_flat
q = a q0 + b q + dt c r: a stage of a two-register Shu–Osher form.
subroutine shu_osher_2r_stage_flat(dt, a, b, c, q0, r, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dt | real(kind=R_P) | in | Time step. | |
a | real(kind=R_P) | in | Stage coefficients. | |
b | real(kind=R_P) | in | Stage coefficients. | |
c | real(kind=R_P) | in | Stage coefficients. | |
q0 | real(kind=R_P) | in | Solution at the start of the step. | |
r | real(kind=R_P) | in | Residual of the current stage. | |
q | real(kind=R_P) | inout | Current 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).
subroutine williamson_2n_stage_flat(dt, a, b, r, dqr, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dt | real(kind=R_P) | in | Time step. | |
a | real(kind=R_P) | in | Stage coefficients A_i, B_i. | |
b | real(kind=R_P) | in | Stage coefficients A_i, B_i. | |
r | real(kind=R_P) | in | Residual of the current stage. | |
dqr | real(kind=R_P) | inout | The Delta Q register. | |
q | real(kind=R_P) | inout | Current stage, advanced. |