From 7d5b83ff35bf7cff9d79c0e17f47081badf3ab92 Mon Sep 17 00:00:00 2001 From: Charlie Koven Date: Tue, 26 Mar 2019 14:26:23 -0700 Subject: [PATCH] bugfix and line lengths --- biogeochem/EDLoggingMortalityMod.F90 | 5 ++++- biogeochem/EDPatchDynamicsMod.F90 | 5 ----- main/EDMainMod.F90 | 9 ++++++--- main/EDTypesMod.F90 | 3 ++- main/FatesHistoryInterfaceMod.F90 | 9 ++++++--- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/biogeochem/EDLoggingMortalityMod.F90 b/biogeochem/EDLoggingMortalityMod.F90 index 367f3e868d..03b2ac4cda 100644 --- a/biogeochem/EDLoggingMortalityMod.F90 +++ b/biogeochem/EDLoggingMortalityMod.F90 @@ -161,7 +161,10 @@ subroutine LoggingMortality_frac( pft_i, dbh, canopy_layer, lmort_direct, & real(r8), intent(out) :: lmort_direct ! direct (harvestable) mortality fraction real(r8), intent(out) :: lmort_collateral ! collateral damage mortality fraction real(r8), intent(out) :: lmort_infra ! infrastructure mortality fraction - real(r8), intent(out) :: l_degrad ! fraction of trees that are not killed but suffer from forest degradation (i.e. they are moved to newly-anthro-disturbed secondary forest patch) + real(r8), intent(out) :: l_degrad ! fraction of trees that are not killed + ! but suffer from forest degradation (i.e. they + ! are moved to newly-anthro-disturbed secondary + ! forest patch) ! Parameters real(r8), parameter :: adjustment = 1.0 ! adjustment for mortality rates diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index e74e578592..56a28e85c2 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -435,11 +435,6 @@ subroutine spawn_patches( currentSite, bc_in) if (patch_site_areadis > nearzero ) then - allocate(nc) - if(hlm_use_planthydro.eq.itrue) call InitHydrCohort(CurrentSite,nc) - call InitPRTCohort(nc) - call zero_cohort(nc) - ! figure out whether the receiver patch for disturbance from this patch will be primary or secondary land ! receiver patch is primary forest only if both the donor patch is primary forest and the dominant disturbance type is not logging if (currentPatch%anthro_disturbance_label .eq. primaryforest .and. & diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 0bdcbf0434..bbb0c54dbd 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -289,7 +289,8 @@ subroutine ed_integrate_state_variables(currentSite, bc_in ) ! add age increment to secondary forest patches as well if (currentPatch%anthro_disturbance_label .eq. secondaryforest) then - currentPatch%age_since_anthro_disturbance = currentPatch%age_since_anthro_disturbance + hlm_freq_day + currentPatch%age_since_anthro_disturbance = & + currentPatch%age_since_anthro_disturbance + hlm_freq_day endif ! check to see if the patch has moved to the next age class @@ -404,8 +405,10 @@ subroutine ed_integrate_state_variables(currentSite, bc_in ) enddo do ft = 1,numpft - currentPatch%leaf_litter(ft) = currentPatch%leaf_litter(ft) + currentPatch%dleaf_litter_dt(ft)* hlm_freq_day - currentPatch%root_litter(ft) = currentPatch%root_litter(ft) + currentPatch%droot_litter_dt(ft)* hlm_freq_day + currentPatch%leaf_litter(ft) = currentPatch%leaf_litter(ft) + & + currentPatch%dleaf_litter_dt(ft)* hlm_freq_day + currentPatch%root_litter(ft) = currentPatch%root_litter(ft) + & + currentPatch%droot_litter_dt(ft)* hlm_freq_day enddo do c = 1,ncwd diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 162f8c9f44..418a8f27de 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -17,7 +17,8 @@ module EDTypesMod save integer, parameter :: maxPatchesPerSite = 14 ! maximum number of patches to live on a site - integer, parameter :: maxPatchesPerSite_by_disttype(n_anthro_disturbance_categories) = (/ 10, 4 /) !!! MUST SUM TO maxPatchesPerSite !!! + integer, parameter :: maxPatchesPerSite_by_disttype(n_anthro_disturbance_categories) = & + (/ 10, 4 /) !!! MUST SUM TO maxPatchesPerSite !!! integer, parameter :: maxCohortsPerPatch = 100 ! maximum number of cohorts per patch integer, parameter :: nclmax = 3 ! Maximum number of canopy layers diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 5537053bdd..2789233c33 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -1382,7 +1382,8 @@ subroutine update_history_dyn(this,nc,nsites,sites) integer :: ican, ileaf, cnlf_indx ! iterators for leaf and canopy level integer :: height_bin_max, height_bin_min ! which height bin a given cohort's canopy is in integer :: i_heightbin ! iterator for height bins - integer :: ageclass_since_anthrodist ! what is the equivalent age class for time-since-anthropogenic-disturbance of secondary forest + integer :: ageclass_since_anthrodist ! what is the equivalent age class for + ! time-since-anthropogenic-disturbance of secondary forest real(r8) :: n_density ! individual of cohort per m2. real(r8) :: n_perm2 ! individuals per m2 for the whole column @@ -3440,12 +3441,14 @@ subroutine define_history_vars(this, initialize_variables) ivar=ivar, initialize=initialize_variables, index = ih_biomass_secondary_forest_si ) call this%set_history_var(vname='SECONDARY_AREA_AGE_ANTHRO_DIST', units='m2/m2', & - long='Secondary forest patch area age distribution since anthropgenic disturbance', use_default='inactive', & + long='Secondary forest patch area age distribution since anthropgenic disturbance', & + use_default='inactive', & avgflag='A', vtype=site_age_r8, hlms='CLM:ALM', flushval=0.0_r8, upfreq=1, & ivar=ivar, initialize=initialize_variables, index = ih_agesince_anthrodist_si_age ) call this%set_history_var(vname='SECONDARY_AREA_PATCH_AGE_DIST', units='m2/m2', & - long='Secondary forest patch area age distribution since any kind of disturbance', use_default='inactive', & + long='Secondary forest patch area age distribution since any kind of disturbance', & + use_default='inactive', & avgflag='A', vtype=site_age_r8, hlms='CLM:ALM', flushval=0.0_r8, upfreq=1, & ivar=ivar, initialize=initialize_variables, index = ih_secondaryforest_area_si_age )