From 95e6332d6d065896862a0e7383501629fd79500a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 14 Feb 2024 16:13:37 -0700 Subject: [PATCH] DaysPastPlanting() now uses # days in LAST year, not THIS year. * Resolves failures in test_CNPhenology_gregorian. * Contributes to ESCOMP/CTSM#1595: Bugs in crop phenology when running with a Gregorian calendar (https://github.com/ESCOMP/CTSM/issues/1595). --- src/biogeochem/CNPhenologyMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index d5b8ef5447..5ff7a2a5ac 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2723,6 +2723,7 @@ end subroutine PlantCrop function DaysPastPlanting(idop) ! !USES: use clm_time_manager, only : get_prev_calday, get_curr_days_per_year + use clm_varcon , only : secspday ! ! !ARGUMENTS: integer, intent(in) :: idop ! patch day of planting @@ -2739,7 +2740,7 @@ function DaysPastPlanting(idop) else ! get_curr_days_per_year() or get_prev_days_per_year() would only differ in the last timestep ! of the year, but in that case this line is not reached. - DaysPastPlanting = jday - idop + get_curr_days_per_year() + DaysPastPlanting = jday - idop + get_curr_days_per_year(offset = -365*int(secspday)) end if end function DaysPastPlanting