Skip to content

Commit

Permalink
Reverted the pre-mature removal of udata%cohort_index and cohort%coho…
Browse files Browse the repository at this point in the history
…rt_index. This

variable will be evaluated in a seperate issue.
  • Loading branch information
rgknox committed May 18, 2016
1 parent 8b660d4 commit 0949034
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module EDCohortDynamicsMod
use EDEcophysContype , only : EDecophyscon
use EDGrowthFunctionsMod , only : c_area, tree_lai
use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type
use EDTypesMod , only : fusetol, nclmax, udata
use EDtypesMod , only : ncwd, numcohortsperpatch
use EDTypesMod , only : fusetol, nclmax
use EDtypesMod , only : ncwd, numcohortsperpatch, udata
use EDtypesMod , only : sclass_ed,nlevsclass_ed,AREA
use EDtypesMod , only : min_npm2, min_nppatch, min_n_safemath
!
Expand Down Expand Up @@ -68,15 +68,16 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, &
!----------------------------------------------------------------------

allocate(new_cohort)

udata%cohort_number = udata%cohort_number + 1 !give each cohort a unique number for checking cohort fusing routine.

call nan_cohort(new_cohort) ! Make everything in the cohort not-a-number
call zero_cohort(new_cohort) ! Zero things that need to be zeroed.

!**********************/
! Define cohort state variable
!**********************/

! new_cohort%indexnumber = udata%cohort_number
new_cohort%indexnumber = udata%cohort_number
new_cohort%siteptr => patchptr%siteptr
new_cohort%patchptr => patchptr
new_cohort%pft = pft
Expand Down Expand Up @@ -641,7 +642,6 @@ subroutine fuse_cohorts(patchptr)

! Don't fuse a cohort with itself!
if (.not.associated(currentCohort,nextc) ) then
! if (currentCohort%indexnumber /= nextc%indexnumber) then

if (currentCohort%pft == nextc%pft) then

Expand Down Expand Up @@ -986,8 +986,8 @@ subroutine copy_cohort( currentCohort,copyc )
o => currentCohort
n => copyc

! udata%cohort_number = udata%cohort_number + 1
!n%indexnumber = udata%cohort_number
udata%cohort_number = udata%cohort_number + 1
n%indexnumber = udata%cohort_number

! VEGETATION STRUCTURE
n%pft = o%pft
Expand Down
2 changes: 1 addition & 1 deletion main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ subroutine ed_init_sites( bounds, ed_allsites_inst )
! INITIALISE THE SITE STRUCTURES
!
! Makes unique cohort identifiers. Needs zeroing at beginning of run.
! udata%cohort_number = 0
udata%cohort_number = 0

do g = bounds%begg,bounds%endg
! zero the site
Expand Down
1 change: 1 addition & 0 deletions main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ module EDTypesMod
!************************************

type userdata
integer :: cohort_number ! Counts up the number of cohorts which have been made.
integer :: n_sub ! num of substeps in year
real(r8) :: deltat ! fraction of year used for each timestep (1/N_SUB)
integer :: time_period ! Within year timestep (1:N_SUB) day of year
Expand Down
2 changes: 1 addition & 1 deletion main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module FatesInterfaceMod
! ------------------------------------------------------------------------------------

use EDtypesMod , only : ed_patch_type, ed_site_type, numpft_ed
use EDtypesMod , only : map_clmpatch_to_edpatch, userdata
use EDtypesMod , only : map_clmpatch_to_edpatch
use EDSurfaceRadiationMod , only : ED_SunShadeFracs
use EDInitMod , only : ed_init_sites
use EDMainMod , only : ed_update_site
Expand Down

0 comments on commit 0949034

Please sign in to comment.