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

Dry deposition working with FATES-NOCOMP #11

Draft
wants to merge 12 commits into
base: noresm
Choose a base branch
from
19 changes: 13 additions & 6 deletions biogeochem/EDCanopyStructureMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
real(r8) :: total_canopy_area
real(r8) :: total_patch_leaf_stem_area
real(r8) :: weight ! Weighting for cohort variables in patch

do s = 1,nsites

ifp = 0
Expand All @@ -1904,7 +1904,8 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
bc_out(s)%dleaf_pa(:) = 0._r8
bc_out(s)%z0m_pa(:) = 0._r8
bc_out(s)%displa_pa(:) = 0._r8

bc_out(s)%drydep_season_pa(:) = 0
bc_out(s)%wesley_pft_label_pa(:)=8 !for no vegetation.
currentPatch => sites(s)%oldest_patch
c = fcolumn(s)
do while(associated(currentPatch))
Expand Down Expand Up @@ -1978,6 +1979,13 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
bc_out(s)%displa_pa(ifp) = EDPftvarcon_inst%displar(1) * bc_out(s)%htop_pa(ifp)
bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1)
endif

bc_out(s)%wesley_pft_label_pa(ifp) = EDPftvarcon_inst%wesley_pft_index_fordrydep(currentPatch%nocomp_pft_label)

! THIS IS A PLACEHOLDER
currentPatch%drydep_season = 1
bc_out(s)%drydep_season_pa(ifp) = 4

! -----------------------------------------------------------------------------

! We are assuming here that grass is all located underneath tree canopies.
Expand All @@ -2000,7 +2008,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)

total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp)

bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label

! Calculate area indices for output boundary to HLM
! It is assumed that cpatch%canopy_area_profile and cpat%xai_profiles
Expand Down Expand Up @@ -2054,8 +2061,9 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! for vegetated patches only
ifp = ifp+1
bc_out(s)%canopy_fraction_pa(ifp) = bc_out(s)%canopy_fraction_pa(ifp)/total_patch_area
endif ! veg patch

bc_out(s)%wesley_pft_label_pa(ifp)=8
bc_out(s)%drydep_season_pa(ifp)=4 !winter season where there is bare ground
endif ! veg patch
currentPatch => currentPatch%younger
end do

Expand All @@ -2075,7 +2083,6 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)

! Pass FATES Harvested C to bc_out.
call UpdateHarvestC(sites(s),bc_out(s))

end do

! This call to RecruitWaterStorage() makes an accounting of
Expand Down
2 changes: 1 addition & 1 deletion biogeochem/FatesPatchMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ subroutine Create(this, age, area, land_use_label, nocomp_pft, num_swb, num_pft,
this%age_since_anthro_disturbance = fates_unset_r8
endif
this%nocomp_pft_label = nocomp_pft

this%tr_soil_dir(:) = 1.0_r8
this%tr_soil_dif(:) = 1.0_r8
this%NCL_p = 1
Expand Down
10 changes: 10 additions & 0 deletions main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ module EDPftvarcon
real(r8), allocatable :: landusechange_frac_burned(:) ! fraction of land use change-generated and not-exported material that is burned (the remainder goes to litter)
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)
real(r8), allocatable :: wesley_pft_index_fordrydep(:)

contains
procedure, public :: Init => EDpftconInit
Expand Down Expand Up @@ -823,6 +824,10 @@ subroutine Register_PFT(this, fates_params)
call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, &
dimension_names=dim_names, lower_bounds=dim_lower_bound)

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

! adding the hlm_pft_map variable with two dimensions - FATES PFTno and HLM PFTno
pftmap_dim_names(1) = dimension_name_pft
pftmap_dim_names(2) = dimension_name_hlm_pftno
Expand Down Expand Up @@ -1283,6 +1288,10 @@ subroutine Receive_PFT(this, fates_params)
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%eca_lambda_ptase)

name = 'fates_wesley_pft_index_fordrydep'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%wesley_pft_index_fordrydep)

name = 'fates_hlm_pft_map'
call fates_params%RetrieveParameterAllocate(name=name, &
data=this%hlm_pft_map)
Expand Down Expand Up @@ -1795,6 +1804,7 @@ subroutine FatesReportPFTParams(is_master)
write(fates_log(),fmt0) 'hydro_pinot_node = ',EDPftvarcon_inst%hydr_pinot_node
write(fates_log(),fmt0) 'hydro_kmax_node = ',EDPftvarcon_inst%hydr_kmax_node
write(fates_log(),fmt0) 'hlm_pft_map = ', EDPftvarcon_inst%hlm_pft_map
write(fates_log(),fmt0) 'wesley_pft_index_fordrydep = ', EDPftvarcon_inst%wesley_pft_index_fordrydep
write(fates_log(),fmt0) 'hydro_vg_alpha_node = ',EDPftvarcon_inst%hydr_vg_alpha_node
write(fates_log(),fmt0) 'hydro_vg_m_node = ',EDPftvarcon_inst%hydr_vg_m_node
write(fates_log(),fmt0) 'hydro_vg_n_node = ',EDPftvarcon_inst%hydr_vg_n_node
Expand Down
5 changes: 4 additions & 1 deletion main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ subroutine zero_bcs(fates,s)
fates%bc_out(s)%z0m_pa(:) = 0.0_r8
fates%bc_out(s)%dleaf_pa(:) = 0.0_r8
fates%bc_out(s)%nocomp_pft_label_pa(:) = 0

fates%bc_out(s)%wesley_pft_label_pa(:) = 0
fates%bc_out(s)%drydep_season_pa(:) = 0
fates%bc_out(s)%canopy_fraction_pa(:) = 0.0_r8
fates%bc_out(s)%frac_veg_nosno_alb_pa(:) = 0.0_r8

Expand Down Expand Up @@ -718,6 +719,8 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in)
allocate(bc_out%frac_veg_nosno_alb_pa(maxpatch_total))

allocate(bc_out%nocomp_pft_label_pa(maxpatch_total))
allocate(bc_out%wesley_pft_label_pa(maxpatch_total))
allocate(bc_out%drydep_season_pa(maxpatch_total))

! Plant-Hydro BC's
if (hlm_use_planthydro.eq.itrue) then
Expand Down
2 changes: 2 additions & 0 deletions main/FatesInterfaceTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ module FatesInterfaceTypesMod
! [0,1]

integer, allocatable :: nocomp_pft_label_pa(:) ! in nocomp and SP mode, each patch has a PFT identity.
integer, allocatable :: wesley_pft_label_pa(:) ! For dry deposition, each FATES PFT needs to correspond to a PFT from the 'wesley 1989' scheme
integer, allocatable :: drydep_season_pa(:) ! For dry deposition, we need to define the season index, from 1-5, for the purposes of detrmining the deposition velocity parameters. See drydep code for details of season indices.

! FATES Hydraulics

Expand Down
5 changes: 5 additions & 0 deletions parameter_files/fates_params_default.cdl
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ variables:
double fates_hlm_pft_map(fates_hlm_pftno, fates_pft) ;
fates_hlm_pft_map:units = "area fraction" ;
fates_hlm_pft_map:long_name = "In fixed biogeog mode, fraction of HLM area associated with each FATES PFT" ;
double fates_wesley_pft_index_fordrydep(fates_pft) ;
fates_wesley_pft_index_fordrydep:units = "integer index";
fates_wesley_pft_index_fordrydep:long_name = "index to map from fates pfts into the wesley pft space used to determing dry deposition veolcity." ;
double fates_fire_FBD(fates_litterclass) ;
fates_fire_FBD:units = "kg Biomass/m3" ;
fates_fire_FBD:long_name = "fuel bulk density" ;
Expand Down Expand Up @@ -1687,6 +1690,8 @@ data:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ;

fates_wesley_pft_index_fordrydep = 4, 5, 5, 4, 4, 4, 11, 11, 11 ,3, 3, 3, 3, 3;

fates_fire_FBD = 15.4, 16.8, 19.6, 999, 4, 4 ;

fates_fire_low_moisture_Coeff = 1.12, 1.09, 0.98, 0.8, 1.15, 1.15 ;
Expand Down