Skip to content

adam_flume_eos_tables_library ​

ADAM, FLUME barotropic equation-of-state tables (issue #100, M13 P3).

A barotropic gas is a continuous piecewise polytrope, P = K_k rho^G_k on rho_{k-1} <= rho < rho_k (rho_0 = 0, the last segment unbounded), K_1 = c0^2 rho_ref^(1 - G_1) and K_{k+1} = K_k rho_k^(G_k - G_{k+1}) (P continuous), c^2 = dP/drho = G_k P / rho: the law of src/tests/flume/verification/eos/eos_oracle.py (class Eos). c0 is the isothermal speed sqrt(P / rho) at rho_ref, the sound speed there when G_1 = 1 (Mathew & Federrath 2021).

The kernels take the EOS through one scalar, the argument named gamma (D-M13-1: one interface for every Euler model): a table cannot travel that way, so each realm registers its table here and passes the table's id (as a real). The registry is fixed-size, so the device holds it as module arrays (no allocatable descriptors in device routines). Registering an identical table returns its id: realms with one law share one entry, a realm with another law gets its own. A table is configuration, set once at initialization and never changed. Every lookup is pure + !$acc routine seq + !$omp declare target, like the pointwise libraries.

Source: src/app/flume/common/adam_flume_eos_tables_library.F90

Contents ​

Variables ​

NameTypeAttributesDescription
EOS_SEGMENTS_MAXinteger(kind=I4P)parameterSegments of one table (fixed: device arrays).
EOS_TABLES_MAXinteger(kind=I4P)parameterTables of one run (one per distinct realm law).
eos_tables_numberinteger(kind=I4P)Registered tables.
eos_tables_segmentsinteger(kind=I4P)Segments of each table.
eos_tables_breaksreal(kind=R8P)Upper break of each segment.
eos_tables_exponentsreal(kind=R8P)G_k.
eos_tables_kreal(kind=R8P)K_k.

Functions ​

register_barotropic_table ​

Register the table of c0, rho_ref, the breaks and the exponents (validated by the caller) and return its id; an identical table already registered returns that one's id. More than EOS_TABLES_MAX distinct tables: id 0 (the caller stops). The device copy is the caller's (the FNL backend updates the arrays after initialization).

Returns: integer(kind=I4P)

fortran
function register_barotropic_table(c0, rho_ref, breaks, exponents) result(id)

Arguments

NameTypeIntentAttributesDescription
c0real(kind=R8P)inIsothermal speed sqrt(P / rho) at rho_ref.
rho_refreal(kind=R8P)inReference density of the first segment.
breaksreal(kind=R8P)inDensities of the breaks, increasing.
exponentsreal(kind=R8P)inExponent of each segment, size(breaks) + 1.

Call graph

barotropic_pressure ​

The pressure P(rho) of table id (a break belongs to the segment above it).

Attributes: pure

Returns: real(kind=R8P)

fortran
function barotropic_pressure(id, rho) result(p)

Arguments

NameTypeIntentAttributesDescription
idinteger(kind=I4P)inTable id.
rhoreal(kind=R8P)inDensity.

Call graph

barotropic_c2 ​

The squared sound speed dP/drho = G P / rho of table id.

Attributes: pure

Returns: real(kind=R8P)

fortran
function barotropic_c2(id, rho) result(c2)

Arguments

NameTypeIntentAttributesDescription
idinteger(kind=I4P)inTable id.
rhoreal(kind=R8P)inDensity.

Call graph

segment ​

The segment of rho in table id: the first whose upper break exceeds rho (the last one is unbounded).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function segment(id, rho) result(s)

Arguments

NameTypeIntentAttributesDescription
idinteger(kind=I4P)inTable id.
rhoreal(kind=R8P)inDensity.

Call graph