Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move some hardcoded parameters to the paramsfile #1039

Merged
merged 11 commits into from
Jun 18, 2020
4 changes: 2 additions & 2 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ 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_0">lnd/clm2/paramdata/clm5_params.c200519.nc</paramfile>
<paramfile phys="clm4_5">lnd/clm2/paramdata/clm_params.c200519.nc</paramfile>
<paramfile phys="clm5_0">lnd/clm2/paramdata/clm5_params.c200614.nc</paramfile>
<paramfile phys="clm4_5">lnd/clm2/paramdata/clm45_params.c200614.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down
109 changes: 108 additions & 1 deletion doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,116 @@
===============================================================
Tag name: ctsm1.0.dev101
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326), oleson (Keith Oleson)
Date: Wed Jun 17 23:51:22 MDT 2020
One-line Summary: Changes from Keith to bring a list of variables to the parameter file

Purpose of changes
------------------

Change some hardcoded parameters to go on the parameter files. This is needed in preparation
of running the Perturbed Parameter Ensemble.

Bugs fixed or introduced
------------------------

Issues fixed (include CTSM Issue #): #995 #138, #206

Fixes #995 -- Soil turnover times are on paramfile and hardcoded
Fixes #138 -- use tau_ values on paramfile
Fixes #206 -- add prh30 to paramfile
Some work on #290 -- LUNA refactoring


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations? No
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5

Notes of particular relevance for users
---------------------------------------

Caveats for users (e.g., need to interpolate initial conditions): None

Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None

Changes made to namelist defaults (e.g., changed parameter values): None

Changes to the datasets (e.g., parameter, surface or initial files): paramfile for both clm4_5 and clm5_0
Add 51 new parameters to the paramsfile:
bsw_adjustfactor,cpha,csol_clay,csol_om,csol_sand,denitrif_nitrateconc_coefficient,denitrif_nitrateconc_exponent,
denitrif_respiration_coefficient,denitrif_respiration_exponent,drift_gs,e_ice,enzyme_turnover_daily,eta0_anderson,
eta0_vionnet,fnps,hksat_adjustfactor,ignition_efficiency,jmaxb0,jmaxha,jmaxhd,kcha,koha,kp25ratio,lmrha,lmrhd,
lmrse,luna_theta_cj,minrelh,n_baseflow,pd,perched_baseflow_scalar,prh30,relhExp,ssi,sucsat_adjustfactor,theta_cj,
theta_ip,theta_psii,tpuha,tpuhd,tkd_clay,tkd_om,tkd_sand,tkm_om,tpu25ratio,vcmaxha,vcmaxhd,watsat_adjustfactor,
wc2wjb0,wimp,wind_min
k_nitr_max removed and replaced with k_nitr_max_perday
meta-data for the tau_* variables changed, and a roundoff difference in the clm4_5 paramfile

Substantial timing or memory changes: None

Notes of particular relevance for developers: (including Code reviews and testing)
---------------------------------------------
NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide

Caveats for developers (e.g., code that is duplicated that requires double maintenance): prh30 not used for clm4_5
prh30 was added in but won't be used for the CNFireLi2014 formulation.
It's only used for the clm5_0 and following formulations

Changes to tests or testing: None

Code reviewed by: self, oleson


CTSM testing: regular

[PASS means all tests PASS and OK means tests PASS other than expected fails.]

build-namelist tests:

cheyenne - PASS (170 tests differ from baseline because of new paramfiles)

python testing (see instructions in python/README.md; document testing done):

cheyenne - PASS

regular tests (aux_clm):

cheyenne ---- OK
izumi ------- OK

If the tag used for baseline comparisons was NOT the previous tag, note that here:


Answer changes
--------------

Changes answers relative to baseline: No bit-for-bit

Detailed list of changes
------------------------

List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None

Pull Requests that document the changes (include PR ids): #1039
(https://github.com/ESCOMP/ctsm/pull)
#1039 -- move hardcoded parameters to paramfile

===============================================================
===============================================================
Tag name: ctsm1.0.dev100
Originator(s): sacks (Bill Sacks)
Date: Tue Jun 9 06:15:15 MDT 2020
One-line Summary: Deallocate memory after running init_interp

Purpose of changes
------------------

Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm1.0.dev101 ole/erik 06/17/2020 Changes from Keith to bring a list of variables to the parameter file
ctsm1.0.dev100 sacks 06/09/2020 Deallocate memory after running init_interp
ctsm1.0.dev099 sacks 06/08/2020 Update cime, needed for izumi machine updates
ctsm1.0.dev098 jet/erik 05/28/2020 Bring in GFDL fv3 cubed sphere grids C24, C48, C96, C192, C384
Expand Down
31 changes: 31 additions & 0 deletions src/biogeochem/CNFireBaseMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ module CNFireBaseMod
real(r8) :: cmb_cmplt_fact(num_fp) = (/ 0.5_r8, 0.25_r8 /) ! combustion completion factor (unitless)
end type

type, public :: params_type
real(r8) :: prh30 ! Factor related to dependence of fuel combustibility on 30-day running mean of relative humidity (unitless)
real(r8) :: ignition_efficiency ! Ignition efficiency of cloud-to-ground lightning (unitless)
end type params_type

!
type, abstract, extends(cnfire_method_type) :: cnfire_base_type
private
Expand All @@ -89,6 +94,7 @@ module CNFireBaseMod
!
! !PUBLIC MEMBER FUNCTIONS:
procedure, public :: CNFireInit ! Initialization of CNFire
procedure, public :: CNFireReadParams ! Read in constant parameters from the paramsfile
procedure, public :: CNFireReadNML ! Read in namelist for CNFire
procedure, public :: CNFireInterp ! Interpolate fire data
procedure, public :: CNFireArea ! Calculate fire area
Expand Down Expand Up @@ -122,6 +128,7 @@ end function need_lightning_and_popdens_interface
end interface

type(cnfire_const_type), public, protected :: cnfire_const ! Fire constants shared by Li versons
type(params_type) , public, protected :: cnfire_params ! Fire parameters shared by Li versions

character(len=*), parameter, private :: sourcefile = &
__FILE__
Expand Down Expand Up @@ -975,6 +982,30 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte

end subroutine CNFireFluxes

!-----------------------------------------------------------------------
subroutine CNFireReadParams( this, ncid )
!
! Read in the constant parameters from the input NetCDF parameter file
! !USES:
use ncdio_pio , only: file_desc_t
use paramUtilMod, only: readNcdioScalar
!
! !ARGUMENTS:
implicit none
class(cnfire_base_type) :: this
type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id
!
! !LOCAL VARIABLES:
character(len=*), parameter :: subname = 'CNFireReadParams'
!--------------------------------------------------------------------

! Factor related to dependence of fuel combustibility on 30-day running mean of relative humidity (unitless)
call readNcdioScalar(ncid, 'prh30', subname, cnfire_params%prh30)
! Ignition efficiency of cloud-to-ground lightning (unitless)
call readNcdioScalar(ncid, 'ignition_efficiency', subname, cnfire_params%ignition_efficiency)

end subroutine CNFireReadParams

!-----------------------------------------------------------------------
subroutine hdm_init( this, bounds, NLFilename )
!
Expand Down
5 changes: 3 additions & 2 deletions src/biogeochem/CNFireLi2014Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module CNFireLi2014Mod
use ColumnType , only : col
use PatchType , only : patch
use CNFireMethodMod , only : cnfire_method_type
use CNFireBaseMod , only : cnfire_base_type, cnfire_const
use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params
!
implicit none
private
Expand Down Expand Up @@ -570,7 +570,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
min(1._r8,exp(SHR_CONST_PI*(forc_t(c)-SHR_CONST_TKFRZ)/10._r8))
lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8
fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf))
ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(3._r8*grc%lat(g)))*0.25_r8)*(1._r8-fs)*(1._r8-cropf_col(c))
ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(3._r8*grc%lat(g)))* &
cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c))
nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec
Lb_lf = 1._r8+10.0_r8*(1._r8-EXP(-0.06_r8*forc_wind(g)))
if ( wtlf(c) > 0.0_r8 )then
Expand Down
12 changes: 8 additions & 4 deletions src/biogeochem/CNFireLi2016Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module CNFireLi2016Mod
use PatchType , only : patch
use SoilBiogeochemStateType , only : get_spinup_latitude_term
use CNFireMethodMod , only : cnfire_method_type
use CNFireBaseMod , only : cnfire_base_type, cnfire_const
use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params
!
implicit none
private
Expand All @@ -58,6 +58,10 @@ module CNFireLi2016Mod
procedure, public :: CNFireArea ! Calculate fire area
end type cnfire_li2016_type

!
! !PRIVATE MEMBER DATA:
!-----------------------------------------------------------------------

character(len=*), parameter, private :: sourcefile = &
__FILE__

Expand Down Expand Up @@ -593,7 +597,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then
afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8)))
arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low)))
arh30=1._r8-max(0.7_r8, min(1._r8,rh30_col(c)/90._r8))
arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8))
if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then
fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8)*((1._r8 -max(0._r8,&
min(1._r8,(btran_col(c)/wtlf(c)-bt_min)/(bt_max-bt_min))))**0.5_r8)
Expand All @@ -602,8 +606,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
end if
lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8
fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf))
ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))*0.22_r8) &
*(1._r8-fs)*(1._r8-cropf_col(c))
ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* &
cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c))
nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec
Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g)))
spread_m = fire_m**0.5_r8
Expand Down
18 changes: 18 additions & 0 deletions src/biogeochem/CNFireMethodMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module CNFireMethodMod
! Read namelist for the fire datasets
procedure(CNFireReadNML_interface), public, deferred :: CNFireReadNML

! Read parameters for the fire datasets
procedure(CNFireReadParams_interface), public, deferred :: CNFireReadParams

! Interpolate the fire datasets
procedure(CNFireInterp_interface) , public, deferred :: CNFireInterp

Expand Down Expand Up @@ -78,6 +81,21 @@ subroutine CNFireReadNML_interface(this, NLFilename )

end subroutine CNFireReadNML_interface

subroutine CNFireReadParams_interface( this, ncid )
!
! !DESCRIPTION:
! Read parameters from parameter file
!
! USES
use ncdio_pio , only: file_desc_t
import :: cnfire_method_type
! !ARGUMENTS:
implicit none
class(cnfire_method_type) :: this
type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id

end subroutine CNFireReadParams_interface

subroutine CNFireInterp_interface(this, bounds)
!
! !DESCRIPTION:
Expand Down
5 changes: 4 additions & 1 deletion src/biogeochem/CNVegetationFacade.F90
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module CNVegetationFacade
contains

!-----------------------------------------------------------------------
subroutine Init(this, bounds, NLFilename, nskip_steps)
subroutine Init(this, bounds, NLFilename, nskip_steps, params_ncid)
!
! !DESCRIPTION:
! Initialize a CNVeg object.
Expand All @@ -203,12 +203,14 @@ subroutine Init(this, bounds, NLFilename, nskip_steps)
! !USES:
use CNFireFactoryMod , only : create_cnfire_method
use clm_varcon , only : c13ratio, c14ratio
use ncdio_pio , only : file_desc_t
!
! !ARGUMENTS:
class(cn_vegetation_type), intent(inout) :: this
type(bounds_type), intent(in) :: bounds
character(len=*) , intent(in) :: NLFilename ! namelist filename
integer , intent(in) :: nskip_steps ! Number of steps to skip at startup
type(file_desc_t), intent(inout) :: params_ncid ! NetCDF handle to parameter file
!
! !LOCAL VARIABLES:
integer :: begp, endp
Expand Down Expand Up @@ -274,6 +276,7 @@ subroutine Init(this, bounds, NLFilename, nskip_steps)
end if

call create_cnfire_method(NLFilename, this%cnfire_method)
call this%cnfire_method%CNFireReadParams( params_ncid )

end subroutine Init

Expand Down
9 changes: 6 additions & 3 deletions src/biogeophys/BareGroundFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module BareGroundFluxesMod
public :: readParams

type, private :: params_type
real(r8) :: a_coef ! Drag coefficient under less dense canopy (unitless)
real(r8) :: a_exp ! Drag exponent under less dense canopy (unitless)
real(r8) :: a_coef ! Drag coefficient under less dense canopy (unitless)
real(r8) :: a_exp ! Drag exponent under less dense canopy (unitless)
real(r8) :: wind_min ! Minimum wind speed at the atmospheric forcing height (m/s)
end type params_type
type(params_type), private :: params_inst
!------------------------------------------------------------------------------
Expand All @@ -60,6 +61,8 @@ subroutine readParams( ncid )
call readNcdioScalar(ncid, 'a_coef', subname, params_inst%a_coef)
! Drag exponent under less dense canopy (unitless)
call readNcdioScalar(ncid, 'a_exp', subname, params_inst%a_exp)
! Minimum wind speed at the atmospheric forcing height (m/s)
call readNcdioScalar(ncid, 'wind_min', subname, params_inst%wind_min)

end subroutine readParams

Expand Down Expand Up @@ -287,7 +290,7 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
dlrad(p) = 0._r8
ulrad(p) = 0._r8

ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g)))
ur(p) = max(params_inst%wind_min,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g)))
dth(p) = thm(p)-t_grnd(c)
dqh(p) = forc_q(c) - qg(c)
dthv = dth(p)*(1._r8+0.61_r8*forc_q(c))+0.61_r8*forc_th(c)*dqh(p)
Expand Down
17 changes: 10 additions & 7 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ module CanopyFluxesMod
public :: readParams

type, private :: params_type
real(r8) :: lai_dl ! Plant litter area index (m2/m2)
real(r8) :: z_dl ! Litter layer thickness (m)
real(r8) :: a_coef ! Drag coefficient under less dense canopy (unitless)
real(r8) :: a_exp ! Drag exponent under less dense canopy (unitless)
real(r8) :: csoilc ! Soil drag coefficient under dense canopy (unitless)
real(r8) :: cv ! Turbulent transfer coeff. between canopy surface and canopy air (m/s^(1/2))
real(r8) :: lai_dl ! Plant litter area index (m2/m2)
real(r8) :: z_dl ! Litter layer thickness (m)
real(r8) :: a_coef ! Drag coefficient under less dense canopy (unitless)
real(r8) :: a_exp ! Drag exponent under less dense canopy (unitless)
real(r8) :: csoilc ! Soil drag coefficient under dense canopy (unitless)
real(r8) :: cv ! Turbulent transfer coeff. between canopy surface and canopy air (m/s^(1/2))
real(r8) :: wind_min ! Minimum wind speed at the atmospheric forcing height (m/s)
end type params_type
type(params_type), private :: params_inst
!
Expand Down Expand Up @@ -176,6 +177,8 @@ subroutine readParams( ncid )
call readNcdioScalar(ncid, 'csoilc', subname, params_inst%csoilc)
! Turbulent transfer coeff between canopy surface and canopy air (m/s^(1/2))
call readNcdioScalar(ncid, 'cv', subname, params_inst%cv)
! Minimum wind speed at the atmospheric forcing height (m/s)
call readNcdioScalar(ncid, 'wind_min', subname, params_inst%wind_min)

end subroutine readParams

Expand Down Expand Up @@ -755,7 +758,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
taf(p) = (t_grnd(c) + thm(p))/2._r8
qaf(p) = (forc_q(c)+qg(c))/2._r8

ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g)))
ur(p) = max(params_inst%wind_min,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g)))
dth(p) = thm(p)-taf(p)
dqh(p) = forc_q(c)-qaf(p)
delq(p) = qg(c) - qaf(p)
Expand Down
2 changes: 1 addition & 1 deletion src/biogeophys/HydrologyDrainageMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module HydrologyDrainageMod
use shr_log_mod , only : errMsg => shr_log_errMsg
use decompMod , only : bounds_type
use clm_varctl , only : iulog, use_vichydro
use clm_varcon , only : e_ice, denh2o, denice, rpi, spval
use clm_varcon , only : denh2o, denice, rpi, spval
use atm2lndType , only : atm2lnd_type
use glc2lndMod , only : glc2lnd_type
use SoilHydrologyType , only : soilhydrology_type
Expand Down
Loading