Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of tracers #45

Open
FlorianDeconinck opened this issue Dec 19, 2023 · 0 comments
Open

Refactor of tracers #45

FlorianDeconinck opened this issue Dec 19, 2023 · 0 comments

Comments

@FlorianDeconinck
Copy link
Collaborator

Right now the tracers are organized as an hardcoded list of strings, e.g.

tracer_variables = [
    "qvapor",
    "qliquid",
    "qrain",
    "qice",
    "qsnow",
    "qgraupel",
    "qo3mr",
    "qsgs_tke",
    "qcld",
]

The amount of species to work on is known via constants.NQ, which is then used throughout the code (including in loop boundaries).
Later in the code, some configuration is down via kord to reflect strategy of remapping for each Tracers e.g.

kord_tracer = [kord] * self._nq
[...]
MapSingle(
    stencil_factory,
    quantity_factory,
    kord_tracer[i],
    0,
    dims=[X_DIM, Y_DIM, Z_DIM],
)

The list continues, but the point remains: tracers semantic is hardcoded and dispersed in many variables.

We need a semantically strong Tracers object that know to:

  • load from configuration
  • name tracers
  • know how many tracers are advected or/and know how to iterate over tracers
  • index tracers in state (or even hold the memory, TBD)
  • carries the configurations related to the Tracers (kord, etc.)

Basically break the organization in two:

  • out of critical path: make a global object
  • critical path: keep the Field-based SOA-like system for performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant