Skip to content

Commit

Permalink
DaysPastPlanting() now uses # days in LAST year, not THIS year.
Browse files Browse the repository at this point in the history
* Resolves failures in test_CNPhenology_gregorian.
* Contributes to ESCOMP#1595: Bugs in crop phenology when running with a Gregorian calendar (ESCOMP#1595).
  • Loading branch information
samsrabin committed Apr 4, 2024
1 parent b4b836a commit 05ee37c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/biogeochem/CNPhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2726,6 +2726,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
Expand All @@ -2742,7 +2743,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
Expand Down

0 comments on commit 05ee37c

Please sign in to comment.