|
4 | 4 |
|
5 | 5 | GOTM - the **G**eneral **O**cean **T**urbulence **M**odel is an ambitious name for a one-dimensional water column model for marine and limnological applications. It is coupled to a choice of traditional as well as state-of-the-art parameterisations for vertical turbulent mixing. The package consists of the FORTRAN source code, a number of idealised and realistic test cases, and a scientific documentation, all published under the GNU public license. |
6 | 6 |
|
7 | | -A comprehensive description including compilation instructions are given at the official [GOTM homepage](http://www.gotm.net/portfolio/software). |
| 7 | +Further information about GOTM can be found [here](https://gotm.net). |
8 | 8 |
|
| 9 | +### Manual build and install |
| 10 | + |
| 11 | +GOTM being written in Fortran requires compilation before it can be used. |
| 12 | + |
| 13 | +Below is provided a short description on how to obtain the code, configure, compile and install GOTM. |
| 14 | + |
| 15 | +#### Cloning the code |
| 16 | + |
| 17 | +The [GOTM source code](https://github.com/gotm-model/code) is in a Git repository and as a first step this code most be cloned to the local computer(*). [Git](https://git-scm.com/) must be installed. |
| 18 | + |
| 19 | +Not strictly necessary creating a new folder for GOTM is a good idea. |
| 20 | +``` |
| 21 | +mkdir GOTM |
| 22 | +cd GOTM |
| 23 | +``` |
| 24 | +Now clone the code to the local machine: |
| 25 | +``` |
| 26 | +git clone --recurse-submodules https://github.com/gotm-model/code.git |
| 27 | +``` |
| 28 | +#### Configuring the code for compilation |
| 29 | + |
| 30 | +A few requisits must be fullfilled befor proceeding. Being general descriptions the following instructions should work both on Linux/Mac and Windows. The example commands are to be executed in a terminal window - alternatives using a GUI is possible but beyond the instructions given here. |
| 31 | + |
| 32 | +As a common build system we use [CMake](https://cmake.org/) and [Ninja](https://ninja-build.org/). So please install these before proceeding. |
| 33 | + |
| 34 | +Furthermore, a Fortran compiler must be installed and discoverable by CMake. |
| 35 | + |
| 36 | +NetCDF has been - and maybe still will be a headache - but it is assumed that NetCDF is installed with Fortran support. For Windows we provide a prebuilt set of libraries. |
| 37 | + |
| 38 | +Configuration is done with cmake - and example being: |
| 39 | +``` |
| 40 | +cmake -G Ninja -B build -S code |
| 41 | +``` |
| 42 | +This will create a new folder - build - with the necessary information for actual compiling the code. |
| 43 | + |
| 44 | +The build system for GOTM provides support for options to pass to the actual compilation. These are provided as extra arguments to the above cmake execution. As and example to include support for ice - use the following: |
| 45 | + |
| 46 | +``` |
| 47 | +cmake -B build -S code -DGOTM_USE_STIM |
| 48 | +``` |
| 49 | +It is always safe to completely remove the build folder and start all over |
| 50 | + |
| 51 | +#### Compiling the code |
| 52 | + |
| 53 | +If the cmake command did not result in any errors we are ready to actually compile the code into an executable: |
| 54 | +``` |
| 55 | +cmake --build build |
| 56 | +``` |
| 57 | +This will take a little while but should en up in a compiled GOTM executable in the build/folder. |
| 58 | +This executable is ready to run but for convinience you might install it in a folder in the PATH on your computer - in which case you can just type - gotm - in any folder. |
| 59 | + |
| 60 | +#### Installing the GOTM executable |
| 61 | +The installation also is done by CMake: |
| 62 | +``` |
| 63 | +cmake --install build --prefix <folder_in_your_path> |
| 64 | +``` |
| 65 | +To test if it works open a new terminal window and execute - gotm. |
| 66 | + |
| 67 | +#### GOTM test cases |
| 68 | +GOTM comes with a number of ready to run test cases. There are also in a Git repository and can be obtained like: |
| 69 | +``` |
| 70 | +git clone --recurse-submodules https://github.com/gotm-model/cases.git |
| 71 | +``` |
| 72 | +Entering any of the cases folders and just executing - gotm - should run the model for the specific configuration. |
| 73 | + |
| 74 | +An older description is provided here [GOTM homepage](http://www.gotm.net/portfolio/software). |
| 75 | + |
| 76 | +(*) For people who intend to contribute to the GOTM source code a 'fork' is a better solution. |
0 commit comments