Build and Run¶
Setting up a test problem¶
To set up a test problem, you need:
A
Makefilewith a definition of the numerical options used.An application file (e.g.,
app.F90) where the initial conditions for the primitive variableslgrid%prim(:,i,j,k)are set at every cell center and the main time integration loop is performed.Optional: a job script for running simulations on HPC clusters.
Build workflow¶
1. Choose a build configuration¶
Phlegethon uses pkg-config to auto-detect the MPI-Fortran compiler and the hdf5 library. In case you need to specify machine-dependent settings (see also Make.local/README.md):
Create a new build-configuration file in
Make.local/, specifiying the path to the MPI-Fortran compiler and the hdf5 library.Edit the
includepath inMakefile.configto link the costum configuration, e.g.,
include ../../Make.local/Make.leidi
2. Build a test problem¶
cd tests/hotbubble-helmholtz
make clean
make
3. Run a test problem¶
mpirun -n 4 ./run.app
4. Read output in Python¶
In a Python session (e.g., ipython), you can load and imshow any quantity from the ith-snapshot (here sixth) like
from phloutput import *
g = h5grid(6)
g.gridshow(g.mach())
Check python/phloutput.py for a list of variables that can be accessed from the h5grid class. For 3D simulations, individual planes can be accessed with the ix, iy, and iz indices (by default, h5grid will load the full array).
Docker workflow (optional)¶
For all container workflows (Docker installation, image build, Compose usage, Jupyter post-processing, output access, and interactive sessions), see Docker Workflow.
Compile-time configuration¶
Most Phlegethon configuration is done at compile time through OPTS += ... entries in each test Makefile.
Makefile options are passed as:
OPTS += USE_DOUBLE_PRECISION
OPTS += nx1_make=64
OPTS += cfl_make=0.8_rp
These are forwarded as preprocessor definitions when compiling source/source.F90.
See Compile-Time Flags and Options for the full option list.