A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

pygetm

A Python rewrite of the General Estuarine Transport Model.
https://github.com/boldingbruggeman/getm-rewrite

Category: Hydrosphere
Sub Category: Coastal and Reefs

Keywords

estuary-earth-science

Keywords from Contributors

measur archiving transforms optimize projection animals compose generic observation conversion

Last synced: about 7 hours ago
JSON representation

Repository metadata

Rewrite of the General Estuarine Transport Model (GETM) in Python (mostly) and Fortran (performance-critical sections)

README.md

pygetm

This is a rewrite of the General Estuarine Transport Model (GETM).
It is mostly written in Python; only performance-critical sections of the code are
implemented in Fortran.

Installing

First, ensure you have Anaconda:

  • Linux/Mac: execute conda --version in a terminal
  • Windows: look for "Anaconda prompt" in the start menu

On some systems (notably, HPC clusters), you may need to load an anaconda module first:
try module load anaconda or module load anaconda3

If you do not have Anaconda, install Miniconda.

From here on, we will be working in a terminal window. On Windows, open a terminal by choosing "Anaconda prompt" in the start menu.

Install a prebuilt version from conda-forge

To install or update pygetm:

conda install -c conda-forge pygetm

Manual build and install

If you need a customized version of pygetm, for instance, built with specific compiler
options, or with specific biogeochemical models that are not part of the standard
FABM distribution, you can manually obtain the pygetm source code,
build it, and then install it.

To obtain the repository with setups and scripts, first set up and activate a conda
environment with all necessary build tools:

git clone --recursive https://github.com/BoldingBruggeman/getm-rewrite.git
cd getm-rewrite
conda env create -f environment.yml
conda activate pygetm

If you are installing on an system that already has a Fortran
compiler and MPI libraries that you would like to use, replace environment.yml with
environment-min.yml in the above.

The above requires that you already have Git installed.
If you do not, you can install this with conda install -c conda-forge git.

Finally, to build on Linux/Mac, execute

source ./install

If you are using a different shell than bash, you may need to replace source by bash.

On Windows, you build pygetm with

install.bat

You can customize the build step as follows:

  • To set the Fortran compiler, set environment variable FC to your desired Fortran
    compiler executable. For instance, in a bash shell: export FC=ifort. This can be done
    in your terminal before running the install script, or by adding it to the install
    script itself.
  • To set compilation flags, set environment variable FFLAGS to your desired flags.
    For instance, in a bash shell: export FFLAGS=-fcheck=all. This can be done in your
    terminal before running the install script, or by adding it to the install script
    itself.
  • To set cmake options used to compile FABM, such as -DFABM_EXTRA_INSTITUTES or
    -DFABM_<INSTITUTE>_BASE, add cmake_opts=<CMAKE_OPTIONS> to python/setup.cfg

Staying up to date

To update this repository including its submodules (GOTM, FABM, etc.), make sure you are
in the getm-rewrite directory and execute:

git pull
git submodule update --init --recursive
conda env update -f <ENVIRONMENT_YML>
conda activate pygetm

In the above, replace <ENVIRONMENT_YML> with the name of the environment file you used
previously: environment.yml for stand-alone conda environments, or environment-min.yml
for a setup that uses the local MPI implementation and Fortran compiler.

Finally, rebuild by executing source ./install on Linux/Mac, or install.bat on Windows.

Using pygetm

You should always activate the correct Python environment before you use the model with
conda activate pygetm. This needs to be done any time you start a new shell.

Jupyter Notebooks

The best place to start is the python/examples
directory with Jupyter Notebooks that demonstrate the functionality of the model:

cd python/examples
python -m jupyterlab

Simulations

Some of the original GETM test cases have been ported to pygetm:

To run a simulation:

python <RUNSCRIPT.py> [OPTIONS]

To run in parallel:

mpiexec -n <NCPUS> python <RUNSCRIPT.py> [OPTIONS]

Contributing

How to contribute to the development:

  1. Make a fork of the
    repository under your private GitHub account(*)
  2. Commit your changes to your forked repository
  3. Make a pull request

Note that all communication in relation to development of GETM is done via
GitHub using issues.

(*) If you use a service other than GitHub for your daily work - please have a
look here

https://yarchive.net/comp/linux/collective_work_copyright.html


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 2,081
Total Committers: 5
Avg Commits per committer: 416.2
Development Distribution Score (DDS): 0.159

Commits in past year: 378
Committers in past year: 3
Avg Commits per committer in past year: 126.0
Development Distribution Score (DDS) in past year: 0.034

Name Email Commits
Jorn Bruggeman j****n@b****m 1751
Karsten Bolding k****n@b****m 305
Knut k****s@g****t 15
dependabot[bot] 4****] 9
markusReinert 5****t 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 23
Total pull requests: 34
Average time to close issues: 12 months
Average time to close pull requests: 6 days
Total issue authors: 7
Total pull request authors: 4
Average comments per issue: 1.7
Average comments per pull request: 0.94
Merged pull request: 15
Bot issues: 0
Bot pull requests: 29

Past year issues: 0
Past year pull requests: 25
Past year average time to close issues: N/A
Past year average time to close pull requests: 9 days
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.8
Past year merged pull request: 7
Past year bot issues: 0
Past year bot pull requests: 23

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/boldingbruggeman/getm-rewrite

Top Issue Authors

  • glessin (9)
  • bolding (9)
  • Beliavsky (1)
  • hpowley (1)
  • S-O-Ceallaigh (1)
  • jornbr (1)
  • knutaros (1)

Top Pull Request Authors

  • dependabot[bot] (29)
  • jornbr (3)
  • bolding (1)
  • markusReinert (1)

Top Issue Labels

  • enhancement (10)
  • bug (2)
  • help wanted (1)
  • question (1)

Top Pull Request Labels

  • dependencies (29)
  • submodules (25)
  • github_actions (4)
  • enhancement (1)
  • question (1)

Dependencies

.github/workflows/getm.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
python/airsea/setup.py pypi
python/setup.py pypi
environment.yml conda
  • cartopy
  • cmake
  • cmocean
  • cython
  • fortran-compiler
  • ipympl
  • jupyterlab
  • matplotlib
  • mpi4py
  • netcdf4
  • numpy
  • pip
  • proj
  • python >=3.8
  • pyyaml
  • scipy
  • xarray

Score: 4.605170185988091