Python and Fortran implementations of Fleck and Cummings's implicit Monte Carlo (IMC) scheme, published in Journal of Computational Physics (JCP) in 1971.
For each implementation, the results from the published paper (Fleck and Cummings 1971) are reproduced via a set of predefined runs included in the repository.
| Fleck and Cummings (1971) | Fortran implementation | Python implementation |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- Python 3
- Numpy
- GFortran (installed separately; see Installation)
- Matplotlib
- Jupyter
Install Python dependencies with uv (from pyproject.toml):
uv venv
source .venv/bin/activate
uv sync
To install GFortran:
macOS (Homebrew):
brew install gcc
Linux (Debian/Ubuntu):
sudo apt-get install gfortran
Linux (Fedora):
sudo dnf install gcc-gfortran
To build and run everything from scratch, run the top-level script:
./runall clobber # Removes latest graphs
./runall
To see the aggregated output:
jupyter notebook verification.ipynb
To open the documentation:
open site/index.html
To clean up intermediate build files etc.:
./runall clean
and to clean out everything (output files, executables, etc.) for a clean start:
./runall clobber
Each part of the project has its own Makefile which can be invoked directly:
./fortran/src/Makefile
./fortran/calcs/Makefile
./python/calcs/Makefile
./docs/Makefile
to either clean up one part, e.g.:
make -C fortran/src clean
make -C docs clobber
or build/execute, e.g.:
make -C python/calcs -j 4 all
Building the documentation is a special case:
make -C docs html
This builds the MkDocs site into site/ and embeds the Ford API reference at
site/doc/.
To preview the documentation locally:
uv run mkdocs serve
Run the Jupyer notebook to plot the results:
jupyter notebook verification.ipynb
Verification against the original Fleck and Cummings (1971) results (shown on the left) of both a Fortran (middle) and a Python (right) implementation of the IMC scheme described therein.














