Collection of Python scripts to make using SWMF easier. Note most of these require a recent version of Python 3. Supercomputers typically have this already.
Make sure swmfpy is installed.
$ pip install swmfpy || pip install --user swmfpyThis script is to help with the inputs of the geospace model.
If you already have a run directory and PARAM.in file then skip ahead.
In the base directory of SWMF run:
SWMF$ ./Config.pl -install
# Compile then make the run directory if worked
SWMF$ make -j test_swpc_compile && make rundirIt would be useful to set up an environment variable to this script location.
SWMF$ echo 'export PYSCRIPTS='"$(realpath share/Python/Scripts)" >> ~/.profile
SWMF$ . ~/.profileGo to your run directory and copy a sensible PARAM.in:
SWMF$ cd run
SWMF/run$ cp Param/SWPC/PARAM.in_SWPC_v2_init PARAM.inThen the final steps copy the script and the run directory into a work directory that your supercomputer allows before jobs:
SWMF$ cp run /some/work/dir/
SWMF$ cd /some/work/dir/
/some/work/dir$ python3 "$PYSCRIPTS"/prepare_geospace.py --start_time 2014 2 3 4 5 6 --end_time 2014 3 4 5 6 7
# Your PARAM.in will be overwritten with those values
# Then submit jobTo find out the options of prepare_geospace.py then run:
/some/work/dir$ ./prepare_geospace.py --help
# Help message outputOptions can be useful to script this file with shell scripting, for example, when submitting jobs.
A script to plot the global indices of your geospace run (SYM-H, cross polar cap
potential, AL.. etc.). This uses swmfpy to get the observed indices to
compare.
To run simply type on your command line:
python plot_indices.py -hA simply way of using this script is to make sure you know where your
log_****.log and corresponding geo_****.log are and running:
# replace with your file names
python plot_indices.py log_YYYYMMMDD.log geo_YYYMMMDD.log