# Astronomical forcing term from 
# de Saedeleer, B., Crucifix, M., & Wieczorek, S. (2013).
# Is the astronomical forcing a reliable and unique pacemaker for climate?
# A conceptual model study. Climate Dynamics, 40(1–2), 273–294. 
# https://doi.org/10.1007/s00382-012-1316-1

function astronomical_forcing(A, t)
    # notice that mean value (494.2447 W/m²) of forcing has been removed
    F = 0.0
    @inbounds for i in 1:size(A,1)
        ωt = A[i, 1]*t
        F += A[i, 2]*sin(ωt) + A[i, 3]*cos(ωt)
    end
    return F/11.77 # value of α_ε_1 in W/m^2
end

A = [ # Notice: all these harmonics can be reduced massively to just 6 (See Fig 2)
      # so if the code becomes too slow, I can do this.
    # Obliquity terms
    0.153249478547167 -11.2287376815124 3.51682075211241
    0.158148666238883 -3.82499371467540 -0.761851750263805
    0.117190147169570 2.28814805956066 1.80233702684623
    0.155061775112933 -1.29770081956440 -0.635152963728496
    0.217333905941751 0.380973541305497 -1.46301711999210
    0.150162587421217 1.54904176353302 -0.0883941912769817
    0.211709630908568 -0.810768209286259 -0.577980646565494
    0.156336369673117 -0.918358442095885 0.196083726889428
    0.148350290855451 0.256895610735773 -0.524697312305024
    0.206924898030688 -0.335783913402678 -0.0194792150128644
    0.212525165090383 0.267659228540196 0.128915417116900
    0.229992875969202 0.0696189733188958 0.0746231714061285
    0.306498957094334 0.0247349748169616 0.0140464395340974
    0.311398144786051 0.0138353727621181 0.0304736668840422
    0.004899187691716 -0.160479848721994 0.0594077968934257
    # Precession terms
    0.264933601588513 -15.5490493322904 -9.70406287110532
    0.280151350350945 15.4319556361701 4.75247271131525
    0.331110950251899 9.0992249352734 -10.6115244887390
    0.328024059125949 -7.87065384013669 6.61544246063503
    0.326211762560183 0.813786144754451 -4.52641408099246
    0.269742342439881 0.0690448504314857 -3.31639260969558
    0.332923246817665 1.44050770785967 1.06339286050120
    0.371638925683567 0.925324276580528 -1.02066758672154
    0.275366617473065 0.997628846513796 -0.362906496840039
    0.323124871434233 -0.378637986107629 0.527217891742183
    0.259396912994958 0.339477750517033 -0.560509461538342
    0.324937167999999 -0.576082669762308 1.18669572739338
    0.334197841377850 0.346906064369828 -0.648189701487285
    0.274551083291250 -0.441772417569753 0.289576210423804
    0.418183080135680 -0.0184884064645011 0.109632390175297
    0.111684123041346 -0.428006728186239 0.357006342316690
    0.433400828898112 -0.0049199219454561 -0.106148873639336
    0.126901871803777 0.257509918217341 -0.377639794223366
    0.336010137943616 -0.421809264016129 0.324327509437558
    0.177861471704732 -0.161827722328271 -0.362683869407858
]