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

canopy resistance unit fixes #379

Merged
merged 9 commits into from
May 9, 2018
6 changes: 3 additions & 3 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ subroutine nan_cohort(cc_p)
currentCohort%br = nan ! fine root biomass: kGC per indiv
currentCohort%lai = nan ! leaf area index of cohort m2/m2
currentCohort%sai = nan ! stem area index of cohort m2/m2
currentCohort%gscan = nan ! Stomatal resistance of cohort.
currentCohort%g_sb_laweight = nan ! Total leaf conductance of cohort (stomata+blayer) weighted by leaf-area [m/s]*[m2]
currentCohort%canopy_trim = nan ! What is the fraction of the maximum leaf biomass that we are targeting? :-
currentCohort%leaf_cost = nan ! How much does it cost to maintain leaves: kgC/m2/year-1
currentCohort%excl_weight = nan ! How much of this cohort is demoted each year, as a proportion of all cohorts:-
Expand Down Expand Up @@ -362,7 +362,7 @@ subroutine zero_cohort(cc_p)
currentcohort%npp_acc_hold = 0._r8
currentcohort%gpp_acc_hold = 0._r8
currentcohort%dmort = 0._r8
currentcohort%gscan = 0._r8
currentcohort%g_sb_laweight = 0._r8
currentcohort%treesai = 0._r8
currentCohort%lmort_direct = 0._r8
currentCohort%lmort_infra = 0._r8
Expand Down Expand Up @@ -1112,7 +1112,7 @@ subroutine copy_cohort( currentCohort,copyc )
n%br = o%br
n%lai = o%lai
n%sai = o%sai
n%gscan = o%gscan
n%g_sb_laweight = o%g_sb_laweight
n%leaf_cost = o%leaf_cost
n%canopy_layer = o%canopy_layer
n%canopy_layer_yesterday = o%canopy_layer_yesterday
Expand Down
6 changes: 5 additions & 1 deletion biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,8 @@ subroutine zero_patch(cp_p)
currentPatch%sabs_dir(:) = 0.0_r8
currentPatch%sabs_dif(:) = 0.0_r8
currentPatch%zstar = 0.0_r8
currentPatch%c_stomata = 0.0_r8 ! This is calculated immediately before use
currentPatch%c_lblayer = 0.0_r8

end subroutine zero_patch

Expand Down Expand Up @@ -1588,7 +1590,9 @@ subroutine fuse_2_patches(csite, dp, rp)
rp%burnt_frac_litter(:) = (dp%burnt_frac_litter(:)*dp%area + rp%burnt_frac_litter(:)*rp%area) * inv_sum_area
rp%btran_ft(:) = (dp%btran_ft(:)*dp%area + rp%btran_ft(:)*rp%area) * inv_sum_area
rp%zstar = (dp%zstar*dp%area + rp%zstar*rp%area) * inv_sum_area

rp%c_stomata = (dp%c_stomata*dp%area + rp%c_stomata*rp%area) * inv_sum_area
rp%c_lblayer = (dp%c_lblayer*dp%area + rp%c_lblayer*rp%area) * inv_sum_area

rp%area = rp%area + dp%area !THIS MUST COME AT THE END!

!insert donor cohorts into recipient patch
Expand Down
2 changes: 1 addition & 1 deletion biogeochem/FatesAllometryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ subroutine carea_allom(d,nplant,site_spread,ipft,c_area)
real(r8),intent(in) :: site_spread ! site level spread factor (crowdedness)
real(r8),intent(in) :: nplant ! number of plants [1/ha]
integer(i4),intent(in) :: ipft ! PFT index
real(r8),intent(out) :: c_area ! crown area per plant (m2)
real(r8),intent(out) :: c_area ! crown area per cohort (m2)

real(r8) :: d_eff ! Effective diameter (cm)

Expand Down
12 changes: 7 additions & 5 deletions biogeophys/EDBtranMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ subroutine btran_ed( nsites, sites, bc_in, bc_out)
real(r8) :: smp_node ! matrix potential
real(r8) :: rresis ! suction limitation to transpiration independent
! of root density
real(r8) :: pftgs(maxpft) ! pft weighted stomatal conductance s/m
real(r8) :: pftgs(maxpft) ! pft weighted stomatal conductance m/s
real(r8) :: temprootr
real(r8) :: sum_pftgs ! sum of weighted conductances (for normalization)
!------------------------------------------------------------------------------
Expand Down Expand Up @@ -173,11 +173,13 @@ subroutine btran_ed( nsites, sites, bc_in, bc_out)
end do !PFT

! PFT-averaged point level root fraction for extraction purposese.
! This probably needs to be weighted by actual transpiration from each pft. FIX(RF,032414).
pftgs(:) = 0._r8
! The cohort's conductance g_sb_laweighted, contains a weighting factor
! based on the cohort's leaf area. units: [m/s] * [m2]

pftgs(1:maxpft) = 0._r8
ccohort => cpatch%tallest
do while(associated(ccohort))
pftgs(ccohort%pft) = pftgs(ccohort%pft) + ccohort%gscan * ccohort%n
pftgs(ccohort%pft) = pftgs(ccohort%pft) + ccohort%g_sb_laweight
ccohort => ccohort%shorter
enddo

Expand All @@ -196,7 +198,7 @@ subroutine btran_ed( nsites, sites, bc_in, bc_out)
cpatch%rootr_ft(ft,j) * pftgs(ft)/sum_pftgs
else
bc_out(s)%rootr_pagl(ifp,j) = bc_out(s)%rootr_pagl(ifp,j) + &
cpatch%rootr_ft(ft,j) * 1./numpft
cpatch%rootr_ft(ft,j) * 1._r8/dble(numpft)
end if
enddo
enddo
Expand Down
Loading