climlab
climlab copied to clipboard
Hard-coded length of solar year
There are several places in the codebase where the length of the solar year is hard-coded to the value given by
climlab.utils.constants.days_per_year
This creates challenges particularly for modeling planetary atmospheres.
Related to #120, it would be good to have the option to modify this.
I hacked up some fixes that seem to work (not currently in a PR):
- provide an optional
days_per_year
argument to theclimlab.solar.insolation.daily_insolation()
function (and pass this in the internal call toclimlab.solar.insolation.solar_longitude()
, which already accepts this argument - Add a
.days_per_year
attribute to theTimeDependentProcess
class (which defaults to the standard Earth value) - Use this value in the
timestep.setter
method - Modify the
DailyInsolation
class to use the storeddays_per_year
value
Maybe it would be best to continue to pursue a general solution to #120, which I started to hack up in #123
#188 added the days_per_year
argument to climlab.solar.insolation.daily_insolation()
and the new climlab.solar.insolation.instant_insolation()
That takes care of the insolation code, but not the stuff related to TimeDependentProcess
and time-stepping.
Leaving this issue open to track a more complete solution.