Skip to content

Commit de5e972

Browse files
committed
more descriptive namelist entry
`soil_hyd_inparm_from_surfdata`
1 parent 120d880 commit de5e972

2 files changed

Lines changed: 29 additions & 28 deletions

File tree

docs/users_guide/introduction/perturbation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The soil hydraulic parameter reading behavior is controlled by two
168168
namelist settings in the `clm_soilstate_inparm` section of the `lnd_in`
169169
namelist file:
170170

171-
##### `parameters_in_file`
171+
##### `soil_hyd_inparm_from_surfdata`
172172

173173
**Type:** logical
174174
**Default:** `.false.`
@@ -188,12 +188,12 @@ When set to `.false.` (default):
188188
sand and clay fractions
189189
- No parameters are read from the surface file
190190

191-
##### `parameters_in_file_adj`
191+
##### `soil_hyd_inparm_from_surfdata_adj`
192192

193193
**Type:** logical
194194
**Default:** `.false.`
195-
**Description:** Controls whether to read adjusted hydraulic parameters
196-
from the surface dataset file.
195+
**Description:** Controls whether to read organic-matter-adjusted
196+
hydraulic parameters from the surface dataset file.
197197

198198
When set to `.true.`:
199199
- eCLM reads `THETAS_adj`, `SHAPE_PARAM_adj`, `PSIS_SAT_adj`, and
@@ -206,16 +206,16 @@ When set to `.true.`:
206206
message
207207

208208
When set to `.false.` (default):
209-
- No adjusted parameters are read from the surface file
209+
- No organic-matter-adjusted parameters are read from the surface file
210210
- Organic matter mixing results are used as final parameter values
211211

212212
##### Example Configuration
213213

214214
```fortran
215215
&clm_soilstate_inparm
216216
organic_frac_squared = .false.
217-
parameters_in_file = .false.
218-
parameters_in_file_adj = .true.
217+
soil_hyd_inparm_from_surfdata = .false.
218+
soil_hyd_inparm_from_surfdata_adj = .true.
219219
/
220220
```
221221

src/clm5/biogeophys/SoilStateInitTimeConstMod.F90

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module SoilStateInitTimeConstMod
2222
! !PRIVATE DATA:
2323
! Control variables (from namelist)
2424
logical, private :: organic_frac_squared ! If organic fraction should be squared (as in CLM4.5)
25-
logical, private :: parameters_in_file ! If soil hydraulic parameters should be read from file
26-
logical, private :: parameters_in_file_adj ! If adjusted soil hydraulic parameters should be read from file
25+
logical, private :: soil_hyd_inparm_from_surfdata ! If soil hydraulic parameters should be read from file
26+
logical, private :: soil_hyd_inparm_from_surfdata_adj ! If adjusted soil hydraulic parameters should be read from file
2727

2828
character(len=*), parameter, private :: sourcefile = &
2929
__FILE__
@@ -57,14 +57,14 @@ subroutine ReadNL( nlfilename )
5757

5858
character(len=*), parameter :: nl_name = 'clm_soilstate_inparm' ! Namelist name
5959
! MUST agree with name in namelist and read
60-
namelist / clm_soilstate_inparm / organic_frac_squared, parameters_in_file, &
61-
parameters_in_file_adj
60+
namelist / clm_soilstate_inparm / organic_frac_squared, soil_hyd_inparm_from_surfdata, &
61+
soil_hyd_inparm_from_surfdata_adj
6262

6363
! preset values
6464

6565
organic_frac_squared = .false.
66-
parameters_in_file = .false.
67-
parameters_in_file_adj = .false.
66+
soil_hyd_inparm_from_surfdata = .false.
67+
soil_hyd_inparm_from_surfdata_adj = .false.
6868

6969
if ( masterproc )then
7070

@@ -85,12 +85,12 @@ subroutine ReadNL( nlfilename )
8585
end if
8686

8787
call shr_mpi_bcast(organic_frac_squared, mpicom)
88-
call shr_mpi_bcast(parameters_in_file, mpicom)
89-
call shr_mpi_bcast(parameters_in_file_adj, mpicom)
88+
call shr_mpi_bcast(soil_hyd_inparm_from_surfdata, mpicom)
89+
call shr_mpi_bcast(soil_hyd_inparm_from_surfdata_adj, mpicom)
9090

9191
! Check for incompatible namelist settings
92-
if (parameters_in_file .and. parameters_in_file_adj) then
93-
call endrun(msg=' ERROR: parameters_in_file and parameters_in_file_adj cannot both be .true.'//&
92+
if (soil_hyd_inparm_from_surfdata .and. soil_hyd_inparm_from_surfdata_adj) then
93+
call endrun(msg=' ERROR: soil_hyd_inparm_from_surfdata and soil_hyd_inparm_from_surfdata_adj cannot both be .true.'//&
9494
errmsg(sourcefile, __LINE__))
9595
end if
9696

@@ -250,14 +250,14 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
250250
allocate(sand3d(begg:endg,nlevsoifl))
251251
allocate(clay3d(begg:endg,nlevsoifl))
252252
! SHP start
253-
if(parameters_in_file) then
253+
if(soil_hyd_inparm_from_surfdata) then
254254
allocate(thetas(begg:endg,nlevsoifl))
255255
allocate(shape_param(begg:endg,nlevsoifl))
256256
allocate(psis_sat(begg:endg,nlevsoifl))
257257
allocate(ks(begg:endg,nlevsoifl))
258258
end if
259259

260-
if(parameters_in_file_adj) then
260+
if(soil_hyd_inparm_from_surfdata_adj) then
261261
allocate(thetas_adj(begg:endg,nlevgrnd))
262262
allocate(shape_param_adj(begg:endg,nlevgrnd))
263263
allocate(psis_sat_adj(begg:endg,nlevgrnd))
@@ -305,7 +305,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
305305
! include option to also read hydraulic parameters from file. Keep it variable so that the code also works for surface files that were
306306
! generated without parameter perturbation and parameter as input variables
307307

308-
if (parameters_in_file) then
308+
if (soil_hyd_inparm_from_surfdata) then
309309
call ncd_io(ncid=ncid, varname='THETAS', flag='read', data=thetas, dim1name=grlnd, readvar=readvar)
310310
if (.not. readvar) then
311311
call endrun(msg=' ERROR: THETAS NOT on surfdata file'//errMsg(sourcefile, __LINE__))
@@ -327,7 +327,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
327327
end if
328328
end if
329329

330-
if (parameters_in_file_adj) then
330+
if (soil_hyd_inparm_from_surfdata_adj) then
331331
call ncd_io(ncid=ncid, varname='THETAS_adj', flag='read', data=thetas_adj, dim1name=grlnd, readvar=readvar)
332332
if (.not. readvar) then
333333
call endrun(msg=' ERROR: THETAS_ADJ NOT on surfdata file'//errMsg(sourcefile, __LINE__))
@@ -545,7 +545,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
545545
! if parameters are included in the file, watsat,... are overwritten with the values from there. If not, the pedotransfer
546546
! function is used
547547

548-
if (parameters_in_file) then
548+
if (soil_hyd_inparm_from_surfdata) then
549549
if (lev <= nlevsoifl) then
550550
! Use values from the file for the soil layers
551551
soilstate_inst%watsat_col(c,lev) = thetas(col%gridcell(c), lev)
@@ -570,7 +570,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
570570
soilstate_inst%watsat_col(c,lev) = (1._r8 - om_frac) * soilstate_inst%watsat_col(c,lev) + om_watsat*om_frac
571571
tkm = (1._r8-om_frac) * (8.80_r8*sand+2.92_r8*clay)/(sand+clay)+om_tkm*om_frac ! W/(m K)
572572
! SHP adapt start
573-
if (parameters_in_file) then
573+
if (soil_hyd_inparm_from_surfdata) then
574574
soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac) * soilstate_inst%bsw_col(c,lev) + om_frac*om_b
575575
else
576576
soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac) * (2.91_r8 + 0.159_r8*clay) + om_frac*om_b
@@ -600,8 +600,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
600600
soilstate_inst%hksat_col(c,lev) = uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat
601601

602602
! SHP start
603-
if (parameters_in_file_adj) then
604-
! Use values from the file for the soil layers
603+
if (soil_hyd_inparm_from_surfdata_adj) then
604+
! Ovewrite organic-matter-adjusted parameters from
605+
! the file for all ground layers
605606
soilstate_inst%watsat_col(c,lev) = thetas_adj(col%gridcell(c), lev)
606607
soilstate_inst%bsw_col(c,lev) = shape_param_adj(col%gridcell(c), lev)
607608
soilstate_inst%sucsat_col(c,lev) = psis_sat_adj(col%gridcell(c), lev)
@@ -682,7 +683,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
682683

683684
tkm = (1._r8-om_frac)*(8.80_r8*sand+2.92_r8*clay)/(sand+clay) + om_tkm * om_frac ! W/(m K)
684685
! SHP adapt start
685-
if (parameters_in_file .or. parameters_in_file_adj) then
686+
if (soil_hyd_inparm_from_surfdata .or. soil_hyd_inparm_from_surfdata_adj) then
686687
soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac)*soilstate_inst%bsw_col(c,lev) + om_frac * om_b_lake
687688
else
688689
soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac)*(2.91_r8 + 0.159_r8*clay) + om_frac * om_b_lake
@@ -752,10 +753,10 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
752753
deallocate(sand3d, clay3d, organic3d)
753754
deallocate(zisoifl, zsoifl, dzsoifl)
754755
! SHP start
755-
if(parameters_in_file) then
756+
if(soil_hyd_inparm_from_surfdata) then
756757
deallocate(thetas, shape_param, psis_sat, ks)
757758
end if
758-
if(parameters_in_file_adj) then
759+
if(soil_hyd_inparm_from_surfdata_adj) then
759760
deallocate(thetas_adj, shape_param_adj, psis_sat_adj, ks_adj)
760761
end if
761762
! SHP end

0 commit comments

Comments
 (0)