Software Package for E3SM Land began as toolkit for creating functional unit tests for any subroutine in the E3SM Land Model. Moreover, the parsing capabilities of SPEL allow for easy script-based source-to-source modifications, such as OpenACC pragma insertion. Now, SPEL can export data to a database (managed by Django) so that the overall flow of ELM can be inspected at a high level in a web browser. The general aim of SPEL now is to serve as a platform for developing, debugging, and understanding of complicated (legacy) Fortran projects, though ELM is the only supported project currently.
Installation is very easy in a python virtual environment. Dependencies are managed in the pyproject.toml
git clone https://www.github.com/peterdschwartz/SPEL_OpenACC.git
cd SPEL_OpenACC
pip install -e .
Extra configuration is required to point SPEL to the location of the E3SM clone in the ./scripts/mod_config.py file modify the E3SM_SRCROOT = spel_dir + <relative path to E3SM>
# Creates unit-test for subroutines with given (optional casename). Default casename is 'fut'.
# Unit-tests are kept in ./unit-tests/<casename>
spel create -s <list-of-subroutines> -c <casename>
# Compile and run unit-test. If in the FUT directory, the casename is not needed.
spel run <casename>
# Compare two netcdf files (ie, for SPEL generated by ReadWriteMod::write_elmtypes)
spel diff --ref <ref file>.nc --test <test file>.nc
# Export pickle files to csv, which can then be added to the db via Django commands
# The commit is the HEAD of user's E3SM repo, which is used to tag the pickle files
spel export -c <commit>