diff --git a/src/canopy_bioemi_mod.F90 b/src/canopy_bioemi_mod.F90 index 5a927cb1..536a561a 100644 --- a/src/canopy_bioemi_mod.F90 +++ b/src/canopy_bioemi_mod.F90 @@ -9,7 +9,7 @@ SUBROUTINE CANOPY_BIO( ZK, FCLAI, FCH, LAI, FSUN, PPFD_SUN, & PPFD_SHADE, TLEAF_SUN, TLEAF_SHADE, TLEAF_AVE, TEMP2, LU_OPT, & VTYPE, MODRES, CCE, VERT, CO2OPT, CO2SET, & LEAFAGEOPT, PASTLAI, CURRENTLAI, TSTEPLAI, & - EMI_IND, EMI_OUT) + MODLAYS, EMI_IND, EMI_OUT) !----------------------------------------------------------------------- @@ -70,6 +70,7 @@ SUBROUTINE CANOPY_BIO( ZK, FCLAI, FCH, LAI, FSUN, PPFD_SUN, & REAL(RK), INTENT( IN ) :: CURRENTLAI ! Current LAI [cm2/cm2] REAL(RK), INTENT( IN ) :: TSTEPLAI !Number of days between the past and current LAI + INTEGER, INTENT( IN ) :: MODLAYS ! Input total model layers INTEGER, INTENT( IN ) :: EMI_IND ! Input biogenic emissions index REAL(RK), INTENT( OUT ) :: EMI_OUT(:) ! Output canopy layer volume emissions (kg m-3 s-1) @@ -187,7 +188,7 @@ SUBROUTINE CANOPY_BIO( ZK, FCLAI, FCH, LAI, FSUN, PPFD_SUN, & end do else if (VERT .eq. 1) then !"MEGANv3-like": Use weighting factors normalized to plant distribution shape (FCLAI) !across canopy layers - LAYERS = floor(FCH/MODRES) + 1 + LAYERS = min((floor(FCH/MODRES) + 1),MODLAYS) do i=1, SIZE(ZK) if (ZK(i) .gt. 0.0 .and. ZK(i) .le. FCH) then FLAI(i) = ((FCLAI(i+1) - FCLAI(i)) * LAI)/MODRES !fractional LAI in each layer converted to LAD (m2 m-3) @@ -205,7 +206,7 @@ SUBROUTINE CANOPY_BIO( ZK, FCLAI, FCH, LAI, FSUN, PPFD_SUN, & !across canopy layers using 5 layer numbers directly from MEGANv3 !--warning: weights are not consistent with FCLAI distribution !used for biomass distribution used for sunlit/shaded in Gamma TLEAF and GammaPPFD. - LAYERS = floor(FCH/MODRES) + 1 + LAYERS = min((floor(FCH/MODRES) + 1),MODLAYS) do i=1, SIZE(ZK) if (ZK(i) .gt. FCH) then GAUSS(i) = 0.0 @@ -237,7 +238,7 @@ SUBROUTINE CANOPY_BIO( ZK, FCLAI, FCH, LAI, FSUN, PPFD_SUN, & !across canopy layers !--warning: weights are not consistent with FCLAI distribution !used for biomass distribution used for sunlit/shaded in Gamma TLEAF and GammaPPFD. - LAYERS = floor(FCH/MODRES) + 1 + LAYERS = min((floor(FCH/MODRES) + 1),MODLAYS) do i=1, SIZE(ZK) VPGWT(i) = 1.0_rk/LAYERS end do diff --git a/src/canopy_calcs.F90 b/src/canopy_calcs.F90 index c3b01f55..62231226 100644 --- a/src/canopy_calcs.F90 +++ b/src/canopy_calcs.F90 @@ -272,133 +272,133 @@ SUBROUTINE canopy_calcs(nn) tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 1, emi_isop_3d(i,j,:)) + modlays, 1, emi_isop_3d(i,j,:)) !MYRC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 2, emi_myrc_3d(i,j,:)) + modlays, 2, emi_myrc_3d(i,j,:)) !SABI call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 3, emi_sabi_3d(i,j,:)) + modlays, 3, emi_sabi_3d(i,j,:)) !LIMO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 4, emi_limo_3d(i,j,:)) + modlays, 4, emi_limo_3d(i,j,:)) !CARE call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 5, emi_care_3d(i,j,:)) + modlays, 5, emi_care_3d(i,j,:)) !OCIM call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 6, emi_ocim_3d(i,j,:)) + modlays, 6, emi_ocim_3d(i,j,:)) !BPIN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 7, emi_bpin_3d(i,j,:)) + modlays, 7, emi_bpin_3d(i,j,:)) !APIN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 8, emi_apin_3d(i,j,:)) + modlays, 8, emi_apin_3d(i,j,:)) !MONO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 9, emi_mono_3d(i,j,:)) + modlays, 9, emi_mono_3d(i,j,:)) !FARN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 10, emi_farn_3d(i,j,:)) + modlays, 10, emi_farn_3d(i,j,:)) !CARY call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 11, emi_cary_3d(i,j,:)) + modlays, 11, emi_cary_3d(i,j,:)) !SESQ call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 12, emi_sesq_3d(i,j,:)) + modlays, 12, emi_sesq_3d(i,j,:)) !MBOL call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 13, emi_mbol_3d(i,j,:)) + modlays, 13, emi_mbol_3d(i,j,:)) !METH call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 14, emi_meth_3d(i,j,:)) + modlays, 14, emi_meth_3d(i,j,:)) !ACET call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 15, emi_acet_3d(i,j,:)) + modlays, 15, emi_acet_3d(i,j,:)) !CO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 16, emi_co_3d(i,j,:)) + modlays, 16, emi_co_3d(i,j,:)) !BIDI VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 17, emi_bvoc_3d(i,j,:)) + modlays, 17, emi_bvoc_3d(i,j,:)) !Stress VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 18, emi_svoc_3d(i,j,:)) + modlays, 18, emi_svoc_3d(i,j,:)) !Other VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 19, emi_ovoc_3d(i,j,:)) + modlays, 19, emi_ovoc_3d(i,j,:)) end if end if @@ -677,133 +677,133 @@ SUBROUTINE canopy_calcs(nn) tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 1, emi_isop(loc,:)) + modlays, 1, emi_isop(loc,:)) !MYRC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 2, emi_myrc(loc,:)) + modlays, 2, emi_myrc(loc,:)) !SABI call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 3, emi_sabi(loc,:)) + modlays, 3, emi_sabi(loc,:)) !LIMO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 4, emi_limo(loc,:)) + modlays, 4, emi_limo(loc,:)) !CARE call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 5, emi_care(loc,:)) + modlays, 5, emi_care(loc,:)) !OCIM call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 6, emi_ocim(loc,:)) + modlays, 6, emi_ocim(loc,:)) !BPIN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 7, emi_bpin(loc,:)) + modlays, 7, emi_bpin(loc,:)) !APIN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 8, emi_apin(loc,:)) + modlays, 8, emi_apin(loc,:)) !MONO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 9, emi_mono(loc,:)) + modlays, 9, emi_mono(loc,:)) !FARN call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 10, emi_farn(loc,:)) + modlays, 10, emi_farn(loc,:)) !CARY call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 11, emi_cary(loc,:)) + modlays, 11, emi_cary(loc,:)) !SESQ call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 12, emi_sesq(loc,:)) + modlays, 12, emi_sesq(loc,:)) !MBOL call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 13, emi_mbol(loc,:)) + modlays, 13, emi_mbol(loc,:)) !METH call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 14, emi_meth(loc,:)) + modlays, 14, emi_meth(loc,:)) !ACET call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 15, emi_acet(loc,:)) + modlays, 15, emi_acet(loc,:)) !CO call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 16, emi_co(loc,:)) + modlays, 16, emi_co(loc,:)) !BIDI VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 17, emi_bvoc(loc,:)) + modlays, 17, emi_bvoc(loc,:)) !Stress VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 18, emi_svoc(loc,:)) + modlays, 18, emi_svoc(loc,:)) !Other VOC call canopy_bio(zk, fafraczInt, hcmref, & lairef, fsun, ppfd_sun, ppfd_shade, tleaf_sun, tleaf_shade, & tleaf_ave, tmp2mref, & lu_opt, vtyperef, modres, bio_cce, biovert_opt, co2_opt, co2_set, & leafage_opt, pastlai, currentlai, tsteplai, & - 19, emi_ovoc(loc,:)) + modlays, 19, emi_ovoc(loc,:)) end if end if