@@ -191,7 +191,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
191191 ! Ball-Berry minimum leaf conductance, unstressed (umol H2O/m**2/s)
192192 ! For C3 and C4 plants
193193 ! -----------------------------------------------------------------------------------
194- real (r8 ), dimension (2 ) :: bbbopt
194+ real (r8 ), dimension (0 : 1 ) :: bbbopt
195195
196196 associate( &
197197 c3psn = > EDPftvarcon_inst% c3psn , &
@@ -202,9 +202,9 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
202202 frootcn = > EDPftvarcon_inst% frootcn, & ! froot C:N (gc/gN) ! slope of BB relationship
203203 q10 = > FatesSynchronizedParamsInst% Q10 )
204204
205+ bbbopt(0 ) = ED_val_bbopt_c4
205206 bbbopt(1 ) = ED_val_bbopt_c3
206- bbbopt(2 ) = ED_val_bbopt_c4
207-
207+
208208 do s = 1 ,nsites
209209
210210 ! Multi-layer parameters scaled by leaf nitrogen profile.
@@ -721,7 +721,8 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
721721
722722 ! Locals
723723 ! ------------------------------------------------------------------------
724- integer :: pp_type ! Index for the different photosynthetic pathways C3,C4
724+ integer :: c3c4_path_index ! Index for which photosynthetic pathway
725+ ! is active. C4 = 0, C3 = 1
725726 integer :: sunsha ! Index for differentiating sun and shade
726727 real (r8 ) :: gstoma ! Stomatal Conductance of this leaf layer (m/s)
727728 real (r8 ) :: agross ! co-limited gross leaf photosynthesis (umol CO2/m**2/s)
@@ -758,22 +759,23 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
758759 real (r8 ),parameter :: init_a2l_co2_c3 = 0.7_r8
759760 real (r8 ),parameter :: init_a2l_co2_c4 = 0.4_r8
760761
761- ! quantum efficiency, used only for C4 (mol CO2 / mol photons)
762- real (r8 ),parameter ,dimension (2 ) :: quant_eff = [0.0_r8 ,0.05_r8 ]
762+ ! quantum efficiency, used only for C4 (mol CO2 / mol photons) (index 0)
763+ real (r8 ),parameter ,dimension (0 : 1 ) :: quant_eff = [0.05_r8 ,0.0_r8 ]
763764
764765 ! empirical curvature parameter for ac, aj photosynthesis co-limitation
765- real (r8 ),parameter ,dimension (2 ) :: theta_cj = [0.98_r8 ,0.80_r8 ]
766+ real (r8 ),parameter ,dimension (0 : 1 ) :: theta_cj = [0.80_r8 ,0.98_r8 ]
766767
767768 ! empirical curvature parameter for ap photosynthesis co-limitation
768769 real (r8 ),parameter :: theta_ip = 0.95_r8
769770
770- associate( bb_slope = > EDPftvarcon_inst% BB_slope ) ! slope of BB relationship
771+ associate( bb_slope = > EDPftvarcon_inst% BB_slope) ! slope of BB relationship
772+
773+ ! photosynthetic pathway: 0. = c4, 1. = c3
774+ c3c4_path_index = nint (EDPftvarcon_inst% c3psn(ft))
771775
772- if (nint (EDPftvarcon_inst% c3psn(ft)) == 1 ) then ! photosynthetic pathway: 0. = c4, 1. = c3
773- pp_type = 1
776+ if (c3c4_path_index == 1 ) then
774777 init_co2_intra_c = init_a2l_co2_c3 * can_co2_ppress
775778 else
776- pp_type = 2
777779 init_co2_intra_c = init_a2l_co2_c4 * can_co2_ppress
778780 end if
779781
@@ -845,7 +847,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
845847 co2_intra_c_old = co2_intra_c
846848
847849 ! Photosynthesis limitation rate calculations
848- if (pp_type == 1 )then
850+ if (c3c4_path_index == 1 )then
849851
850852 ! C3: Rubisco-limited photosynthesis
851853 ac = vcmax * max (co2_intra_c- co2_cpoint, 0._r8 ) / &
@@ -867,14 +869,14 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
867869 if (sunsha == 1 )then ! sunlit
868870 ! guard against /0's in the night.
869871 if ((laisun_lsl * canopy_area_lsl) > 0.0000000001_r8 ) then
870- aj = quant_eff(pp_type ) * parsun_lsl * 4.6_r8
872+ aj = quant_eff(c3c4_path_index ) * parsun_lsl * 4.6_r8
871873 ! convert from per cohort to per m2 of leaf)
872874 aj = aj / (laisun_lsl * canopy_area_lsl)
873875 else
874876 aj = 0._r8
875877 end if
876878 else
877- aj = quant_eff(pp_type ) * parsha_lsl * 4.6_r8
879+ aj = quant_eff(c3c4_path_index ) * parsha_lsl * 4.6_r8
878880 aj = aj / (laisha_lsl * canopy_area_lsl)
879881 end if
880882
@@ -884,7 +886,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
884886 end if
885887
886888 ! Gross photosynthesis smoothing calculations. First co-limit ac and aj. Then co-limit ap
887- aquad = theta_cj(pp_type )
889+ aquad = theta_cj(c3c4_path_index )
888890 bquad = - (ac + aj)
889891 cquad = ac * aj
890892 call quadratic_f (aquad, bquad, cquad, r1, r2)
0 commit comments