Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crop phenology bugs with Gregorian calendar #2461

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
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))
Copy link
Collaborator Author

@samsrabin samsrabin Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If called on Dec. 31 (NOT at end of day, as is currently tested) of a leap year, will get_curr_days_per_year(offset = -365*int(secspday)) return 365 (correct) or 366 (incorrect)?

end if

end function DaysPastPlanting
Expand Down