-
Notifications
You must be signed in to change notification settings - Fork 13
Programming guide
The code uses a main loop, updating the state variables, going through these steps.
- dynamical core (THOR), updating all the atmospheric dynamics of the simulation
- physics (ProfX)
- conservation computation
- output
- Main function in
esp.cu
. Contains the argument reading, the setup, the initial condition calls and the main loop. - grid: class to build hexagonal grid structure and operators on it. At startup, fills all the data arrays needed for computation on the grid.
- ESP, main class holding the state variables and the update function for the dynamical core and the physics.
-
src/initial/esp_initial.cu
: memory allocation and initial conditions loading and calculation. -
src/output/esp_output.cu
: file output functions to store the simulation state. -
src/thor/
: dynamical core step execution (thor_driver.cu
) and kernel functions, -
src/headers/dyn/
: dynamical core headers and header only kernels -
src/profx/profx_driver.cu
: physics step execution. -
src/headers/phy/
: physics headers and header only kernels.
-
- physics modules:
-
src/physics/
example physics modules, can be replace by user's own physics modules in their own folder outside of the dynamical core git tree.
-
- auxiliary classes
-
src/input/
: helpers for config file parsing and command arguments reading. -
src/utils/
: utilities, iteration timer helper class. -
src/files/
: helpers for directories and logging. -
src/devel/
: helper for debugging and checking data consistency after changes. -
src/test/
: test programs for helper classes, code experiments.
-
you can get more information on the code by compiling with clang
. clang
is another compiler used on linux that now supports part of CUDA syntax, and is known for it's display of compilation messages. No performance benchmarks have been performed on it, it's only experimental to get more error checking on the code. Note that the clang output can be very verbose and very strict to conformance to standard.
- compiling with clang.
$ make release -j8 COMP=clang++-6
It also dumps a compilation database (in compilation_commands.json
), which is usable by the clang tools (like clang-tidy) to do syntax analysis, modernising and run sanitizers on the code. It can also be used by some editors to know how the files are compiled and help for navigation through code and code completion (ycmd for vim, irony-mode and rtags for emacs, ide-clangd for Atom).