-
Notifications
You must be signed in to change notification settings - Fork 105
Description
The insert_cohort subroutine flips the order of cohorts (given identical heights), while sort_cohorts preserves order.
Essentially, this means that if we give insert_cohort a list of cohorts 1...100 (all the same exact height), the resulting list will be ordered 100...1.
This is because of this line:
current => pshortest
exitloop = 0
!starting with shortest tree on the grid, find tree just
!taller than tree being considered and return its pointer
if (associated(current)) then
do while (associated(current).and.exitloop == 0)
**if (current%height < tsp) then**
current => current%taller
else
exitloop = 1
endif
enddo
endif
if we switch this to if (current%height <= tsp) then we will preserve order.
I think this is not ideal, and is somewhat confusing. I would like to propose we make this change this so that insert_cohort preserves the order.
I have a branch that updates our insert_cohort and sort_cohort routines. Because of this change, it is not B4B. I also propose adding some checks to make sure we don't have any inadvertently disconnected cohorts.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✔ Done