From 4b974a86411f4728bf623f67ea1d6a27c01b31b2 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 14 Jun 2016 14:01:35 -0700 Subject: [PATCH 1/2] 1) removed hard-coded stomatal slopes (mbbopt), and pushed bb_slope to be used directly instead of mbb, which was a redundant variable. 2) removed redundant conductance and interstitial co2 calculations. --- biogeophys/EDPhotosynthesisMod.F90 | 39 ++++++++++++------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/biogeophys/EDPhotosynthesisMod.F90 b/biogeophys/EDPhotosynthesisMod.F90 index 058cbc749c..c5691b08f6 100644 --- a/biogeophys/EDPhotosynthesisMod.F90 +++ b/biogeophys/EDPhotosynthesisMod.F90 @@ -95,10 +95,12 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & real(r8) :: kc( bounds%begp:bounds%endp ) ! Michaelis-Menten constant for CO2 (Pa) real(r8) :: ko( bounds%begp:bounds%endp ) ! Michaelis-Menten constant for O2 (Pa) real(r8) :: co2_cp( bounds%begp:bounds%endp ) ! CO2 compensation point (Pa) + + ! --------------------------------------------------------------- + ! TO-DO: bbbopt is slated to be transferred to the parameter file + ! ---------------------------------------------------------------- real(r8) :: bbbopt(psn_type) ! Ball-Berry minimum leaf conductance, unstressed (umol H2O/m**2/s) real(r8) :: bbb(mxpft) ! Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - real(r8) :: mbbopt(psn_type) ! Ball-Berry slope of conductance-photosynthesis relationship, unstressed - real(r8) :: mbb(mxpft) ! Ball-Berry slope of conductance-photosynthesis relationship real(r8) :: kn(mxpft) ! leaf nitrogen decay coefficient real(r8) :: vcmax25top(mxpft) ! canopy top: maximum rate of carboxylation at 25C (umol CO2/m**2/s) @@ -306,12 +308,11 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & qe(1) = 0._r8 theta_cj(1) = 0.98_r8 bbbopt(1) = 10000._r8 - mbbopt(1) = 9._r8 qe(2) = 0.05_r8 theta_cj(2) = 0.80_r8 bbbopt(2) = 40000._r8 - mbbopt(2) = 4._r8 + do f = 1,fn p = filterp(f) @@ -355,17 +356,6 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & enddo !ft enddo !CL - ! Soil water stress applied to Ball-Berry parameters - do FT = 1,numpft_ed - if (nint(c3psn(FT)) == 1)then - ps = 1 - else - ps = 2 - end if - bbb(FT) = max (bbbopt(ps)*currentPatch%btran_ft(FT), 1._r8) - - mbb(FT) = bb_slope(ft) ! mbbopt(ps) - end do ! kc, ko, currentPatch, from: Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 ! @@ -410,25 +400,24 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & currentPatch => map_clmpatch_to_edpatch(sites(s), p) - do FT = 1,numpft_ed + NCL_p = currentPatch%NCL_p + + do FT = 1,numpft_ed !calculate patch and pft specific propserties at canopy top. + if (nint(c3psn(FT)) == 1)then ps = 1 else ps = 2 end if bbb(FT) = max (bbbopt(ps)*currentPatch%btran_ft(FT), 1._r8) - mbb(FT) = mbbopt(ps) + ! THIS CALL APPEARS TO BE REDUNDANT WITH LINE 650 (RGK) if (nint(c3psn(FT)) == 1)then ci(:,FT,:) = 0.7_r8 * cair(p) else ci(:,FT,:) = 0.4_r8 * cair(p) end if - enddo - - NCL_p = currentPatch%NCL_p - do FT = 1,numpft_ed !calculate patch and pft specific propserties at canopy top. ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) lnc(FT) = 1._r8 / (slatop(FT) * leafcn(FT)) @@ -647,6 +636,8 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & je = min(r1,r2) ! Iterative loop for ci beginning with initial guess + ! THIS CALL APPEARS TO BE REDUNDANT WITH LINE 423 (RGK) + if (nint(c3psn(FT)) == 1)then ci(cl,ft,iv) = 0.7_r8 * cair(p) else @@ -719,8 +710,8 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & cs = cair(p) - 1.4_r8/gb_mol * an(cl,ft,iv) * forc_pbot(c) cs = max(cs,1.e-06_r8) aquad = cs - bquad = cs*(gb_mol - bbb(FT)) - mbb(FT)*an(cl,ft,iv)*forc_pbot(c) - cquad = -gb_mol*(cs*bbb(FT) + mbb(FT)*an(cl,ft,iv)*forc_pbot(c)*ceair/esat_tv(p)) + bquad = cs*(gb_mol - bbb(FT)) - bb_slope(ft)*an(cl,ft,iv)*forc_pbot(c) + cquad = -gb_mol*(cs*bbb(FT) + bb_slope(ft)*an(cl,ft,iv)*forc_pbot(c)*ceair/esat_tv(p)) call quadratic (aquad, bquad, cquad, r1, r2) gs_mol = max(r1,r2) @@ -788,7 +779,7 @@ subroutine Photosynthesis_ED (bounds, fn, filterp, esat_tv, eair, oair, cair, & ! Compare with Ball-Berry model: gs_mol = m * an * hs/cs p + b hs = (gb_mol*ceair + gs_mol*esat_tv(p)) / ((gb_mol+gs_mol)*esat_tv(p)) - gs_mol_err = mbb(FT)*max(an(cl,ft,iv), 0._r8)*hs/cs*forc_pbot(c) + bbb(FT) + gs_mol_err = bb_slope(ft)*max(an(cl,ft,iv), 0._r8)*hs/cs*forc_pbot(c) + bbb(FT) if (abs(gs_mol-gs_mol_err) > 1.e-01_r8) then write (iulog,*) 'CF: Ball-Berry error check - stomatal conductance error:' From 9393283264580d134615f0ea4c8675e566d5534e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 14 Jun 2016 14:05:07 -0700 Subject: [PATCH 2/2] moved calculation of c_area to happen before its used. --- main/EDCLMLinkMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/EDCLMLinkMod.F90 b/main/EDCLMLinkMod.F90 index e8648ccd03..71a131f4a5 100755 --- a/main/EDCLMLinkMod.F90 +++ b/main/EDCLMLinkMod.F90 @@ -1093,10 +1093,10 @@ subroutine ed_clm_link( this, bounds, sites, nsites, fcolumn, waterstate_inst, c currentCohort%b = currentCohort%balive+currentCohort%bdead+currentCohort%bstore currentCohort%treelai = tree_lai(currentCohort) - ! Why is currentCohort%c_area used and then reset in the - ! following line? - canopy_leaf_area = canopy_leaf_area + currentCohort%treelai *currentCohort%c_area + currentCohort%c_area = c_area(currentCohort) + canopy_leaf_area = canopy_leaf_area + currentCohort%treelai *currentCohort%c_area + if(currentCohort%canopy_layer==1)then currentPatch%total_canopy_area = currentPatch%total_canopy_area + currentCohort%c_area