Compile-time configuration

Phantom uses a mix of compile-time and run-time configuration. The run-time configuration is specified in the input file (blah.in).

Simple things can be changed on the command line. To change the maximum number of particles use:

make SETUP=disc
./phantomsetup disc.in --maxp=10000000

Setup block

The compile-time configuration of Phantom is specified using the SETUP block in build/Makefile_setups. For example the default disc setup is “disc”:

ifeq ($(SETUP), disc)
#   locally isothermal gas disc
    SETUPFILE= setup_disc.f90
    ANALYSIS= analysis_disc.f90
    ISOTHERMAL=yes
    KNOWN_SETUP=yes
    MULTIRUNFILE= multirun.f90
    IND_TIMESTEPS=yes
endif

The choice of C preprocessor flags (FPPFLAGS=) can be used to specify particular physics. Otherwise these are specified using variables in this block as follows:

Pre-cooked setups

For many applications a pre-cooked SETUP block already exists. View the full list here. You can also override any of the compile-time settings manually, using the options below.

Code modules

Variable

Setting

Default value

Description

SETUPFILE

.f90 file(s)

setup_unifdis.F90

The setup routine and any auxiliary routines needed by phantomsetup

ANALYSIS

.f90 file(s)

analysis_dtheader.f90

(optional) The analysis routine and any auxiliary routines used by the phantomanalysis utility

SRCINJECT

.f90 file(s)

inject_rochelobe.f90

(optional) Module handling particle injection (triggers -DINJECT_PARTIC LES)

MODFILE

.f90 file(s)

moddump.f90

(optional) Routine used by moddump utility (to modify an existing dump file)

Code performance and accuracy

Variable

Setting

Default value

Description

MPI

yes/no/openmpi/ zen/apac

no

compile with MPI parallelisation

OPENMP

yes/no

yes

compile with openMP parallelisation

IND_TIMESTEPS

yes/no

no

use individual timesteps or not

DOUBLEPRECISION

yes/no

yes

use 8-byte reals (no=4 byte)

DEBUG

yes/no

no

turns on debugging flags (slow)

APR

yes/no

no

use adaptive particle refinement, (APR) from Nealon & Price (2025)

Memory usage

Variable

Setting

Default value

Description

MAXPTMASS

integer

1000

maximum number of point mass particles (array size)

NCELLSMAX

integer

same as maxp

maximum number of nodes in the kdtree neighbour finding

Physics

Examples

For example, to set individual timesteps on the command line:

make IND_TIMESTEPS=yes

or put this in the SETUP block:

ifeq ($(SETUP), disc)
    ...
    IND_TIMESTEPS=yes