Skip to content

Conversation

@samsrabin
Copy link
Member

@samsrabin samsrabin commented Aug 7, 2025

Description of changes

usage: query_paramfile [-h] -i INPUT [-p PFT] [variables ...]

Print values of one or more parameters from a CTSM paramfile.

positional arguments:
  variables          Names of variables to query (space-separated)

options:
  -h, --help         show this help message and exit
  -i, --input INPUT  Input netCDF file
  -p, --pft PFT      Comma-separated list of PFT names to print (only applies to PFT-specific variables)
usage: set_paramfile [-h] -i INPUT -o OUTPUT [-p PFT] [--drop-other-pfts] [-v VARIABLES] [param_changes ...]

Change values of one or more parameters in a CTSM paramfile.

positional arguments:
  param_changes         Parameter changes to apply. Use nan to set to the fill value. E.g.:
                           param1=new_value1 pftparam=pft1_val,nan,... param3=nan

options:
  -h, --help            show this help message and exit
  -i, --input INPUT     Input netCDF file
  -o, --output OUTPUT   Output netCDF file. Must not already exist.
  -p, --pft PFT         Comma-separated list of PFTs to include (only applies to PFT-specific variables)
  --drop-other-pfts     Do not include PFTs other than the ones given in -p/--pft
  -v, --variables VARIABLES
                        Comma-separated list of variables to extract

Finishing up:

  • Add/edit docstrings
  • Add docs
  • Test editing a 1-d parameter that's not PFT-dimensioned

Optional? We definitely want this functionality, but it doesn't necessarily have to be this PR.

  • Modularize and test using individual parts.
  • Handle multidimensional parameters

Specific notes

Contributors other than yourself, if any: None

CTSM Issues Fixed:

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Does this create a need to change or add documentation? Did you do so? Yes; no.

Testing performed, if any:

  • Lots of Python unit and system tests for the new scripts and supporting functions.
  • New CIME SystemTest SETPARAMFILE (change a couple of parameters and run with the new paramfile) passes.
  • clm_pymods

@samsrabin samsrabin self-assigned this Aug 7, 2025
@samsrabin samsrabin added enhancement new capability or improved behavior of existing capability bfb bit-for-bit usability Improve or clarify user-facing options labels Aug 7, 2025
@samsrabin samsrabin changed the title New tool: query_paramfile New tools: query_paramfile and set_paramfile Aug 12, 2025
ekluzek and others added 27 commits August 20, 2025 21:06
…plicit tests for subgrid levels not supported: lndgrid and cohort and for unspecified, right now these fail
…or messaging gives as much information as possible about the error, also reuse the endrun_vanilla in the pt_context version to remove duplication
…ubgrid_level, but the original error sent in, this and the previous commit resolve ESCOMP#3420
…and add an option to it to avoid the abort, which is needed when it's used from an endrun call with pt_context
… show it still works even if only one is present
…e statement, for notes that are specific to a line in the subroutine, add NOTE: to most of them in response to review
@samsrabin samsrabin merged commit 113a63e into ESCOMP:b4b-dev Aug 21, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In progress - b4b-dev to Done (non release/external) in CTSM: Upcoming tags Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bfb bit-for-bit enhancement new capability or improved behavior of existing capability PR status: needs testing test: python Pass clm_pymods test suite plus Python sys/unit tests before merging usability Improve or clarify user-facing options

Projects

Status: Done (non release/external)

Development

Successfully merging this pull request may close these issues.

3 participants