diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 094a105c20..5c003600f4 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -10,6 +10,7 @@ module EDCanopyStructureMod use FatesConstantsMod , only : tinyr8 use FatesConstantsMod , only : nearzero use FatesConstantsMod , only : rsnbl_math_prec + use FatesConstantsMod , only : nocomp_bareground use FatesGlobals , only : fates_log use EDPftvarcon , only : EDPftvarcon_inst use PRTParametersMod , only : prt_params @@ -1369,7 +1370,7 @@ subroutine canopy_summarization( nsites, sites, bc_in ) endif ! adding checks for SP and NOCOMP modes. - if(currentPatch%nocomp_pft_label.eq.0)then + if(currentPatch%nocomp_pft_label.eq.nocomp_bareground)then write(fates_log(),*) 'cohorts in barepatch',currentPatch%total_canopy_area,currentPatch%nocomp_pft_label call endrun(msg=errMsg(sourcefile, __LINE__)) end if @@ -1828,7 +1829,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) c = fcolumn(s) do while(associated(currentPatch)) - if(currentPatch%nocomp_pft_label.ne.0)then ! ignore the bare-ground-PFT patch entirely for these BC outs + if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! ignore the bare-ground-PFT patch entirely for these BC outs ifp = ifp+1 @@ -1970,7 +1971,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) currentPatch => sites(s)%oldest_patch ifp = 0 do while(associated(currentPatch)) - if(currentPatch%nocomp_pft_label.ne.0)then ! for vegetated patches only + 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 diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index dba1a67d13..a5c2202430 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -39,6 +39,7 @@ module EDPatchDynamicsMod use EDTypesMod , only : AREA_INV use FatesConstantsMod , only : rsnbl_math_prec use FatesConstantsMod , only : fates_tiny + use FatesConstantsMod , only : nocomp_bareground use FatesInterfaceTypesMod , only : hlm_use_planthydro use FatesInterfaceTypesMod , only : hlm_numSWb use FatesInterfaceTypesMod , only : bc_in_type @@ -1282,11 +1283,11 @@ subroutine set_patchno( currentSite ) currentPatch => currentPatch%younger enddo - if(hlm_use_sp.eq.itrue)then + if(hlm_use_fixed_biogeog.eq.itrue .and. hlm_use_nocomp.eq.itrue)then patchno = 1 currentPatch => currentSite%oldest_patch do while(associated(currentPatch)) - if(currentPatch%nocomp_pft_label.eq.0)then + if(currentPatch%nocomp_pft_label.eq.nocomp_bareground)then ! for bareground patch, we make the patch number 0 ! we also do not count this in the veg. patch numbering scheme. currentPatch%patchno = 0 @@ -2027,7 +2028,7 @@ subroutine create_patch(currentSite, new_patch, age, areap, label,nocomp_pft) real(r8), intent(in) :: age ! notional age of this patch in years real(r8), intent(in) :: areap ! initial area of this patch in m2. integer, intent(in) :: label ! anthropogenic disturbance label - integer, intent(in) :: nocomp_pft + integer, intent(in) :: nocomp_pft ! no competition mode pft label ! Until bc's are pointed to by sites give veg a default temp [K] diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 5eacaf00aa..778a02a84d 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -23,6 +23,7 @@ module EDPhysiologyMod use FatesInterfaceTypesMod, only : hlm_use_tree_damage use FatesConstantsMod, only : r8 => fates_r8 use FatesConstantsMod, only : nearzero + use FatesConstantsMod, only : nocomp_bareground use EDPftvarcon , only : EDPftvarcon_inst use PRTParametersMod , only : prt_params use EDPftvarcon , only : GetDecompyFrac @@ -2668,7 +2669,7 @@ subroutine fragmentation_scaler( currentPatch, bc_in) catanf(t1) = 11.75_r8 +(29.7_r8 / pi) * atan( pi * 0.031_r8 * ( t1 - 15.4_r8 )) catanf_30 = catanf(30._r8) - if(currentPatch%nocomp_pft_label.ne.0)then + if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! Use the hlm temp and moisture decomp fractions by default if ( use_hlm_soil_scalar ) then diff --git a/biogeophys/EDAccumulateFluxesMod.F90 b/biogeophys/EDAccumulateFluxesMod.F90 index 559fa5b0af..9756c743f0 100644 --- a/biogeophys/EDAccumulateFluxesMod.F90 +++ b/biogeophys/EDAccumulateFluxesMod.F90 @@ -13,6 +13,7 @@ module EDAccumulateFluxesMod use FatesGlobals, only : fates_log use shr_log_mod , only : errMsg => shr_log_errMsg use FatesConstantsMod , only : r8 => fates_r8 + use FatesConstantsMod , only : nocomp_bareground implicit none @@ -64,7 +65,7 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) cpatch => sites(s)%oldest_patch do while (associated(cpatch)) - if(cpatch%nocomp_pft_label.ne.0)then + if(cpatch%nocomp_pft_label.ne.nocomp_bareground)then ifp = ifp+1 if( bc_in(s)%filter_photo_pa(ifp) == 3 ) then diff --git a/biogeophys/EDBtranMod.F90 b/biogeophys/EDBtranMod.F90 index 52577b1b92..7b803469e5 100644 --- a/biogeophys/EDBtranMod.F90 +++ b/biogeophys/EDBtranMod.F90 @@ -8,6 +8,7 @@ module EDBtranMod use EDPftvarcon , only : EDPftvarcon_inst use FatesConstantsMod , only : tfrz => t_water_freeze_k_1atm use FatesConstantsMod , only : itrue,ifalse,nearzero + use FatesConstantsMod , only : nocomp_bareground use EDTypesMod , only : ed_site_type, & ed_patch_type, & ed_cohort_type, & @@ -138,7 +139,7 @@ subroutine btran_ed( nsites, sites, bc_in, bc_out) ifp = 0 cpatch => sites(s)%oldest_patch do while (associated(cpatch)) - if(cpatch%nocomp_pft_label.ne.0)then ! only for veg patches + if(cpatch%nocomp_pft_label.ne.nocomp_bareground)then ! only for veg patches ifp=ifp+1 ! THIS SHOULD REALLY BE A COHORT LOOP ONCE WE HAVE rootfr_ft FOR COHORTS (RGK) diff --git a/biogeophys/EDSurfaceAlbedoMod.F90 b/biogeophys/EDSurfaceAlbedoMod.F90 index ddb25f08a4..48b9d1e448 100644 --- a/biogeophys/EDSurfaceAlbedoMod.F90 +++ b/biogeophys/EDSurfaceAlbedoMod.F90 @@ -15,6 +15,7 @@ module EDSurfaceRadiationMod use FatesConstantsMod , only : r8 => fates_r8 use FatesConstantsMod , only : itrue use FatesConstantsMod , only : pi_const + use FatesConstantsMod , only : nocomp_bareground use FatesInterfaceTypesMod , only : bc_in_type use FatesInterfaceTypesMod , only : bc_out_type use FatesInterfaceTypesMod , only : hlm_numSWb @@ -100,7 +101,7 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out ) ifp = 0 currentpatch => sites(s)%oldest_patch do while (associated(currentpatch)) - if(currentpatch%nocomp_pft_label.ne.0)then + if(currentpatch%nocomp_pft_label.ne.nocomp_bareground)then ! do not do albedo calculations for bare ground patch in SP mode ! and (more impotantly) do not iterate ifp or it will mess up the indexing wherein ! ifp=1 is the first vegetated patch. @@ -1147,7 +1148,7 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out) cpatch => sites(s)%oldest_patch do while (associated(cpatch)) - if(cpatch%nocomp_pft_label.ne.0)then !only for veg patches + if(cpatch%nocomp_pft_label.ne.nocomp_bareground)then !only for veg patches ! do not do albedo calculations for bare ground patch in SP mode ! and (more impotantly) do not iterate ifp or it will mess up the indexing wherein ! ifp=1 is the first vegetated patch. diff --git a/biogeophys/FatesPlantHydraulicsMod.F90 b/biogeophys/FatesPlantHydraulicsMod.F90 index 752c903b03..f1e391fe8f 100644 --- a/biogeophys/FatesPlantHydraulicsMod.F90 +++ b/biogeophys/FatesPlantHydraulicsMod.F90 @@ -42,6 +42,7 @@ module FatesPlantHydraulicsMod use FatesConstantsMod, only : cm3_per_m3 use FatesConstantsMod, only : kg_per_g use FatesConstantsMod, only : fates_unset_r8 + use FatesConstantsMod, only : nocomp_bareground use EDParamsMod , only : hydr_kmax_rsurf1 use EDParamsMod , only : hydr_kmax_rsurf2 @@ -2546,7 +2547,7 @@ subroutine hydraulics_bc ( nsites, sites, bc_in, bc_out, dtime) ifp = 0 cpatch => sites(s)%oldest_patch do while (associated(cpatch)) - if(cpatch%nocomp_pft_label.ne.0)then + if(cpatch%nocomp_pft_label.ne.nocomp_bareground)then ifp = ifp + 1 ! ---------------------------------------------------------------------------- diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index d313ac9ce2..01ceb3ac17 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -31,6 +31,7 @@ module FATESPlantRespPhotosynthMod use FatesConstantsMod, only : rgas_J_K_mol use FatesConstantsMod, only : fates_unset_r8 use FatesConstantsMod, only : tfrz => t_water_freeze_k_1atm + use FatesConstantsMod, only : nocomp_bareground use FatesInterfaceTypesMod, only : hlm_use_planthydro use FatesInterfaceTypesMod, only : hlm_parteh_mode use FatesInterfaceTypesMod, only : numpft @@ -324,7 +325,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ifp = 0 currentpatch => sites(s)%oldest_patch do while (associated(currentpatch)) - if(currentpatch%nocomp_pft_label.ne.0)then + if(currentpatch%nocomp_pft_label.ne.nocomp_bareground)then ifp = ifp+1 NCL_p = currentPatch%NCL_p diff --git a/fire/SFMainMod.F90 b/fire/SFMainMod.F90 index fdb3501bd2..16aca5d243 100644 --- a/fire/SFMainMod.F90 +++ b/fire/SFMainMod.F90 @@ -8,6 +8,7 @@ module SFMainMod use FatesConstantsMod , only : r8 => fates_r8 use FatesConstantsMod , only : itrue, ifalse use FatesConstantsMod , only : pi_const + use FatesConstantsMod , only : nocomp_bareground use FatesInterfaceTypesMod , only : hlm_masterproc ! 1= master process, 0=not master process use EDTypesMod , only : numWaterMem use FatesGlobals , only : fates_log @@ -126,6 +127,8 @@ subroutine fire_danger_index ( currentSite, bc_in) type(ed_site_type) , intent(inout), target :: currentSite type(bc_in_type) , intent(in) :: bc_in + type(ed_patch_type), pointer :: currentPatch + real(r8) :: temp_in_C ! daily averaged temperature in celcius real(r8) :: rainfall ! daily precip in mm/day real(r8) :: rh ! daily rh @@ -140,9 +143,17 @@ subroutine fire_danger_index ( currentSite, bc_in) ! is simply using the values associated with the first patch. ! which probably won't have much inpact, unless we decide to ever calculated the NI for each patch. - iofp = currentSite%oldest_patch%patchno + currentPatch => currentSite%oldest_patch + + ! If the oldest patch is a bareground patch (i.e. nocomp mode is on) use the first vegetated patch + ! for the iofp index (i.e. the next younger patch) + if(currentPatch%nocomp_pft_label .eq. nocomp_bareground)then + currentPatch => currentPatch%younger + endif + + iofp = currentPatch%patchno - temp_in_C = currentSite%oldest_patch%tveg24%GetMean() - tfrz + temp_in_C = currentPatch%tveg24%GetMean() - tfrz rainfall = bc_in%precip24_pa(iofp)*sec_per_day rh = bc_in%relhumid24_pa(iofp) @@ -180,11 +191,11 @@ subroutine charecteristics_of_fuel ( currentSite ) fuel_moisture(:) = 0.0_r8 - - currentPatch => currentSite%oldest_patch; do while(associated(currentPatch)) + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + litt_c => currentPatch%litter(element_pos(carbon12_element)) ! How much live grass is there? @@ -325,7 +336,7 @@ subroutine charecteristics_of_fuel ( currentSite ) 0.0_r8.or.currentPatch%fuel_mef <= 0.0_r8.or.currentPatch%fuel_eff_moist <= 0.0_r8)then if ( hlm_masterproc == itrue ) write(fates_log(),*) 'problem with spitfire fuel averaging' endif - + endif !nocomp_pft_label check currentPatch => currentPatch%younger enddo !end patch loop @@ -356,10 +367,17 @@ subroutine wind_effect ( currentSite, bc_in) integer :: iofp ! index of oldest fates patch + currentPatch => currentSite%oldest_patch + + ! If the oldest patch is a bareground patch (i.e. nocomp mode is on) use the first vegetated patch + ! for the iofp index (i.e. the next younger patch) + if(currentPatch%nocomp_pft_label .eq. nocomp_bareground)then + currentPatch => currentPatch%younger + endif + ! note - this is a patch level temperature, which probably won't have much inpact, ! unless we decide to ever calculated the NI for each patch. - - iofp = currentSite%oldest_patch%patchno + iofp = currentPatch%patchno currentSite%wind = bc_in%wind24_pa(iofp) * sec_per_min !Convert to m/min for SPITFIRE if(write_SF == itrue)then @@ -372,6 +390,9 @@ subroutine wind_effect ( currentSite, bc_in) grass_fraction = 0.0_r8 currentPatch=>currentSite%oldest_patch; do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + currentPatch%total_tree_area = 0.0_r8 total_grass_area = 0.0_r8 currentCohort => currentPatch%tallest @@ -394,6 +415,8 @@ subroutine wind_effect ( currentSite, bc_in) write(fates_log(),*) 'SF total_grass_area ',tree_fraction,grass_fraction write(fates_log(),*) 'SF AREA ',AREA endif + + endif !nocomp_pft_label check currentPatch => currentPatch%younger enddo !currentPatch loop @@ -409,9 +432,13 @@ subroutine wind_effect ( currentSite, bc_in) currentPatch=>currentSite%oldest_patch; do while(associated(currentPatch)) + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + currentPatch%total_tree_area = min(currentPatch%total_tree_area,currentPatch%area) ! effect_wspeed in units m/min currentPatch%effect_wspeed = currentSite%wind * (tree_fraction*0.4_r8+(grass_fraction+bare_fraction)*0.6_r8) + + endif ! nocomp_pft_label check currentPatch => currentPatch%younger enddo !end patch loop @@ -450,6 +477,8 @@ subroutine rate_of_spread ( currentSite ) currentPatch=>currentSite%oldest_patch; do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then ! remove mineral content from net fuel load per Thonicke 2010 for ir calculation currentPatch%sum_fuel = currentPatch%sum_fuel * (1.0_r8 - SF_val_miner_total) !net of minerals @@ -555,6 +584,7 @@ subroutine rate_of_spread ( currentSite ) ! backward ROS wind not changed by vegetation currentPatch%ROS_back = currentPatch%ROS_front*exp(-0.012_r8*currentSite%wind) + end if ! nocomp_pft_label check currentPatch => currentPatch%younger enddo !end patch loop @@ -583,6 +613,9 @@ subroutine ground_fuel_consumption ( currentSite ) currentPatch => currentSite%oldest_patch; do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + currentPatch%burnt_frac_litter(:) = 1.0_r8 ! Calculate fraction of litter is burnt for all classes. ! Equation B1 in Thonicke et al. 2010--- @@ -642,6 +675,8 @@ subroutine ground_fuel_consumption ( currentSite ) ! ignore 1000hr fuels. Just interested in fuels affecting ROS currentPatch%TFC_ROS = sum(FC_ground)-FC_ground(tr_sf) + end if ! nocomp_pft_label check + currentPatch=>currentPatch%younger; enddo !end patch loop @@ -702,8 +737,16 @@ subroutine area_burnt_intensity ( currentSite, bc_in ) cloud_to_ground_strikes = cg_strikes end if + currentPatch => currentSite%oldest_patch + + ! If the oldest patch is a bareground patch (i.e. nocomp mode is on) use the first vegetated patch + ! for the iofp index (i.e. the next younger patch) + if(currentPatch%nocomp_pft_label .eq. nocomp_bareground)then + currentPatch => currentPatch%younger + endif + !NF = number of lighting strikes per day per km2 scaled by cloud to ground strikes - iofp = currentSite%oldest_patch%patchno + iofp = currentPatch%patchno if (hlm_spitfire_mode == hlm_sf_scalar_lightning_def ) then currentSite%NF = ED_val_nignitions * years_per_day * cloud_to_ground_strikes else ! use external daily lightning ignition data @@ -726,6 +769,9 @@ subroutine area_burnt_intensity ( currentSite, bc_in ) currentPatch => currentSite%oldest_patch; do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + ! ---initialize patch parameters to zero--- currentPatch%FI = 0._r8 currentPatch%fire = 0 @@ -829,7 +875,8 @@ subroutine area_burnt_intensity ( currentSite, bc_in ) currentPatch%frac_burnt = 0.0_r8 endif - endif! NF ignitions check + endif ! NF ignitions check + endif ! nocomp_pft_label check currentPatch => currentPatch%younger @@ -861,6 +908,8 @@ subroutine crown_scorching ( currentSite ) currentPatch => currentSite%oldest_patch; do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then tree_ag_biomass = 0.0_r8 if (currentPatch%fire == 1) then @@ -894,6 +943,7 @@ subroutine crown_scorching ( currentSite ) end do endif !fire + endif !nocomp_pft_label currentPatch => currentPatch%younger; enddo !end patch loop @@ -916,6 +966,8 @@ subroutine crown_damage ( currentSite ) currentPatch => currentSite%oldest_patch do while(associated(currentPatch)) + + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then if (currentPatch%fire == 1) then currentCohort=>currentPatch%tallest @@ -957,6 +1009,7 @@ subroutine crown_damage ( currentSite ) enddo !end cohort loop endif !fire? + endif !nocomp_pft_label check currentPatch => currentPatch%younger; @@ -983,6 +1036,8 @@ subroutine cambial_damage_kill ( currentSite ) do while(associated(currentPatch)) + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + if (currentPatch%fire == 1) then currentCohort => currentPatch%tallest; do while(associated(currentCohort)) @@ -1007,6 +1062,7 @@ subroutine cambial_damage_kill ( currentSite ) enddo !end cohort loop endif !fire? + endif !nocomp_pft_label check currentPatch=>currentPatch%younger; @@ -1033,6 +1089,8 @@ subroutine post_fire_mortality ( currentSite ) do while(associated(currentPatch)) + if(currentPatch%nocomp_pft_label .ne. nocomp_bareground)then + if (currentPatch%fire == 1) then currentCohort => currentPatch%tallest do while(associated(currentCohort)) @@ -1052,6 +1110,7 @@ subroutine post_fire_mortality ( currentSite ) enddo !end cohort loop endif !fire? + endif !nocomp_pft_label check currentPatch => currentPatch%younger diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 404e08b2ba..57f64c08cb 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -168,7 +168,7 @@ subroutine init_site_vars( site_in, bc_in, bc_out ) allocate(site_in%dz_soil(site_in%nlevsoil)) allocate(site_in%z_soil(site_in%nlevsoil)) - if (hlm_use_nocomp .eq. itrue) then + if (hlm_use_nocomp .eq. itrue .and. hlm_use_fixed_biogeog .eq. itrue) then allocate(site_in%area_pft(0:numpft)) else ! SP and nocomp require a bare-ground patch. allocate(site_in%area_pft(1:numpft)) @@ -384,6 +384,7 @@ subroutine set_site_properties( nsites, sites,bc_in ) sites(s)%acc_NI = acc_NI sites(s)%NF = 0.0_r8 sites(s)%NF_successful = 0.0_r8 + sites(s)%area_pft(:) = 0.0_r8 do ft = 1,numpft sites(s)%rec_l2fr(ft,:) = prt_params%allom_l2fr(ft) @@ -399,7 +400,6 @@ subroutine set_site_properties( nsites, sites,bc_in ) ! where pft_areafrac is the area of land in each HLM PFT and (from surface dataset) ! hlm_pft_map is the area of that land in each FATES PFT (from param file) - sites(s)%area_pft(1:numpft) = 0._r8 do hlm_pft = 1,size( EDPftvarcon_inst%hlm_pft_map,2) do fates_pft = 1,numpft ! loop round all fates pfts for all hlm pfts sites(s)%area_pft(fates_pft) = sites(s)%area_pft(fates_pft) + & @@ -453,8 +453,6 @@ subroutine set_site_properties( nsites, sites,bc_in ) if(sumarea.lt.area)then !make some bare ground sites(s)%area_pft(0) = area - sumarea - else - sites(s)%area_pft(0) = 0.0_r8 end if end if !sp mode end if !fixed biogeog diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 025969b07a..a3bf63c419 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -208,7 +208,15 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out) if (hlm_use_ed_st3.eq.ifalse.and.hlm_use_sp.eq.ifalse) then ! Bypass if ST3 - call fire_model(currentSite, bc_in) + + ! Check that the site doesn't consist solely of a single bareground patch. + ! If so, skip the fire model. Since the bareground patch should be the + ! oldest patch per set_patchno, we check that the youngest patch isn't zero. + ! If there are multiple patches on the site, the bareground patch is avoided + ! at the level of the fire_model subroutines. + if (currentSite%youngest_patch%patchno .ne. 0) then + call fire_model(currentSite, bc_in) + end if ! Calculate disturbance and mortality based on previous timestep vegetation. ! disturbance_rates calls logging mortality and other mortalities, Yi Xu diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 4f198d6708..6c27c2aa72 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -440,7 +440,13 @@ module EDTypesMod class(rmean_type), pointer :: tveg_lpa ! Running mean of vegetation temperature at the ! leaf photosynthesis acclimation timescale [K] - integer :: nocomp_pft_label ! where nocomp is active, use this label for patch ID. + integer :: nocomp_pft_label ! Where nocomp is active, use this label for patch ID. + ! Each patch ID corresponds to a pft number since each + ! patch has only one pft. Bareground patches are given + ! a zero integer as a label. + ! If nocomp is not active this is set to unset. + ! This is set in create_patch as an argument + ! to that procedure. ! LEAF ORGANIZATION diff --git a/main/FatesConstantsMod.F90 b/main/FatesConstantsMod.F90 index ee3bd6cfb3..66a9c56d8d 100644 --- a/main/FatesConstantsMod.F90 +++ b/main/FatesConstantsMod.F90 @@ -35,6 +35,8 @@ module FatesConstantsMod integer, parameter, public :: primaryforest = 1 integer, parameter, public :: secondaryforest = 2 + ! Bareground label for no competition mode + integer, parameter, public :: nocomp_bareground = 0 ! Flags specifying how phosphorous uptake and turnover interacts ! with the host model. diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index db90a49650..6c12a78a06 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -52,6 +52,7 @@ module FatesHistoryInterfaceMod use FatesInterfaceTypesMod , only : hlm_model_day use FatesInterfaceTypesMod , only : nlevcoage use FatesInterfaceTypesMod , only : hlm_use_nocomp + use FatesInterfaceTypesMod , only : hlm_use_fixed_biogeog use FatesAllometryMod , only : CrownDepth use FatesAllometryMod , only : bstore_allom use FatesAllometryMod , only : set_root_fraction @@ -4273,10 +4274,9 @@ subroutine update_history_hifrq(this,nc,nsites,sites,bc_in,dt_tstep) canopy_area_by_age(1:nlevage) = 0._r8 ! Calculate the site-level total vegetated area (i.e. non-bareground) - if (hlm_use_nocomp .eq. itrue) then + site_area_veg = area + if (hlm_use_nocomp .eq. itrue .and. hlm_use_fixed_biogeog .eq. itrue) then site_area_veg = area - sites(s)%area_pft(0) - else - site_area_veg = area end if cpatch => sites(s)%oldest_patch