Skip to content

Commit ade72af

Browse files
committed
Merge branch 'master' into dev-grace-da
2 parents 5d3983c + 91d5f7b commit ade72af

5 files changed

Lines changed: 325 additions & 135 deletions

File tree

CONTRIBUTORS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Marco VAN HULTEN
66
Ana GONZALEZ-NICOLAS
77
Daniel CAVIEDES-VOULLIÈME
88
Olga DOMBROWSKI
9-
9+
Yorck EWERDWALBESLOH
10+
Fernand ELOUNDOU

docs/_toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ parts:
1010
- file: users_guide/introduction/introduction
1111
title: Scientific Background
1212
- file: users_guide/introduction/perturbation
13-
title: Perturbation routines
13+
title: Atmospheric forcing noise
14+
- file: users_guide/introduction/soil_hydraulic_parameters
15+
title: Soil hydraulic properties from surface file
1416

1517
- caption: User's Guide
1618
chapters:

docs/users_guide/introduction/perturbation.md

Lines changed: 40 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# Perturbation routines #
1+
# Atmospheric forcing noise #
22

3-
This section describes **perturbation capabilities for eCLM-PDAF**.
3+
This section describes **atmospheric forcing noise for eCLM-PDAF**.
44

5-
The implementation of the perturbation routines was first introduced
6-
by Yorck Ewerdwalbesloh in
7-
https://gitlab.jsc.fz-juelich.de/detect/cluster-c/c01/perturbationroutineclm5.
5+
The implementation of the atmospheric forcing perturbation routines
6+
was first introduced by Yorck Ewerdwalbesloh.
87

9-
## Description
8+
## General Description
109

1110
eCLM implements perturbations for atmospheric forcing variables
1211
(temperature, precipitation, longwave radiation, and shortwave
@@ -43,33 +42,7 @@ is adjustable based on application requirements.
4342
Perturbation fields are read from preprocessed noise files and applied
4443
to atmospheric forcing variables within the eCLM model during runtime.
4544

46-
## Key Components ##
47-
48-
### 1. Soil Parameter Perturbation (`SoilStateInitTimeConstMod.F90`) ###
49-
50-
Allows reading perturbed hydraulic parameters from input files instead of computing them via pedotransfer functions.
51-
52-
**Parameters:**
53-
- `THETAS` - saturated water content
54-
- `SHAPE_PARAM` - Brooks-Corey shape parameter (`bsw`)
55-
- `PSIS_SAT` - saturated matric potential (`sucsat`)
56-
- `KSAT` - saturated hydraulic conductivity (`xksat`)
57-
58-
**Implementation:**
59-
- Reads both original parameters (for `nlevsoifl=10` soil layers) and
60-
applies organic matter mixing
61-
- OR: Reads adjusted parameters with `_adj` suffix (for all `nlevgrnd`
62-
layers) and **overwrites** parameters from organic matter mixing.
63-
- Falls back to pedotransfer functions if parameters aren't in the file
64-
- Modifies organic matter mixing to preserve perturbed parameter values
65-
66-
#### Note about the Brooks-Corey Shape Parameter ####
67-
68-
When perturbed soil parameters are read from input files, the organic
69-
matter mixing for `bsw` uses the file-read value instead of the
70-
hard-coded Cosby et al. (1984) Table 5 formula (`2.91 + 0.159*clay`).
71-
72-
### 2. Noise-Based Forcing Perturbation ###
45+
## 1. Noise-Based Forcing Perturbation ##
7346

7447
When having an ensemble run, the memory consumption is too large if
7548
the forcing data is perturbed one by one so that I get a file for each
@@ -102,44 +75,18 @@ data assimilation.
10275
- Detects noise fields by checking if model field name contains `"noise"`
10376
- Adjusts time coordinate reading to account for ensemble-extended noise files
10477

105-
### 3. DATM Integration (`datm_comp_mod.F90`) ###
106-
107-
Passes ensemble information (`inst_index`, `dt_option`, `ninst`) from
108-
the data atmosphere (DATM) component to the stream infrastructure,
109-
enabling the noise perturbation mechanism to operate correctly within
110-
CESM's multi-instance framework.
111-
112-
## Design Rationale ##
113-
114-
1. **Dual perturbation approach**:
115-
- Parameter perturbation for soil properties (offline preprocessing)
116-
- Forcing perturbation via temporal noise patterns (runtime)
117-
118-
2. **Backward compatibility**: All changes are guarded by `USE_PDAF` preprocessor directives
119-
120-
3. **Efficiency**: Uses a single noise file for all ensemble members by time-shifting, avoiding storage duplication
121-
122-
4. **Flexibility**: Soil parameters can be perturbed or computed traditionally based on file contents
123-
124-
## Modified Source Code ##
125-
126-
- `src/clm5/biogeophys/SoilStateInitTimeConstMod.F90`
127-
- `src/csm_share/streams/shr_stream_mod.F90`
128-
- `src/csm_share/streams/shr_strdata_mod.F90`
129-
- `src/csm_share/streams/shr_dmodel_mod.F90`
130-
- `src/datm/datm_comp_mod.F90`
131-
132-
## Preparing Atmospheric Forcing Noise
78+
### Preparing Atmospheric Forcing Noise ###
13379

13480
This section describes the workflow for generating and configuring
13581
spatiotemporally correlated noise fields for atmospheric forcing
13682
perturbations.
13783

138-
### Noise Generation Tool
84+
#### Noise Generation Tool ####
13985

140-
The `tools/correlatedNoise.py` script generates monthly NetCDF files
141-
containing spatiotemporally correlated noise fields for all ensemble
142-
members.
86+
The `correlatedNoise.py`
87+
(https://github.com/HPSCTerrSys/eCLM_atm-forcing-generator/pull/8)
88+
script generates monthly NetCDF files containing spatiotemporally
89+
correlated noise fields for all ensemble members.
14390

14491
**Key Configuration Parameters:**
14592

@@ -153,7 +100,7 @@ members.
153100

154101
**Output**: One NetCDF file per month containing noise fields for all ensemble members and all perturbed variables.
155102

156-
### Stream File Configuration
103+
#### Stream File Configuration ####
157104

158105
Stream files configure how eCLM reads and applies noise fields to
159106
atmospheric forcing data. Three separate stream files are required
@@ -168,15 +115,15 @@ file must specify the following metadata fields:
168115
- **Perturbation variables**: `tbot_noise` (temperature), `lwdn_noise` (longwave radiation), `precn_noise` (precipitation), `swdn_noise` (shortwave radiation)
169116

170117

171-
### Stream File Examples
118+
#### Stream File Examples ####
172119

173120
The following examples demonstrate proper stream file configuration
174121
for precipitation, solar radiation, and other atmospheric
175122
variables. Each example must be adapted with correct file paths,
176123
temporal parameters, and ensemble member IDs for your specific
177124
application.
178125

179-
#### Precipitation Noise Stream File
126+
##### Precipitation Noise Stream File #####
180127

181128
**File**: `user_datm.streams.precip_noise.stream_0000.txt`
182129

@@ -235,7 +182,7 @@ application.
235182
</fieldInfo>
236183
```
237184

238-
#### Solar Radiation Noise Stream File
185+
##### Solar Radiation Noise Stream File #####
239186

240187
**File**: `user_datm.streams.solar_noise.stream_0000.txt`
241188

@@ -294,7 +241,7 @@ application.
294241
</fieldInfo>
295242
```
296243

297-
#### Temperature and Longwave Radiation Noise Stream File
244+
##### Temperature and Longwave Radiation Noise Stream File #####
298245

299246
**File**: `user_datm.streams.other_noise.stream_0000.txt`
300247

@@ -354,3 +301,26 @@ application.
354301
</fieldInfo>
355302

356303
```
304+
305+
## 2. DATM Integration (`datm_comp_mod.F90`) ##
306+
307+
Passes ensemble information (`inst_index`, `dt_option`, `ninst`) from
308+
the data atmosphere (DATM) component to the stream infrastructure,
309+
enabling the noise perturbation mechanism to operate correctly within
310+
CESM's multi-instance framework.
311+
312+
## Design Rationale ##
313+
314+
1. **Backward compatibility**: All changes are guarded by `USE_PDAF`
315+
preprocessor directives
316+
317+
2. **Efficiency**: Uses a single noise file for all ensemble members
318+
by time-shifting, avoiding storage duplication
319+
320+
## Modified Source Code ##
321+
322+
- `src/csm_share/streams/shr_stream_mod.F90`
323+
- `src/csm_share/streams/shr_strdata_mod.F90`
324+
- `src/csm_share/streams/shr_dmodel_mod.F90`
325+
- `src/datm/datm_comp_mod.F90`
326+
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# Soil Hydraulic Parameters #
2+
3+
This section describes **setting Soil Hydraulic Parameters from the
4+
surface file**.
5+
6+
The implementation was first introduced by Fernand Eloundou and
7+
adapted by Yorck Ewerdwalbesloh.
8+
9+
## Soil Parameter Perturbation (`SoilStateInitTimeConstMod.F90`) ##
10+
11+
Allows reading perturbed hydraulic parameters from input files instead
12+
of computing them via pedotransfer functions.
13+
14+
**Parameters:**
15+
- `THETAS` - saturated water content
16+
- `SHAPE_PARAM` - Brooks-Corey shape parameter (`bsw`)
17+
- `PSIS_SAT` - saturated matric potential (`sucsat`)
18+
- `KSAT` - saturated hydraulic conductivity (`xksat`)
19+
20+
**Implementation:**
21+
- Hydraulic parameters read from surface file
22+
- Reads EITHER original parameters (for `nlevsoifl=10` soil layers)
23+
and applies organic matter mixing OR: Reads adjusted parameters with
24+
`_adj` suffix (for all `nlevgrnd` layers) and **overwrites**
25+
parameters from organic matter mixing.
26+
- Falls back to pedotransfer functions if parameters aren't in the file
27+
- Modifies organic matter mixing to preserve perturbed parameter
28+
values
29+
30+
### Surface File
31+
32+
Soil hydraulic parameters are read from the **surface dataset file**,
33+
which is specified in the `lnd_in` namelist file under key `fsurdat`.
34+
35+
#### Sufrace File: Parameter Structure and Dimensions
36+
37+
All soil hydraulic parameters are stored as three-dimensional arrays
38+
with the structure:
39+
40+
```
41+
(nlevgrnd, lsmlat, lsmlon)
42+
```
43+
44+
Where:
45+
- `nlevgrnd`: Number of soil layers (vertical dimension, typically 25
46+
layers in eCLM simulations, see namelist file key
47+
`soil_layerstruct`)
48+
- `lsmlat`: Number of latitude grid points
49+
- `lsmlon`: Number of longitude grid points
50+
51+
This 3D structure enables depth-varying, spatially-distributed soil
52+
properties across the model domain.
53+
54+
#### Surface File: Input Parameter Format
55+
56+
Two options
57+
- parameters that undergo organic mixing
58+
- adjusted parameters that are used by input values
59+
60+
##### Parameters before organic mixing
61+
62+
The surface file must contain the following baseline parameters:
63+
64+
``` text
65+
THETAS(nlevgrnd, lsmlat, lsmlon)
66+
long_name: "Porosity"
67+
units: "vol/vol"
68+
69+
SHAPE_PARAM(nlevgrnd, lsmlat, lsmlon)
70+
long_name: "Shape (b) parameter"
71+
units: "unitless"
72+
73+
PSIS_SAT(nlevgrnd, lsmlat, lsmlon)
74+
long_name: "Saturated soil matric potential"
75+
units: "mmH2O"
76+
77+
KSAT(nlevgrnd, lsmlat, lsmlon)
78+
long_name: "Saturated hydraulic conductivity"
79+
units: "mm/s"
80+
```
81+
82+
These parameters apply to the first 10 soil layers (`nlevsoifl=10`) and
83+
undergo organic matter mixing.
84+
85+
##### Adjusted Parameters after organic mixing
86+
87+
For using adjusted soil parameters from file that represent the whole
88+
soil including organic matter, the surface file should contain
89+
adjusted parameters with the `_adj` suffix:
90+
91+
``` text
92+
THETAS_adj(nlevgrnd, lsmlat, lsmlon)
93+
long_name: "Porosity"
94+
units: "vol/vol"
95+
_FillValue: 1.e+30
96+
97+
SHAPE_PARAM_adj(nlevgrnd, lsmlat, lsmlon)
98+
long_name: "Shape (b) parameter"
99+
units: "unitless"
100+
_FillValue: 1.e+30
101+
102+
PSIS_SAT_adj(nlevgrnd, lsmlat, lsmlon)
103+
long_name: "Saturated soil matric potential"
104+
units: "mmH2O"
105+
_FillValue: 1000.0
106+
107+
KSAT_adj(nlevgrnd, lsmlat, lsmlon)
108+
long_name: "Saturated hydraulic conductivity"
109+
units: "mm/s"
110+
_FillValue: 1.e+30
111+
```
112+
113+
**Important Notes:**
114+
- Adjusted parameters apply to **all** `nlevgrnd` layers
115+
- When present, adjusted parameters **overwrite** the results of organic
116+
matter mixing
117+
- `PSIS_SAT_adj` uses a different fill value (1000.0) compared to other
118+
parameters (1.e+30), reflecting special handling for undefined matric
119+
potential values
120+
- If adjusted parameters are not present in the surface file, eCLM falls
121+
back to the original parameters or pedotransfer functions
122+
123+
### Namelist Configuration
124+
125+
The soil hydraulic parameter reading behavior is controlled by two
126+
namelist settings in the `clm_soilstate_inparm` section of the `lnd_in`
127+
namelist file:
128+
129+
#### `soil_hyd_inparm_from_file`
130+
131+
**Type:** logical
132+
**Default:** `.false.`
133+
**Description:** Controls whether to read baseline hydraulic parameters
134+
from the surface dataset file.
135+
136+
When set to `.true.`:
137+
- eCLM reads `THETAS`, `SHAPE_PARAM`, `PSIS_SAT`, and `KSAT` from the
138+
surface file
139+
- Parameters apply to the first 10 soil layers (`nlevsoifl=10`)
140+
- Parameters undergo organic matter mixing
141+
- If any required variable is missing, the model aborts with an error
142+
message
143+
144+
When set to `.false.` (default):
145+
- Hydraulic parameters are computed via pedotransfer functions from
146+
sand and clay fractions
147+
- No parameters are read from the surface file
148+
149+
#### `soil_hyd_inparm_from_file_adj`
150+
151+
**Type:** logical
152+
**Default:** `.false.`
153+
**Description:** Controls whether to read organic-matter-adjusted
154+
hydraulic parameters from the surface dataset file.
155+
156+
When set to `.true.`:
157+
- eCLM reads `THETAS_adj`, `SHAPE_PARAM_adj`, `PSIS_SAT_adj`, and
158+
`KSAT_adj` from the surface file
159+
- Parameters apply to **all** `nlevgrnd` soil layers (typically 25
160+
layers)
161+
- Adjusted parameters **overwrite** the results from organic matter
162+
mixing
163+
- If any required variable is missing, the model aborts with an error
164+
message
165+
166+
When set to `.false.` (default):
167+
- No organic-matter-adjusted parameters are read from the surface file
168+
- Organic matter mixing results are used as final parameter values
169+
170+
#### Example Configuration
171+
172+
```fortran
173+
&clm_soilstate_inparm
174+
organic_frac_squared = .false.
175+
soil_hyd_inparm_from_file = .false.
176+
soil_hyd_inparm_from_file_adj = .true.
177+
/
178+
```
179+
180+
This configuration:
181+
- Reads adjusted parameters from the surface file which override the
182+
organic matter mixing results
183+
- Can e.g. be used for ensemble data assimilation applications with
184+
perturbed soil parameters specified in a group of surface files, one
185+
surface file per ensemble member.
186+
187+
#### Error Handling
188+
189+
Both namelist parameters enforce strict error checking:
190+
- If set to `.true.`, **all** required parameters must be present in
191+
the surface file
192+
- Missing variables trigger an immediate model abort with a descriptive
193+
error message
194+
- This ensures users are explicitly aware when parameter files are
195+
incomplete
196+
197+
### Note about the Brooks-Corey Shape Parameter ###
198+
199+
When perturbed soil parameters are read from input files, the organic
200+
matter mixing for `bsw` uses the file-read value instead of the
201+
hard-coded Cosby et al. (1984) Table 5 formula (`2.91 + 0.159*clay`).
202+
203+
## Modified Source Code ##
204+
205+
- `src/clm5/biogeophys/SoilStateInitTimeConstMod.F90`

0 commit comments

Comments
 (0)