Gridmarthe
gridmarthe is a Python project for (fast) Marthe grid operations.
MARTHE is a hydrogeological modelling code developped at BRGM, French Geological Survey (Thiery, 2020), and is available at https://www.brgm.fr/en/software/marthe-modelling-software-groundwater-flows
gridmarthe in a nutshell
gridmarthe allow users to read/write efficiently Marthe Grids (v9, v8,
constant_data, etc.) with python, for any MARTHE variable.
With the gridmarthe API, data are stored in a xarray dataset, and can be
manage with xarray functions (or numpy). Specific treatments/functions are
also provided by gridmarthe.
The package also install different command line tools: ncmart to convert
Marthe Grid to netCDF format, martshp to convert in shapefile/geopackage,
cleanmgrid to fix marthe grid format.
Full documentation and tutorials can be founded at https://gridmarthe.readthedocs.io
Grids are stored as a 2 dimensions matrix composed of a 1D spatial vector and a time dimension (Reduced Horizontal Grid, as recommended for lossless compression by gathering in cf-conventions: see cf-compression-gathering and cf-reduced-horizontal-grid). This means that the spatial domain is flatten in grid, and each point is associated with a index, a x coordinate, a y coordinate, eventually a z coordinate (number of layer in most cases), and dx, dy values.
The x, and y coordinates are the center of cell. dx, dy are the
dimensions of the cell.
Installation
From pip
On pip, gridmarthe is available for GNU/Linux, and Windows for python >=3.10.
Users can install it with:
pip install gridmarthe
# or with all optional dependencies
pip install gridmarthe[opt]
For UNIX systems, the package needs gfortran/gcc shared libraries to run. For example, using a Debian-based GNU/Linux distribution, one can install gcc with:
sudo apt install gcc gfortran
From conda-forge
gridmarthe is also available in the conda-forge channel (Linux, Windows).
Conda users can install it with:
conda install gridmarthe
# or, with mamba
mamba install gridmarthe
From sources
gridmarthe use some Fortran modules which need to be compiled before local
installation, hence user/developer who want to install from sources will need a
Fortran and a C compiler.
Compilation and installation
Get the sources :
git clone https://gitlab.com/brgm/hydrogeological-modelling/marthe-tools/gridmarthe
cd gridmarthe
With pip (Unix-like OS)
On a Unix-like machine, with gfortran, ninja-build, python3, the project
Makefile will compile Fortran sources and install in development mode
(i.e. with editable flag) the package.
make requirements
make
or, without the development/editable mode :
pip install .
On a Windows machine, it is possible to compile with gfortran/gcc
(mingw project https://mingw-w64.org/ or https://winlibs.com/#download-release ;
it can also be installed with chocolatey choco install mingw, or with conda
with conda-forge packages mingw-w64, gcc and gfortran).
With conda (recommended on Windows)
It is also possible to install gridmarthe in a conda environment. An environment file is provided (example with mamba):
mamba env create -n gm -f environment.yml
mamba activate gm
make
This will install the library using pip editable mode, but with dependencies installed from conda-forge.
Alternatively, you can use conda-build and the conda develop command to
install the library in development mode.
mamba env create -n gm -f environment.yml
mamba activate gm
make conda-dev
On Windows, it is also possible to use a different compiler, for compatibility
issues with other libraries. For example, use llvm compilers (flang and
clang) instead of gfortran and gcc. To do so, use the following command:
mamba env create -n gm -f tools/env/conda_dev_llvm.yml
mamba activate gm
make conda-dev FC=flang CC=clang LD=lld
Warning: this approach requires an installation of VStudio.
Usage
Simple examples can be found in the documentation.
License
This program is free software and released under the terms of the GNU General Public License (version 3 or later).
Authors and acknowledgment
gridmarthe is released by (C) BRGM, French Geological Survey
Authors and contributors:
- A. Manlay,
- J.P. Vergnes,
- S. Wang,
- S. Lopez,
- S. Magne,
- T. Hallouin
References
Thiery, D. (2020). Guidelines for MARTHE v7.8 computer code for hydro-systems modelling (English version) (Report BRGM/RP-69660-FR; p. 246 p.) http://ficheinfoterre.brgm.fr/document/RP-69660-FR
Metadata
Release files for gridmarthe 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gridmarthe-0.5.1.tar.gz | 183.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| gridmarthe-0.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 free-threading | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| gridmarthe-0.5.1-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
| gridmarthe-0.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| gridmarthe-0.5.1-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| gridmarthe-0.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| gridmarthe-0.5.1-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| gridmarthe-0.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| gridmarthe-0.5.1-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| gridmarthe-0.5.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
Total release size: 14.5 MB
Release files / gridmarthe-0.5.1.tar.gz
| Download URL | gridmarthe-0.5.1.tar.gz |
|---|---|
| Size | 183.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2688580f5c9277d777ab3aa8b5fdec468db27b5d8ed5121d2be573a7286d6b9
|
|
BLAKE2b-256 checksum How to use checksums |
0f1e927856140b03dbd2ab6a9cbf2b6161af0d1a0888d432de2b382d50c4a92b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gridmarthe-0.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c02d751dd44eb8c62308f905fca7368542646f6c1bedd6c72f14d5b97e514e24
|
|
BLAKE2b-256 checksum How to use checksums |
57b66a92cc49388518ed06453966966d09012e7e0a62583bc9ac55b5fb11b0ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp314-cp314-win_amd64.whl
| Download URL | gridmarthe-0.5.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d76ce0d8b9e15a3ea212dc2e636c3367c5a3a1f167639dcbed5ee86b5522652f
|
|
BLAKE2b-256 checksum How to use checksums |
0f7e2c1257352101a6c9648097b2cdaec250266d7ded94964c09689b8fff208f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gridmarthe-0.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b9be1f2efb833ebf4f871a518efc54949f2af27172669bf2fa3a5a4ce6a78058
|
|
BLAKE2b-256 checksum How to use checksums |
37098bda14845b31aa8dd9162ebd6601dbde9fd573a8be452db1cafa208d4062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp313-cp313-win_amd64.whl
| Download URL | gridmarthe-0.5.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7eb95bc1383a1adad052a5a459ae408af9df7416b52acfabcb65ea3187eda940
|
|
BLAKE2b-256 checksum How to use checksums |
83940976f69dacd29c8ae29fa8f2e7e34e4afa8cdca8253494b685b73d26ba7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gridmarthe-0.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d3615010a02f7438b972704260a6c77d279f31446387c691c30e83ed2cfc7247
|
|
BLAKE2b-256 checksum How to use checksums |
87b7b9899e900ad5745c7749cd723ee33624ba79686920b0dadc5f7f07b14209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp312-cp312-win_amd64.whl
| Download URL | gridmarthe-0.5.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cc1e2f38fac4d78a3b0204c62ec0386308c14e6a94ac533cfe63b7240ee0fe59
|
|
BLAKE2b-256 checksum How to use checksums |
8249338f3e49e08599fcfe55a0501f204af124bedb71e5fe37172bd0f99b21de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gridmarthe-0.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
76ba02e17a0c84e7da04a6f83c5694e1441ddff1761b3a270d1b1bb1179c3707
|
|
BLAKE2b-256 checksum How to use checksums |
d4c02bab5d8a065f30321f1f70e367c605f11f31c99ad600a0fac3646f1b244f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp311-cp311-win_amd64.whl
| Download URL | gridmarthe-0.5.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6c62a853e7861ee2dc3b1554f5d8000ada658661e7306717c103c9b52931e771
|
|
BLAKE2b-256 checksum How to use checksums |
7e9a79b9afa28f2e010bba8e15c90eaa93ca912241356df98b02d254cb0617f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency logRelease files / gridmarthe-0.5.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gridmarthe-0.5.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
347721445209e787d1e917bf0bec42ccbd3a273d6e66ddd8353c247044f57cbd
|
|
BLAKE2b-256 checksum How to use checksums |
9d779e059933ec011887f9c27e7dfb6f204313cb7217a3216f503d25074f95e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.
Transparency log