Skip to content

Add soil property perturbation script for eCLM ensemble generation#73

Open
jjokella wants to merge 15 commits intomainfrom
dev-perturb
Open

Add soil property perturbation script for eCLM ensemble generation#73
jjokella wants to merge 15 commits intomainfrom
dev-perturb

Conversation

@jjokella
Copy link
Copy Markdown
Collaborator

@jjokella jjokella commented Mar 13, 2026

Solves #72

Provides perturbed surface files for
https://hpscterrsys.github.io/eCLM/users_guide/introduction/soil_hydraulic_parameters.html

Summary

  • Add perturb_soil_properties.py for generating perturbed eCLM
    surface file ensembles in two modes: hydraulic (Clapp-Hornberger
    pedotransfer functions with organic matter adjustment, perturbing
    PSIS_SAT, THETAS, SHAPE_PARAM, KSAT) and texture (additive uniform
    noise on PCT_SAND, PCT_CLAY, ORGANIC)
  • All paths configurable via CLI; output filenames derived from input file
    stem with zero-padded ensemble index
  • Perturbation spreads (Gaussian std devs, uniform noise half-range, clipping
    bounds) and number of perturbed levels exposed as CLI arguments with
    physically motivated defaults
  • --no-adj flag to write parameters without _adj suffix, selecting between
    soil_hyd_inparm_from_file_adj (default, all nlevgrnd layers, overwrites OM
    mixing) and soil_hyd_inparm_from_file (first nlevsoifl=10 layers, undergoes OM
    mixing)
  • --n-perturb-levels to restrict perturbation to the uppermost N layers;
    deeper layers receive unperturbed CLM mean values
  • Reproducibility via --seed (default: 42) and --state-file for
    saving/restoring RNG state to support resuming interrupted runs
  • Original author credited: Yorck Ewerdwalbesloh
  • Add README.md with full option reference and usage examples

Needs testing

  • Run --mode hydraulic twice with the same --seed and verify byte-identical
    output
  • Run --mode texture and verify sand + clay ≤ 100 % and no negative values
    throughout output
  • Interrupt a run, resume with --state-file and --start N, verify no gap or
    overlap in member numbering
  • Verify output NetCDF attributes contain correct perturbed_by (from $USER)
    and perturbed_on_date
  • Run with --no-adj and verify variable names lack _adj suffix and are
    accepted by eCLM with soil_hyd_inparm_from_file = .true.
  • Run with --n-perturb-levels N and verify levels ≥ N contain unperturbed CLM
    mean values

jjokella and others added 15 commits March 13, 2026 15:26
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant