https://github.com/access-nri/um2nc-standalone
Standalone um2nc/um2netcdf to unify development efforts in a single repository.
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.2%) to scientific vocabulary
Keywords
Repository
Standalone um2nc/um2netcdf to unify development efforts in a single repository.
Basic Info
Statistics
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 72
- Releases: 2
Topics
Metadata Files
README.md
um2nc: Unified Model to netCDF post-processing
About
um2nc is a Python utility for converting Unified Model (UM) data files to netCDF format. um2nc is developed by ACCESS-NRI to support users of ACCESS models that contain a Unified Model component, including ACCESS-CM2 and ACCESS-ESM1.5.
Installation
Gadi
On Gadi, um2nc is available within the vk83 payu environment.
To access it, run:
module use /g/data/vk83/modules
module load payu
[!IMPORTANT]
You need to be a member of thevk83project on NCI to access the module. For more information check how to Join relevant NCI projects
Local installation
um2nc is available as a conda package in the access-nri conda channel.
To install it run:
conda install accessnri::um2nc
Usage instructions
um2nc utilities for converting UM files to netCDF can be accessed through the command line or as a Python3 API. This user documentation details the available command line utilities:
* um2nc
* esm1p5_convert_nc
um2nc
The um2nc command converts a single UM file to a netCDF file.
Usage
um2nc [options] infile outfile
Positional Arguments
- infile The path of the UM input file to convert to netCDF.
- outfile The path of the netCDF output file.
Optional Arguments
User information options:
* -h, --help Display a help message and exit.
* -v, --verbose Display verbose output (use -vv for the highest level of output).
Output file format options:
* -k NC_KIND NetCDF output format. Choose among 1 (classic), 2 (64-bit offset), 3 (netCDF-4), 4 (netCDF-4 classic). Default: 3 (netCDF-4).
* -c COMPRESSION NetCDF compression level. 0 (none) to 9 (max). Default: 4.
* --64 Write 64 bit output when input is 64 bit. When absent, output will be 32 bit.
Variable selection options:
--include ITEM_CODE_1 [ITEM_CODE_2 ...]List of variables to include in the output file, specified by their item codes. Item codes are given in the form1000 * section number + item number. Any other variables present in the input file will not be written to the output file.--exclude ITEM_CODE_1 [ITEM_CODE_2 ...]List of variables to exclude from the output file, specified by their item codes. Item codes are given in the form1000 * section number + item number. All other variables present in input file will be written to output file.
The options --include and --exclude cannot be used simultaneously. When neither are present, all variables in the input file will be written to the output file.
Masking options:
Points on a pressure level grid may fall below ground-level in some fields of the input file. When Heaviside masking is enabled, pressure level data that were located above ground-level for less than the critical time fraction HCRIT will be masked.
By default, variables on pressure level grids that fall below-ground level will be masked with the appropriate Heaviside variable found in the input file. If the Heaviside variable cannot be found, these variables will be omitted from the output. This behaviour can be controlled by the following options:
--hcrit HCRITMinimum fraction of the time spent above ground-level for a pressure grid data point to be considered valid. Data points in pressure grid variables will be masked if they were above ground-level for less than the critical fractionHCRITof the time. This option has no effect when used together with the--nomaskoption. Default0.5.--nomaskDon't mask variables on pressure level grids. When selected, unmasked pressure level variables will be written to the output file regardless of the presence of the Heaviside variable.
Metadata options:
--model MODELLink STASH codes to variable names and metadata using a preset STASHmaster associated with a specific model. Supported options arecmip6,access-cm2,access-esm1.5, andaccess-esm1.6. If omitted, thecmip6STASHmaster will be used.--nohistDon't add a global history attribute to the output file. When absent, the conversion time,um2ncversion, and the script location will be added to thehistoryglobal netCDF attribute.--simpleUse the simple variable naming scheme. Variables in the output file will be named based on their STASH section number and item code, in the formatfld_s<section number>i<item number>. When absent, variable names will be taken from the selectedSTASHmaster(see the--modelargument).
esm1p5_convert_nc
The esmp1p5_convert_nc command is designed to be run automatically during payu based simulation of ACCESS-ESM1.5. It converts all UM output files from a single experiment run to netCDF, and is typically included in a simulation as a payu userscript.
Usage
esmp1p5_convert_nc [options] current_output_dir
Positional arguments
- current_output_dir Path to an ACCESS-ESM1.5 simulation's output directory. Any UM output files in the current_output_dir/atmosphere subdirectory will be converted to netCDF and placed in a new directory current_output_dir/atmosphere/netCDF.
Optional Arguments
--help, -hDisplay a help message and exit.--delete-ff, -dDelete Unified Model output files upon successful conversion.--quiet, -qReport only final exception type and message for any expectedum2ncexceptions raised during conversion. If absent, full stack traces are reported.
esm1p5_convert_nc uses the same underlying workflow as the um2nc command to convert each file, and applies the following arguments:
* -k 3
* -c 4
* --simple
* --hcrit 0.5
Supported files
um2nc supports the conversion of Unified Model output and restart files. Ancillary files and files containing timeseries are currently not supported.
Development/Testing instructions
For development/testing, it is recommended to install um2nc as a development package within a micromamba/conda testing environment.
Clone um2nc-standalone GitHub repo
git clone git@github.com:ACCESS-NRI/um2nc-standalone.git
Create a micromamba/conda testing environment
[!TIP]
In the following instructionsmicromambacan be replaced withconda.
cd um2nc-standalone
micromamba env create -n um2nc_dev --file .conda/env_dev.yml
micromamba activate um2nc_dev
Install um2nc as a development package
pip install --no-deps --no-build-isolation -e .
Running the tests
The um2nc-standalone project uses pytest and pytest-cov.
To run the tests and generate a coverage report (with missing lines) run:
python3 -m pytest --cov-report=term-missing --cov=um2nc
[!TIP] To generate an HTML coverage report substitute
term-missingwithhtml.
Further information
um2nc is developed and supported by ACCESS-NRI to facilitate the use of ACCESS models and data.
Requests for support in using um2nc can be made on the ACCESS-HIVE Forum. Bug reports and suggestions are welcomed as GitHub issues.
Owner
- Name: ACCESS-NRI
- Login: ACCESS-NRI
- Kind: organization
- Email: access.nri@anu.edu.au
- Website: https://www.access-nri.org.au/
- Repositories: 17
- Profile: https://github.com/ACCESS-NRI
Australian Earth System Simulator - National Research Infrastructure
GitHub Events
Total
- Create event: 34
- Release event: 2
- Issues event: 55
- Delete event: 30
- Issue comment event: 103
- Push event: 101
- Pull request review event: 161
- Pull request review comment event: 109
- Pull request event: 45
Last Year
- Create event: 34
- Release event: 2
- Issues event: 55
- Delete event: 30
- Issue comment event: 103
- Push event: 101
- Pull request review event: 161
- Pull request review comment event: 109
- Pull request event: 45
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 21
- Total pull requests: 11
- Average time to close issues: about 1 month
- Average time to close pull requests: 8 days
- Total issue authors: 8
- Total pull request authors: 4
- Average comments per issue: 0.48
- Average comments per pull request: 1.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 21
- Pull requests: 11
- Average time to close issues: about 1 month
- Average time to close pull requests: 8 days
- Issue authors: 8
- Pull request authors: 4
- Average comments per issue: 0.48
- Average comments per pull request: 1.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- truth-quark (66)
- atteggiani (17)
- blimlim (16)
- MartinDix (10)
- aidanheerdegen (3)
- tammasloughran (1)
- penguian (1)
- matlipson (1)
- Whyborn (1)
Pull Request Authors
- truth-quark (36)
- blimlim (20)
- atteggiani (17)
- MartinDix (2)
- tammasloughran (1)
- aidanheerdegen (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v4 composite
- conda-incubator/setup-miniconda 11b562958363ec5770fef326fe8ef0366f8cbf8a composite
- uibcdf/action-build-and-upload-conda-packages c6e7a90ad5e599d6cde76e130db4ee52ad733ecf composite
- actions/checkout v4 composite
- actions/checkout v4.1.7 composite
- actions/download-artifact v4 composite
- actions/upload-artifact v4 composite
- codecov/codecov-action v4 composite
- conda-incubator/setup-miniconda 11b562958363ec5770fef326fe8ef0366f8cbf8a composite
- conda-incubator/setup-miniconda v3 composite
- PyYAML *
- cf-units *
- cftime *
- f90nml *
- mule *
- netCDF4 *
- numpy *
- scitools-iris *
- anaconda-client
- conda-build
- conda-verify
- pylint
- pytest
- pytest-cov
- versioneer