Skip to content

Commit

Permalink
bugfix and line lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoven committed Mar 26, 2019
1 parent 7f064b8 commit 7d5b83f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion biogeochem/EDLoggingMortalityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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. &
Expand Down
9 changes: 6 additions & 3 deletions main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )

Expand Down

0 comments on commit 7d5b83f

Please sign in to comment.