secondsInYear = ndaysnoleap * secondsperday
& secondsInYear = ndaysleap * secondsperday
daytime = FLOAT(secondsperday*(irec-1)) + modelstart
nsecs = nsecs + secondsperday
ndays = interval(1)+nsecs/secondsperday
nsecs = mod(nsecs,secondsperday)
& (mod(currentdate(1),100)-1)*secondsperday +
& secondsperday/2)
& (mod(prevdate(1),100)-1)*secondsperday +
laststep = int((secondsperday - startsecs)/mdstep)
fullsteps = int((secondsperday - startsecs)/mdstep)
frac1 = (secondsperday - startsecs) - fullsteps*mdstep
fullsteps = int(secondsperday/modelstep)
frac2 = secondsperday - fullsteps*mdstep
firststep = laststep - secondsperday/mdstep + 1
modelstepsperday = secondsperday/nint(modelstep)
date(1) = int(timeint/float(secondsperday))
tmp2 = secondsperday
date(1) = int(timeint*modelstep/float(secondsperday))
& float(date(1)) * float(secondsperday))
ndays = ndays + nsecs/secondsperday
si = si + (di-1)*secondsperday
sf = sf + (df-1)*secondsperday
ndays = (cdf + csf/secondsperday) -
& (cdi + csi/secondsperday)
nsecs = (csf - (csf/secondsperday)*secondsperday) -
& (csi - (csi/secondsperday)*secondsperday)
csi = ndaymonth(mi,li)*secondsperday - csi
numdays(1) = ndays + nsecs/secondsperday
nsecs = ndays*secondsperday +
daytime = FLOAT(secondsperday*(krec-1)) + modelstart