Skip to content

Commit

Permalink
Adding the fates_rad_model to the parameter file
Browse files Browse the repository at this point in the history
  • Loading branch information
rgknox committed Jun 6, 2023
1 parent 934ad20 commit befe7dd
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
11 changes: 11 additions & 0 deletions main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module EDParamsMod
integer,protected, public :: photo_tempsens_model ! switch for choosing the model that defines the temperature
! sensitivity of photosynthetic parameters (vcmax, jmax).
! 1=non-acclimating, 2=Kumarathunge et al., 2019

integer,protected, public :: radiation_model ! Switch betrween Norman (1) and Two-stream (2) radiation models

real(r8),protected, public :: fates_mortality_disturbance_fraction ! the fraction of canopy mortality that results in disturbance
real(r8),protected, public :: ED_val_comp_excln ! weighting factor for canopy layer exclusion and promotion
Expand Down Expand Up @@ -94,6 +96,7 @@ module EDParamsMod
character(len=param_string_length),parameter,public :: ED_name_photo_temp_acclim_thome_time = "fates_leaf_photo_temp_acclim_thome_time"
character(len=param_string_length),parameter,public :: name_photo_tempsens_model = "fates_leaf_photo_tempsens_model"
character(len=param_string_length),parameter,public :: name_maintresp_model = "fates_maintresp_leaf_model"
character(len=param_string_length),parameter,public :: name_radiation_model = "fates_rad_model"
character(len=param_string_length),parameter,public :: ED_name_hydr_htftype_node = "fates_hydro_htftype_node"
character(len=param_string_length),parameter,public :: ED_name_mort_disturb_frac = "fates_mort_disturb_frac"
character(len=param_string_length),parameter,public :: ED_name_comp_excln = "fates_comp_excln"
Expand Down Expand Up @@ -263,6 +266,7 @@ subroutine FatesParamsInit()
photo_temp_acclim_thome_time = nan
photo_tempsens_model = -9
maintresp_leaf_model = -9
radiation_model = -9
fates_mortality_disturbance_fraction = nan
ED_val_comp_excln = nan
ED_val_vai_top_bin_width = nan
Expand Down Expand Up @@ -349,6 +353,9 @@ subroutine FatesRegisterParams(fates_params)
call fates_params%RegisterParameter(name=name_photo_tempsens_model,dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=name_radiation_model,dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=name_maintresp_model,dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

Expand Down Expand Up @@ -550,6 +557,10 @@ subroutine FatesReceiveParams(fates_params)
data=tmpreal)
photo_tempsens_model = nint(tmpreal)

call fates_params%RetrieveParameter(name=name_radiation_model, &
data=tmpreal)
radiation_model = nint(tmpreal)

call fates_params%RetrieveParameter(name=name_maintresp_model, &
data=tmpreal)
maintresp_leaf_model = nint(tmpreal)
Expand Down
12 changes: 11 additions & 1 deletion main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module EDPftvarcon
use FatesConstantsMod , only : prescribed_n_uptake
use FatesConstantsMod , only : coupled_p_uptake
use FatesConstantsMod , only : coupled_n_uptake


! CIME Globals
use shr_log_mod , only : errMsg => shr_log_errMsg
Expand Down Expand Up @@ -1533,6 +1533,7 @@ subroutine FatesCheckParams(is_master)
use FatesConstantsMod , only : itrue, ifalse
use EDParamsMod , only : logging_mechanical_frac, logging_collateral_frac
use EDParamsMod , only : logging_direct_frac,logging_export_frac
use EDParamsMod , only : radiation_model
use FatesInterfaceTypesMod, only : hlm_use_fixed_biogeog,hlm_use_sp, hlm_name
use FatesInterfaceTypesMod, only : hlm_use_inventory_init

Expand All @@ -1555,6 +1556,15 @@ subroutine FatesCheckParams(is_master)

if(.not.is_master) return

if(radiation_model.ne.1) then
write(fates_log(),*) 'The only available canopoy radiation model'
write(fates_log(),*) 'is the Norman scheme: fates_rad_model = 1'
write(fates_log(),*) 'The two-stream scheme is not available yet'
write(fates_log(),*) 'You specified fates_rad_model = ',radiation_model
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if


select case (hlm_parteh_mode)
case (prt_cnp_flex_allom_hyp)
Expand Down
9 changes: 8 additions & 1 deletion parameter_files/archive/api25.4.0_041023_pr958.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- To use this patch file run the following command: -->

<!-- Run `python ../tools/UpdateParamAPI.py -\-f archive/api25.3.0_032223_pr958.xml` -->
<!-- Run `python ../tools/UpdateParamAPI.py -/-f archive/api25.4.0_041023_pr958.xml` -->

<!-- To update a different CDL parameter file, change the file listed the `base_file`. -->
<!-- This requires that said file is up to date with API 25.3. -->
Expand Down Expand Up @@ -59,5 +59,12 @@
<mod type="variable_del">
<na> fates_phen_drought_model </na>
</mod>
<mod type="variable_add">
<na> fates_rad_model </na>
<di> scalar </di>
<un> unitless </un>
<ln> switch designating the model for canopy radiation, 1 = Norman, 2 = Two-stream (experimental) </ln>
<val> 1 </val>
</mod>
</mods>
</all>
14 changes: 9 additions & 5 deletions parameter_files/fates_params_default.cdl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
netcdf fates_params_default {
netcdf tmp {
dimensions:
fates_NCWD = 4 ;
fates_history_age_bins = 7 ;
Expand Down Expand Up @@ -365,7 +365,7 @@ variables:
double fates_leaf_stomatal_slope_medlyn(fates_pft) ;
fates_leaf_stomatal_slope_medlyn:units = "KPa**0.5" ;
fates_leaf_stomatal_slope_medlyn:long_name = "stomatal slope parameter, as per Medlyn" ;
double fates_leaf_vcmax25top(fates_leafage_class, fates_pft) ;
double fates_leaf_vcmax25top(fates_pft) ;
fates_leaf_vcmax25top:units = "umol CO2/m^2/s" ;
fates_leaf_vcmax25top:long_name = "maximum carboxylation rate of Rub. at 25C, canopy top" ;
double fates_leaf_vcmaxha(fates_pft) ;
Expand Down Expand Up @@ -785,6 +785,9 @@ variables:
double fates_q10_mr ;
fates_q10_mr:units = "unitless" ;
fates_q10_mr:long_name = "Q10 for maintenance respiration" ;
double fates_rad_model ;
fates_rad_model:units = "unitless" ;
fates_rad_model:long_name = "switch designating the model for canopy radiation, 1 = Norman, 2 = Two-stream (experimental)" ;
double fates_soil_salinity ;
fates_soil_salinity:units = "ppt" ;
fates_soil_salinity:long_name = "soil salinity used for model when not coupled to dynamic soil salinity" ;
Expand Down Expand Up @@ -854,7 +857,7 @@ data:
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ;

fates_alloc_storage_cushion = 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2,
fates_alloc_storage_cushion = 1.2, 1.2, 1.2, 1.2, 2.4, 1.2, 1.2, 2.4, 1.2,
1.2, 1.2, 1.2 ;

fates_alloc_store_priority_frac = 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8,
Expand Down Expand Up @@ -1193,8 +1196,7 @@ data:
fates_leaf_stomatal_slope_medlyn = 4.1, 2.3, 2.3, 4.1, 4.4, 4.4, 4.7, 4.7,
4.7, 2.2, 5.3, 1.6 ;

fates_leaf_vcmax25top =
50, 62, 39, 61, 41, 58, 62, 54, 54, 78, 78, 78 ;
fates_leaf_vcmax25top = 50, 62, 39, 61, 58, 58, 62, 54, 54, 78, 78, 78 ;

fates_leaf_vcmaxha = 65330, 65330, 65330, 65330, 65330, 65330, 65330, 65330,
65330, 65330, 65330, 65330 ;
Expand Down Expand Up @@ -1551,6 +1553,8 @@ data:

fates_q10_mr = 1.5 ;

fates_rad_model = 1 ;

fates_soil_salinity = 0.4 ;

fates_vai_top_bin_width = 1 ;
Expand Down
2 changes: 1 addition & 1 deletion tools/UpdateParamAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def main():

sel_values = selectvalues(ncfile,list(dimnames),ipft_list,values,dcode)

[ncfile,ncvar] = reatevar(ncfile,paramname,dimnames,units,longname,dcode,sel_values)
[ncfile,ncvar] = createvar(ncfile,paramname,dimnames,units,longname,dcode,sel_values)
ncfile.flush()
ncfile.close()

Expand Down

0 comments on commit befe7dd

Please sign in to comment.