ESCOMP / ESCOMP/CTSM

Bring text versions of paramfiles into version control

Open
#3,414 1 comment 0 reactions 0 assignees View on GitHub
b4b enhancement
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
6d 6h
Merged PRs (30d)
8

Description

It’s scary easy to drop someone else’s changes when multiple people are working on updates simultaneously! I did this to Linnia a while back, and we might have such a situation developing again now.

We could do something like FATES where we have CDL copies of them in our repo. This would allow us to bring them under version control. Then we could use GitHub Workflows to ensure that netCDF versions of those CDL files (a) have been `rimport`ed and (b) match the contents before we merge to important branches.

How would this interact with query/set_paramfile scripts (Issue #3399; PR #3397)?
- Would provide a way to use and test those scripts without having to be on a supported system or hitting the SVN server. Would also allow us to avoid relying (exclusively) on the paramfile added to repo for Python unit/system testing in #3397, which will soon be outdated—it'd be better to always work with the most recent default paramfiles.
- Have them be able to read and write either netCDF or CDL files.
- Ideally we’d use something like `ncgen` and `ncdump` but in Python so we can have it in `ctsm_pylib`. (Rather than calling out to those.)
- We don’t have anything that fits the bill now. `cdlparser` could work for reading CDL files, but dumping is harder.
- Maybe use a format other than CDL for the text version. Could even use YML! We don’t need it to read/written with standard CESM-compatible Python.
- Would be a lot of work. Maybe as a first pass we could just require those command-line utilities to be installed for reading from or writing to CDL files.

Other thoughts on implementation details:
- How would we handle Sean’s new “spatial parameters?” Would be annoying/impractical to have those in CDL form. Maybe just don’t include spatial parameters; have a separate `paramfile_spatial` for those if needed.
- Keep CDL filenames constant (match whatever criteria we have in the XML file), but update global attribute `netcdf_path` when we need to make a new version.
- Ensure that `ncdump` uses the right precision (`ncdump -p 9,17`): https://github.com/ESCOMP/CTSM/wiki/Moving-a-parameter-to-the-params-file
- ↑ Add tools `paramfile_nc_to_cdl` and `paramfile_cdl_to_nc`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.