You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VIC-Routing fails to work when end date is in the month of February of a leap year. It is due to the wrong calculation of number of days for which a user wants to run routing using start and end date. This is the below mentioned lines of the routing fortran code:
c calculate number of days & months in simulation
M=START_MO
Y=START_YEAR
NMONTHS =0
NDAY=0DO J=START_MO,12*(STOP_YEAR-START_YEAR)+STOP_MO
IF(M.EQ.2) THEN
LP=isaleap(Y)
ELSE
LP=0ENDIF
NDAY = NDAY+DAYS_IN_MONTH(M)+LP
NMONTHS = NMONTHS +1
MO(NMONTHS) = M
YR(NMONTHS) = Y
M = M +1IF (M .GT.12) THEN
M =1
Y = Y +1ENDIFEND DOIF(NDAY.GT.DAYS) THENPRINT*, 'IN ROUT.F RESET DAYS TO ', NDAY
STOPENDIF
NDAY = NDAY-(START_DAY-1)-(DAYS_IN_MONTH(STOP_MO)-STOP_DAY)
PRINT*,'NDAY = ',NDAY, ' NMONTHS = ',NMONTHS
You can see that DAYS_IN_MONTH(STOP_MO) in second last line of the above snippet should be 29 for leap year of February but it is a constant 28 in the code.
The text was updated successfully, but these errors were encountered:
VIC-Routing fails to work when end date is in the month of February of a leap year. It is due to the wrong calculation of number of days for which a user wants to run routing using start and end date. This is the below mentioned lines of the routing fortran code:
You can see that
DAYS_IN_MONTH(STOP_MO)
in second last line of the above snippet should be 29 for leap year of February but it is a constant 28 in the code.The text was updated successfully, but these errors were encountered: