Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2 from ekluzek/fates_s1.3.0_a1.0.0_nag
Browse files Browse the repository at this point in the history
Shorten lines so can compile with nag compiler on hobart
  • Loading branch information
ekluzek authored Oct 18, 2017
2 parents 8ae8159 + f605484 commit 4dd7d23
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
27 changes: 18 additions & 9 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -853,18 +853,27 @@ subroutine fuse_cohorts(patchptr, bc_in)
currentCohort%fmort = (currentCohort%n*currentCohort%fmort + nextc%n*nextc%fmort)/newn

! npp diagnostics
currentCohort%npp_leaf = (currentCohort%n*currentCohort%npp_leaf + nextc%n*nextc%npp_leaf)/newn
currentCohort%npp_froot = (currentCohort%n*currentCohort%npp_froot + nextc%n*nextc%npp_froot)/newn
currentCohort%npp_bsw = (currentCohort%n*currentCohort%npp_bsw + nextc%n*nextc%npp_bsw)/newn
currentCohort%npp_bdead = (currentCohort%n*currentCohort%npp_bdead + nextc%n*nextc%npp_bdead)/newn
currentCohort%npp_bseed = (currentCohort%n*currentCohort%npp_bseed + nextc%n*nextc%npp_bseed)/newn
currentCohort%npp_store = (currentCohort%n*currentCohort%npp_store + nextc%n*nextc%npp_store)/newn
currentCohort%npp_leaf = (currentCohort%n*currentCohort%npp_leaf + nextc%n*nextc%npp_leaf) &
/newn
currentCohort%npp_froot = (currentCohort%n*currentCohort%npp_froot + nextc%n*nextc%npp_froot) &
/newn
currentCohort%npp_bsw = (currentCohort%n*currentCohort%npp_bsw + nextc%n*nextc%npp_bsw) &
/newn
currentCohort%npp_bdead = (currentCohort%n*currentCohort%npp_bdead + nextc%n*nextc%npp_bdead) &
/newn
currentCohort%npp_bseed = (currentCohort%n*currentCohort%npp_bseed + nextc%n*nextc%npp_bseed) &
/newn
currentCohort%npp_store = (currentCohort%n*currentCohort%npp_store + nextc%n*nextc%npp_store) &
/newn

! biomass and dbh tendencies
currentCohort%ddbhdt = (currentCohort%n*currentCohort%ddbhdt + nextc%n*nextc%ddbhdt)/newn
currentCohort%dbalivedt = (currentCohort%n*currentCohort%dbalivedt + nextc%n*nextc%dbalivedt)/newn
currentCohort%dbdeaddt = (currentCohort%n*currentCohort%dbdeaddt + nextc%n*nextc%dbdeaddt)/newn
currentCohort%dbstoredt = (currentCohort%n*currentCohort%dbstoredt + nextc%n*nextc%dbstoredt)/newn
currentCohort%dbalivedt = (currentCohort%n*currentCohort%dbalivedt + nextc%n*nextc%dbalivedt) &
/newn
currentCohort%dbdeaddt = (currentCohort%n*currentCohort%dbdeaddt + nextc%n*nextc%dbdeaddt) &
/newn
currentCohort%dbstoredt = (currentCohort%n*currentCohort%dbstoredt + nextc%n*nextc%dbstoredt) &
/newn

do i=1, nlevleaf
if (currentCohort%year_net_uptake(i) == 999._r8 .or. nextc%year_net_uptake(i) == 999._r8) then
Expand Down
6 changes: 4 additions & 2 deletions biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,10 @@ subroutine average_patch_properties( currentPatch, newPatch, patch_site_areadis
! some of their area has been carved out for this new patches which is receiving donations.
! Lets maintain conservation on that pre-existing mass flux in these newly disturbed patches

newPatch%root_litter_out(p) = newPatch%root_litter_out(p) + currentPatch%root_litter_out(p) * patch_site_areadis/newPatch%area
newPatch%leaf_litter_out(p) = newPatch%leaf_litter_out(p) + currentPatch%leaf_litter_out(p) * patch_site_areadis/newPatch%area
newPatch%root_litter_out(p) = newPatch%root_litter_out(p) + currentPatch%root_litter_out(p) * &
patch_site_areadis/newPatch%area
newPatch%leaf_litter_out(p) = newPatch%leaf_litter_out(p) + currentPatch%leaf_litter_out(p) * &
patch_site_areadis/newPatch%area

enddo

Expand Down
3 changes: 2 additions & 1 deletion fire/SFMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ subroutine rate_of_spread ( currentSite )

if (DEBUG) then
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - c ',c
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - currentPatch%effect_wspeed ',currentPatch%effect_wspeed
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - currentPatch%effect_wspeed ', &
currentPatch%effect_wspeed
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - b ',b
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - beta_ratio ',beta_ratio
if ( hlm_masterproc == itrue .and.DEBUG) write(fates_log(),*) 'SF - e ',e
Expand Down
4 changes: 2 additions & 2 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2964,8 +2964,8 @@ subroutine define_history_vars(this, initialize_variables)
upfreq=1, ivar=ivar, initialize=initialize_variables, index = ih_nplant_understory_si_scag )

call this%set_history_var(vname='DDBH_CANOPY_SCAG',units = 'cm/yr/ha', &
long='growth rate of canopy plantsnumber of plants per hectare in canopy in each size x age class', use_default='inactive', &
avgflag='A', vtype=site_scag_r8, hlms='CLM:ALM', flushval=0.0_r8, &
long='growth rate of canopy plantsnumber of plants per hectare in canopy in each size x age class', &
use_default='inactive', avgflag='A', vtype=site_scag_r8, hlms='CLM:ALM', flushval=0.0_r8, &
upfreq=1, ivar=ivar, initialize=initialize_variables, index = ih_ddbh_canopy_si_scag )

call this%set_history_var(vname='DDBH_UNDERSTORY_SCAG',units = 'cm/yr/ha', &
Expand Down

0 comments on commit 4dd7d23

Please sign in to comment.