https://github.com/cmcc-foundation/py_nemo_rebuild

Pythonic NEMO Rebuild Tool

https://github.com/cmcc-foundation/py_nemo_rebuild

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Pythonic NEMO Rebuild Tool

Basic Info
  • Host: GitHub
  • Owner: CMCC-Foundation
  • Language: Python
  • Default Branch: master
  • Size: 40 KB
Statistics
  • Stars: 1
  • Watchers: 4
  • Forks: 0
  • Open Issues: 0
  • Releases: 5
Created about 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme

README.md

Pythonic NEMO Rebuild Tool

Rebuild NEMO/XIOS multiple output/restart files in a single file.

Getting Started

This is a python script which rebuilds NEMO/XIOS output/restart files split over multiple subdomains in a single file. While the script can be run sequentially (i.e. single task), it is designed to run in parallel (SPMD) leveraging the MPI library, in order to speed up the reconstruction.

Setup Anaconda environment

The working environment can be setup using the provided anaconda3 environment.yml file: ``` conda env create -f environment.yml

conda activate nemo_rebuild ```

[!IMPORTANT] In order to avoid issues during later updates, it is necessary to pin the netCDF4 and MPICH python modules in the anaconda environment :

echo 'netcdf4 * *mpich*' >> ${CONDA_PREFIX}/conda-meta/pinned echo 'mpich * *external*' >> ${CONDA_PREFIX}/conda-meta/pinned

[!IMPORTANT] The choice of the external build of the MPICH package enable the use of the MPI library installed on the HPC platform (Intel MPI, etc...), provided that the environment is properly set up (e.g. module load impi-2021.6.0/2021.6.0).

Usage of nemo_rebuild.py

First of all the correct environment needs to be set up with: module load impi-2021.6.0/2021.6.0 # or whatever MPI library is available on the HPC platoform conda activate nemo_rebuild Once the environment is properly set up the script nemo_rebuild.py can be run:

``` python nemorebuild.py -h usage: mpirun -n N python nemorebuild.py [-h] -i IN_FILE [-o OUT_FILE] [-n NUMDOM] [-f FILL] [-v VARIABLES] [-r] [-c] [--verbose] [-V]

NEMO output/restart file rebuilder

options: -h, --help show this help message and exit -i INFILE, --input INFILE input file name -o OUTFILE, --output OUTFILE output file name -n NUMDOM, --numdom NUMDOM Number of domains (input files) -f FILL, --fill FILL Fill missing domains with fill if no FillValue is present (default 0) -v VARIABLES, --variable VARIABLES Variable(s) to rebuild -r, --removehalo Remove global domain halo (rebuilt restart file won't work) -c, --classic use NetCDF4 Classic format (default: False) --verbose Verbose mode -V, --version show program's version number and exit

Rebuild NEMO/XIOS multiple output/restart files in a single file ```

IN_FILE can be one of: * Full name of a subdomain file, e.g. filebase_0000.nc * Base name of a subdomain file, e.g. filebase

Examples

The rebuild script can be run either sequentially or using MPI parallelization as described below.

Sequential run

We want to rebuild a set of NEMO restart files from ORCA1 configuration. The minimal command line to perform a simple sequential reconstruction is python nemo_rebuild.py -i ORCA1_01305240_restart and the script will automatically detect the number of subdomain files. In this case it's not mandatory to set up the MPI environment (module load ...).

Parallel run

Let's rebuild NEMO output files from ORCA025 configuration by using the MPI interface to speed up things ... mpirun -n N python nemo_rebuild.py -i ORCA025_1m_20000101_20000131_grid_T where N is the number of MPI tasks required. The number N of MPI tasks cannot exceed the number of subdomains and does not necessarily have to be an integer divisor of the number of subdomains.

Install as a package

When installed as a package, an executable named nemo_rebuild_py will be added to your path, so one can call it from anywhere, provided that the conda and MPI environments are properly set up. The package can be installed by launching: pip install . from the root folder of the repository.

Authors

Owner

  • Name: CMCC Foundation
  • Login: CMCC-Foundation
  • Kind: organization
  • Email: info@cmcc.it
  • Location: Lecce, Italy

Euro-Mediterranean Center on Climate Change

GitHub Events

Total
  • Release event: 3
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 4
  • Pull request event: 6
  • Create event: 6
Last Year
  • Release event: 3
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 4
  • Pull request event: 6
  • Create event: 6

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • pgf (4)
Top Labels
Issue Labels
Pull Request Labels
bug (1) enhancement (1)