[OpenMadrigal-users] strangeness in getFyear
Bill Rideout
brideout at haystack.mit.edu
Wed Dec 23 09:19:48 EST 2009
Nick,
You are correct. I've patched our Madrigal server here at Millstone
Hill, but the bug will still appear at the other Madrigal sites until
the next release. Thanks for pointing out the problem, and tracing it
all the way into the C code!
Bill Rideout
On Dec 11, 2009, at 12:30 AM, Nick Matteo wrote:
> 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
> _______________________________________________
> OpenMadrigal-users mailing list
> OpenMadrigal-users at openmadrigal.org
> http://www.openmadrigal.org/mailman/listinfo/openmadrigal-users
>
> !DSPAM:4b321fd032161687619800!
>
More information about the OpenMadrigal-users
mailing list