Clone the repository
git clone https://github.com/petrafisher-code/ShallowWaterModelCode.gitMove into the repository
cd ShallowWaterModelCodeYou can either compile and run using Docker or directly on your machine. Docker is recommended.
Install docker on your machine. Open docker, go back to the code/your IDE and run the following command in terminal
docker build -t fortran_code ./ --progress=plainOnce complete, run the container
docker run fortran_code:latestIn the docker application under "Containers", copy the latest container ID to clipboard.
In another terminal (or after stopping the container) copy the output file to your local folder
docker cp [CONTAINER_ID]:/tmp/output.nc /path/to/your/tests/directoryYou will need to install NETCDF on your system and note the directories where the library and module reside.
In the Makefile change the variables NETCDF_FOR, NETCDF_C and NETCDF_LIB to suit your system. Sometimes when compiling NETCDF you may have to install both the fortran and c versions. If you do not need to do this, set NETCDF_FOR and NETCDF_C equal to the same value.
If you install both c and fortran versions, set NETCDF_LIB to -lnetcdff If you only need to install one version, set NETCDF_LIB to lnetcdf Finally, once netcdf is installed and the make file is edited, type "make" to compile the code
Note, these variables are commented out in the Makefile. You may set them as environment variables in your .bashrc, or .bash_profile and the Makefile will pick them up.
Type the following to run the code on a single processor
./main.exe ../config/namelist.inTo run the code with multiple processors as an MPI job
mpiexec -n 32 ./main.exe ../config/namelist.inThere a python files provided to animate the resulting output.nc netCDF file. Move to the python directory,
cd src/pythonRun the python animate_output.py file
python animate_output.pyThis will produce frames in the ShallowWaterModelCode/output/frames directory and animations in the ShallowWaterModelCode/output/animations directory. (If you have already produced animations, the terminal will ask you whether you want to overwrite the previous animations.)
Self generating documentation (from the source code) can be created by typing "doxygen fortran.dxg" at the command line.
You can then view the html pages by opening the file at "doxygen/html/index.html"
At the moment the code is under private repo with no development branches. Contact the code owner to contribute ideas at https://github.com/UoM-maul1609/shallow-water-model-on-sphere.