Skip to content

Commit

Permalink
Update code and params file with MIMICS changes per ESCOMP#1845
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Nov 16, 2023
1 parent 626f520 commit 319d194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- The default filenames are given relative to the root directory
for the CLM2 data in the CESM distribution -->
<!-- Plant function types (relative to {csmdata}) -->
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.RMz0.c231011.nc</paramfile>
<paramfile phys="clm5_1" >/glade/u/home/slevis/paramfiles/ctsm51_params.c231115.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c211112.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c211112.nc</paramfile>

Expand Down
13 changes: 5 additions & 8 deletions src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ subroutine readParams ( ncid )
call ncd_io(trim(tString), params_inst%mimics_fmet(:), 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))

allocate(params_inst%mimics_fchem_r(4))
allocate(params_inst%mimics_fchem_r(2))
tString='mimics_fchem_r'
call ncd_io(trim(tString), params_inst%mimics_fchem_r(:), 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))

allocate(params_inst%mimics_fchem_k(4))
allocate(params_inst%mimics_fchem_k(2))
tString='mimics_fchem_k'
call ncd_io(trim(tString), params_inst%mimics_fchem_k(:), 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
Expand Down Expand Up @@ -828,10 +828,8 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, &
real(r8):: mimics_fmet_p4
real(r8):: mimics_fchem_r_p1
real(r8):: mimics_fchem_r_p2
real(r8):: mimics_fchem_r_p3
real(r8):: mimics_fchem_k_p1
real(r8):: mimics_fchem_k_p2
real(r8):: mimics_fchem_k_p3
real(r8):: mimics_tau_mod_min
real(r8):: mimics_tau_mod_max
real(r8):: mimics_tau_mod_factor
Expand Down Expand Up @@ -1092,10 +1090,8 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, &
mimics_fmet_p4 = params_inst%mimics_fmet(4)
mimics_fchem_r_p1 = params_inst%mimics_fchem_r(1)
mimics_fchem_r_p2 = params_inst%mimics_fchem_r(2)
mimics_fchem_r_p3 = params_inst%mimics_fchem_r(3)
mimics_fchem_k_p1 = params_inst%mimics_fchem_k(1)
mimics_fchem_k_p2 = params_inst%mimics_fchem_k(2)
mimics_fchem_k_p3 = params_inst%mimics_fchem_k(3)
mimics_tau_mod_min = params_inst%mimics_tau_mod_min
mimics_tau_mod_max = params_inst%mimics_tau_mod_max
mimics_tau_mod_factor = params_inst%mimics_tau_mod_factor
Expand Down Expand Up @@ -1186,9 +1182,9 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, &
! Used in the update of certain pathfrac terms that vary with time
! in the next loop
fchem_m1 = min(1._r8, max(0._r8, mimics_fchem_r_p1 * &
exp(mimics_fchem_r_p2 * fmet) * mimics_fchem_r_p3))
exp(mimics_fchem_r_p2 * fmet)))
fchem_m2 = min(1._r8, max(0._r8, mimics_fchem_k_p1 * &
exp(mimics_fchem_k_p2 * fmet) * mimics_fchem_k_p3))
exp(mimics_fchem_k_p2 * fmet)))

do j = 1,nlevdecomp
! vmax ends up in units of per hour but is expected
Expand Down Expand Up @@ -1283,6 +1279,7 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, &
! The right hand side is OXIDAT in the testbed (line 1145)
decomp_k(c,j,i_chem_som) = (term_1 + term_2) * w_d_o_scalars

! Currently, mimics_densdep = 1 so as to have no effect
decomp_k(c,j,i_cop_mic) = tau_m1 * &
m1_conc**(mimics_densdep - 1.0_r8) * w_d_o_scalars
favl = min(1.0_r8, max(0.0_r8, 1.0_r8 - fphys_m1(c,j) - fchem_m1))
Expand Down

0 comments on commit 319d194

Please sign in to comment.