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 Feb 14, 2024
1 parent 20b3656 commit 95e6332
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 @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 95e6332

Please sign in to comment.