From 08e5a90e715a2134a82be20c79c7c9278a743c15 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 29 Sep 2020 15:16:45 -0600 Subject: [PATCH] Fix issue#1163 --- src/biogeochem/CNPhenologyMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index eba25818c5..28c0ff99ec 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -772,7 +772,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0.0_r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization @@ -797,7 +797,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization @@ -1092,7 +1092,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0._r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization offset_flag(p) = 0._r8 @@ -1113,7 +1113,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization onset_flag(p) = 0._r8 @@ -2282,7 +2282,7 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, & ! The transfer rate is a linearly decreasing function of time, ! going to zero on the last timestep of the onset period - if (onset_counter(p) == dt) then + if (abs(onset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt else t1 = 2.0_r8 / (onset_counter(p)) @@ -2427,7 +2427,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! only calculate fluxes during offset period if (offset_flag(p) == 1._r8) then - if (offset_counter(p) == dt) then + if (abs(offset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p)