[OpenMadrigal-users] strangeness in getFyear
Nick Matteo
madrigal at kundor.org
Fri Dec 11 00:30:07 EST 2009
Hello,
I was comparing various time parameters available from Madrigal. So I
computed the fractional year from the 'year', 'dayno', 'hour', 'min',
and 'sec' parameters:
fyear = year + (dayno - 1 + (hour + (min + sec/60)/60)/24)/366
(this was for 2008, hence 366.)
I kept seeing a .0015 discrepancy, which is about 13 hours. I thought
I'd check the source to see if fractional year is defined in a
different way.
The relevant computation seems to be in
source/madc/madrec/madDeriveMethods.c, getFyear.
I found these lines:
fyear = (double)iyr;
daysNow = ((double)(dayOfYear - 1));
daysNow += ((double)(24 * hour + min))/(24.0*60.0);
daysNow += ((double)ics)/ (100.0*3600.0*24.0);
fyear += daysNow / ((double)daysInYear);
(24*hour + min)/(24*60), or in other words hour/60 + min/(24*60),
doesn't seem right. Surely it should be hour/24 + min/(24*60)? Or,
equivalently, (hour + min/60)/24?
Thanks,
Nick
More information about the OpenMadrigal-users
mailing list