MAS is a Fortran code that integrates the time-dependent resistive thermodynamic magnetohydrodynamic (MHD) equations in three-dimensional spherical coordinates and is used extensively to compute models of coronal structure, coronal dynamics, and coronal mass ejections out to the Earth. It is the primary MHD model in CORHEL (Corona-Heliosphere), a suite of models for describing the solar corona and inner heliosphere and CORHEL-CME, an interface-based system for modeling CME eruptions from the Sun to Earth, both of which are available for public runs-on-demand at NASA's Community Coordinated Modeling Center (CCMC).
For more information on MAS, including model/computational details and references, see here.
MAS can be used with MacOS, Linux, and Windows (through WSL) on CPUs and NVIDIA GPUs.
MAS is a complex code with many years of development and contains numerous input parameters, use cases, experimental features, deprecated features, etc. We recommend that, if possible, MAS should be used through the public interfaces hosted at the CCMC - specifically the CORHEL and CORHEL-CME interfaces. These allow users to run MAS for steady-state coronal and heliospheric MHD relaxations, zero-beta flux rope relaxations and eruptions, and full MHD CME eruptions from the Sun to Earth. The MAS code provided here will become part of future CORHEL-like open-source releases as a sub-module. Until then, it is primarily intended for reference purposes and/or for advanced users/developers.
==> Please contact PSI at support@predsci.com if you plan to use this code for research purposes. <==
MAS has been tested to work with the following compilers:
- GCC's
gfortran
v14.2.0 - NVIDIA's
nvfortran
v25.5 (both CPU and GPU) - INTEL's
ifx
v2025.1.0
MAS requires the HDF5 library and an MPI library (e.g. OpenMPI, MPICH, etc.).
Create or select a build configuration file in the ./conf
folder (see the included examples in ./conf
).
Build the code with:
> ./build.sh ./conf/<CONF_FILE>.conf
where <CONF_FILE>.conf
is your created/chosen configuration file.
After the build, you can add the MAS code and tools into your bash
path by sourcing the included helper script:
> . load_mas_env.sh
To ensure the installation was successful, a testsuite is provided in the testsuite
folder.
To run the testsuite:
> cd testsuite
> ./run_mas_testsuite.sh
The available options can be viewed by running ./run_mas_testsuite.sh -h
.
MAS uses a Fortran namelist text input file to set all non-default parameters of a run.
In the examples
folder, we provide inputs for several use cases of MAS.
To run MAS
, create an input namelist text file, then copy or link the mas
executable into the same directory as the input file and run the command:
> <MPI_LAUNCHER> -np <N> ./mas <RUN_NAME> <INPUT_FILE>
where <RUN_NAME>
is a chosen run name, <INPUT_FILE>
is the created input file, <N>
is the total number of MPI ranks to use (typically equal to the number of CPU cores or number of GPUs) and <MPI_LAUNCHER>
is your MPI run command (e.g. mpiexec
,mpirun
, ibrun
, srun
, etc).
For example:
> mpiexec -np 1024 ./mas my_first_run mas.in