Appearance
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
| Name | Type | Attributes | Description |
|---|---|---|---|
EOS_SEGMENTS_MAX | integer(kind=I4P) | parameter | Segments of one table (fixed: device arrays). |
EOS_TABLES_MAX | integer(kind=I4P) | parameter | Tables of one run (one per distinct realm law). |
eos_tables_number | integer(kind=I4P) | Registered tables. | |
eos_tables_segments | integer(kind=I4P) | Segments of each table. | |
eos_tables_breaks | real(kind=R8P) | Upper break of each segment. | |
eos_tables_exponents | real(kind=R8P) | G_k. | |
eos_tables_k | real(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
c0 | real(kind=R8P) | in | Isothermal speed sqrt(P / rho) at rho_ref. | |
rho_ref | real(kind=R8P) | in | Reference density of the first segment. | |
breaks | real(kind=R8P) | in | Densities of the breaks, increasing. | |
exponents | real(kind=R8P) | in | Exponent 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
id | integer(kind=I4P) | in | Table id. | |
rho | real(kind=R8P) | in | Density. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
id | integer(kind=I4P) | in | Table id. | |
rho | real(kind=R8P) | in | Density. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
id | integer(kind=I4P) | in | Table id. | |
rho | real(kind=R8P) | in | Density. |
Call graph