Skip to content
 
 

Repository files navigation

Pylint Codacy Badge

1. Getting started

Clone the repository

git clone https://github.com/petrafisher-code/ShallowWaterModelCode.git

Move into the repository

cd ShallowWaterModelCode

2. Compilation and running the code

You can either compile and run using Docker or directly on your machine. Docker is recommended.

Running using Docker

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=plain

Once complete, run the container

docker run fortran_code:latest

In 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/directory

Running without Docker

You 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.in

To run the code with multiple processors as an MPI job

mpiexec -n 32 ./main.exe ../config/namelist.in

3. Animating results

There a python files provided to animate the resulting output.nc netCDF file. Move to the python directory,

cd src/python

Run the python animate_output.py file

python animate_output.py

This 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.)


4. Doxygen pages

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"


5. Contributing development

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.


About

A shallow water model coded on the sphere.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages