Skip to content

Commit

Permalink
read the grazing parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoven committed Jul 19, 2024
1 parent 53a6a44 commit 636e003
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 8 deletions.
65 changes: 58 additions & 7 deletions main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ module EDParamsMod
real(r8),protected,public :: q10_mr ! Q10 for respiration rate (for soil fragmenation and plant respiration) (unitless)
real(r8),protected,public :: q10_froz ! Q10 for frozen-soil respiration rates (for soil fragmentation) (unitless)

! grazing parameters
real(r8),protected,public :: landuse_grazing_carbon_use_eff
real(r8),protected,public :: landuse_grazing_maxheight
real(r8),protected,public :: landuse_grazing_nitrogen_use_eff
real(r8),protected,public :: landuse_grazing_phosphorus_use_eff
real(r8),protected,public :: landuse_grazing_rate(n_landuse_cats)

! Unassociated pft dimensioned free parameter that developers can use for testing arbitrary new hypotheses
! (THIS PARAMETER IS UNUSED, FEEL FREE TO USE IT FOR WHATEVER PURPOSE YOU LIKE. WE CAN
! HELP MIGRATE YOUR USAGE OF THE PARMETER TO A PERMANENT HOME LATER)
Expand Down Expand Up @@ -287,12 +294,11 @@ module EDParamsMod
character(len=param_string_length),parameter,public :: logging_name_export_frac ="fates_landuse_logging_export_frac"

! grazing-related parameters
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_palatability = "fates_landuse_grazing_palatability"
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_rate = "fates_landuse_grazing_rate"
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_carbon_use_eff = "fates_landuse_grazing_carbon_use_eff"
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_maxheight = "fates_landuse_grazing_maxheight"
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_nitrogen_use_eff = "fates_landuse_grazing_nitrogen_use_eff"
character(len=param_string_length),parameter,public :: ED_name_landuse_grazing_phosphorus_use_eff = "fates_landuse_grazing_phosphorus_use_eff"
character(len=param_string_length),parameter,public :: name_landuse_grazing_rate = "fates_landuse_grazing_rate"
character(len=param_string_length),parameter,public :: name_landuse_grazing_carbon_use_eff = "fates_landuse_grazing_carbon_use_eff"
character(len=param_string_length),parameter,public :: name_landuse_grazing_maxheight = "fates_landuse_grazing_maxheight"
character(len=param_string_length),parameter,public :: name_landuse_grazing_nitrogen_use_eff = "fates_landuse_grazing_nitrogen_use_eff"
character(len=param_string_length),parameter,public :: name_landuse_grazing_phosphorus_use_eff = "fates_landuse_grazing_phosphorus_use_eff"

real(r8),protected,public :: eca_plant_escalar ! scaling factor for plant fine root biomass to
! calculate nutrient carrier enzyme abundance (ECA)
Expand Down Expand Up @@ -377,6 +383,12 @@ subroutine FatesParamsInit()
dev_arbitrary = nan
damage_event_code = -9
damage_canopy_layer_code = -9
landuse_grazing_carbon_use_eff = nan
landuse_grazing_nitrogen_use_eff = nan
landuse_grazing_phosphorus_use_eff = nan
landuse_grazing_maxheight = nan
landuse_grazing_rate(:) = nan

end subroutine FatesParamsInit

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -580,7 +592,19 @@ subroutine FatesRegisterParams(fates_params)

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


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

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

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

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

! non-scalar parameters

call fates_params%RegisterParameter(name=ED_name_hydr_htftype_node, dimension_shape=dimension_shape_1d, &
Expand Down Expand Up @@ -616,6 +640,8 @@ subroutine FatesRegisterParams(fates_params)
call fates_params%RegisterParameter(name=ED_name_max_nocomp_pfts_by_landuse, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names_landuse)

call fates_params%RegisterParameter(name=name_landuse_grazing_rate, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names_landuse)
end subroutine FatesRegisterParams


Expand All @@ -634,6 +660,7 @@ subroutine FatesReceiveParams(fates_params)
real(r8), allocatable :: tmp_vector_by_landuse1(:) ! local real vector for changing type on read
real(r8), allocatable :: tmp_vector_by_landuse2(:) ! local real vector for changing type on read
real(r8), allocatable :: tmp_vector_by_landuse3(:) ! local real vector for changing type on read
real(r8), allocatable :: tmp_vector_by_landuse4(:) ! local real vector for changing type on read

call fates_params%RetrieveParameter(name=ED_name_photo_temp_acclim_timescale, &
data=photo_temp_acclim_timescale)
Expand Down Expand Up @@ -869,6 +896,25 @@ subroutine FatesReceiveParams(fates_params)
hydr_htftype_node(:) = nint(hydr_htftype_real(:))
deallocate(hydr_htftype_real)

call fates_params%RetrieveParameter(name=name_landuse_grazing_carbon_use_eff, &
data=landuse_grazing_carbon_use_eff)

call fates_params%RetrieveParameter(name=name_landuse_grazing_nitrogen_use_eff, &
data=landuse_grazing_nitrogen_use_eff)

call fates_params%RetrieveParameter(name=name_landuse_grazing_phosphorus_use_eff, &
data=landuse_grazing_phosphorus_use_eff)

call fates_params%RetrieveParameter(name=name_landuse_grazing_maxheight, &
data=landuse_grazing_maxheight)

call fates_params%RetrieveParameterAllocate(name=name_landuse_grazing_rate, &
data=tmp_vector_by_landuse4)

landuse_grazing_rate(:) = tmp_vector_by_landuse4(:)

deallocate(tmp_vector_by_landuse4)

end subroutine FatesReceiveParams

! =====================================================================================
Expand Down Expand Up @@ -939,6 +985,11 @@ subroutine FatesReportParams(is_master)
write(fates_log(),'(a,L2)') 'active_crown_fire = ',active_crown_fire
write(fates_log(),fmt0) 'damage_event_code = ',damage_event_code
write(fates_log(),fmt0) 'damage_canopy_layer_code = ', damage_canopy_layer_code
write(fates_log(),fmt0) 'landuse_grazing_carbon_use_eff = ', landuse_grazing_carbon_use_eff
write(fates_log(),fmt0) 'name_landuse_grazing_nitrogen_use_eff = ', name_landuse_grazing_nitrogen_use_eff
write(fates_log(),fmt0) 'name_landuse_grazing_phosphorus_use_eff = ', name_landuse_grazing_phosphorus_use_eff
write(fates_log(),fmt0) 'name_landuse_grazing_maxheight = ', name_landuse_grazing_maxheight
write(fates_log(),fmt0) 'name_landuse_grazing_rate(:) = ', name_landuse_grazing_rate(:)
write(fates_log(),*) '------------------------------------------------------'

end if
Expand Down
13 changes: 12 additions & 1 deletion main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ module EDPftvarcon
real(r8), allocatable :: landusechange_frac_exported(:) ! fraction of land use change-generated wood material that is exported to wood product (the remainder is either burned or goes to litter)
real(r8), allocatable :: landusechange_pprod10(:) ! fraction of land use change wood product that goes to 10-year product pool (remainder goes to 100-year pool)

! Grazing
real(r8), allocatable :: landuse_grazing_palatability(:) ! Relative intensity of leaf grazing/browsing per PFT (unitless 0-1)

contains
procedure, public :: Init => EDpftconInit
procedure, public :: Register
Expand Down Expand Up @@ -818,7 +821,11 @@ subroutine Register_PFT(this, fates_params)
name = 'fates_landuse_luc_pprod10'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)


name = 'fates_landuse_grazing_palatability'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

name = 'fates_dev_arbitrary_pft'
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)
Expand Down Expand Up @@ -1303,6 +1310,10 @@ subroutine Receive_PFT(this, fates_params)
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%landusechange_pprod10)

name = 'fates_landuse_grazing_palatability'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%landuse_grazing_palatability)

end subroutine Receive_PFT

!-----------------------------------------------------------------------
Expand Down

0 comments on commit 636e003

Please sign in to comment.