Skip to content

Create a script to create custom parameter files needed for our testmods to reduce maintence #3034

Description

@slevis-lmwg

We have two /testmods using custom paramfiles, and I'm adding a third in #1654:

ciso_cwd_hr/user_nl_clm:paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_ciso_cwd_hr_params.c250311.nc'
clm60_monthly_matrixcn_soilCN30/user_nl_clm:paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c250311.nc'
leafcn_t_evolving/user_nl_clm:paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_ceta450_cn30_co2_slope30.c250326.nc'

@ekluzek and @slevis-lmwg agreed (2025/3/26) to reduce file maintenance by consolidating our custom paramfiles into one.

@slevis-lmwg already generated and will use the consolidated paramfile in #1654 (file above dated c250326).

Replacing the other two custom paramfiles with the consolidated file needs to wait for an answer-changing PR (and/or paramfile-updating PR), so I'm posting this issue as a reminder.

UPDATE:

In the 4/3/2025 CTSM SE meeting we decided that a better way forward would be to create a script that creates the parameter files needed for testing. This would even be useful for creating a single file. But, if you have a script for one, you might as well run it three times to create three different files. @slevis-lmwg and I thought that the options were different enough that we wouldn't see interactions if one of the tests fails. But, clearly it's better if you don't even need to think about it. And having a script could also encourage us to add new tests that change something important in parameter files that needs testing.

Definition of Done:

  • Spend some time to think about how this should be done (I think this should be python using xarray?)
  • Make some notes on that
  • Create the script and add it to one of the testmod directories that need it
  • The other testmods should note in their README file about it's usage

Activity

  1. added
    testingadditions or changes to tests
    nextthis should get some attention in the next week or two. Normally each Thursday SE meeting.
    non-b4bChanges answers (incl. adding tests)
    test: aux_clmPass aux_clm suite before merging
    on Mar 26, 2025
  2. removed
    nextthis should get some attention in the next week or two. Normally each Thursday SE meeting.
    on Apr 3, 2025
  3. samsrabin commented on Apr 3, 2025

    @samsrabin
    Member

    Would doing this pose the risk of making it hard to distinguish the reason for test failure? A perhaps better alternative, if the idea is to reduce maintenance cost, would be to add a little script in each testmod directory that makes its test paramfile from the standard one. And there could a parent script that calls the script for each testmod.

  4. removed
    non-b4bChanges answers (incl. adding tests)
    on Apr 3, 2025
  5. changed the title [-]Consolidate our custom paramfiles into one to reduce maintenance[/-] [+]Create a script to create custom parameter files needed for our testmods to reduce maintence[/+] on Apr 3, 2025
  6. ekluzek commented on Mar 10, 2026

    @ekluzek
    Contributor

    @slevis-lmwg and I talked about this again. @samsrabin has a good idea to have a parent script and then a script in each testmod directory that needs a specific change to the paramfile. The new paramfile tools should make doing this sort of thing easier as well. An alternative would be to have the testmod make the paramfile on the fly when the test is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    size: smalltest: aux_clmPass aux_clm suite before mergingtestingadditions or changes to tests

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions