Atmosphere_Energy(t) = Atmosphere_Energy(t - dt) + (Infrared_to_Atm - Atm_to_Space - Atm_to_Surface) * dt
INIT Atmosphere_Energy = 1.25E+24 {This is the result from Part 2.}

Infrared_to_Atm = Atm_Ab_Coef * Surface_Radiation {J/yr}
Atm_to_Space = Atm_IR_Radiation {J/yr}
Atm_to_Surface = Atm_IR_Radiation {J/yr}

Earth_Energy(t) = Earth_Energy(t - dt) + (Solar_to_Earth + Atm_to_Surface - Infrared_to_Atm - Surface_to_Space) * dt
INIT Earth_Energy = 6.20E+25 {This is the result from Part 2.}

Solar_to_Earth = Solar_Constant {J/m2 yr} * (1-Earth_Albedo) * Earth_Crossection {m2}
Atm_to_Surface = Atm_IR_Radiation {J/yr}
Infrared_to_Atm = Atm_Ab_Coef * Surface_Radiation {J/yr}
Surface_to_Space = (1 - Atm_Ab_Coef) * Surface_Radiation {J/yr}

Atm_Ab_Coef = Atm_Ab_Coef_Now + (H2O_factor * CO2_Abs_Calibration *
(CO2_Increase_Factor - 1))
Atm_Ab_Coef_Now = 0.766 {This is the value found in Part 2.}
Atm_Heat_Capacity = Atm_Mass {kg} * Sp_Heat_Air {J/kg K}
Atm_IR_Radiation = Earth_Surface_Area {m2} * Atm_Ab_Coef *
Stefan_Boltzmann {J/m2 yr K4} * Temp_Atm^4 {K4}
Atm_Mass = 5.14E18 {kg}
CO2_Abs_Calibration = 0.02
Density_Water = 1000. {kg/m3}
Earth_Albedo = 0.30 {30% as a fraction}
Earth_Crossection = PI*Earth_Diameter^2/4 {m2}
Earth_Diameter = 12742e3 {m}
Earth_Surface_Area = PI*Earth_Diameter^2 {m2}
H2O_factor = 2.0 {range is 1.5 to 3.0}
Heat_Capacity = Water_Depth {m} * Earth_Surface_Area {m2} *
Density_Water {kg/m3} * Specific_Heat_Water {J/kg K}
Solar_Constant = 1376 {J/m2 s} * 3.15576E7 {s/yr}
Specific_Heat_Water = 4218. {J/kg K}
Sp_Heat_Air = 1004 {J/kg K}
Stefan_Boltzmann = 5.67E-8 {J/m2 s K4} * 3.15576E7 {s/yr}
Surface_Radiation = Earth_Surface_Area {m2} * Stefan_Boltzmann {J/m2 yr K4} *
Temperature^4 {K4}
Temperature = Earth_Energy {J} / Heat_Capacity {J/K}
DOCUMENT: 1st Law of Thermodynamics

Temp_Atm = Atmosphere_Energy {J} / Atm_Heat_Capacity {J/K}
DOCUMENT: 1st Law of Thermodynamics

Water_Depth = 100.0 {m, mixing layer}
CO2_Increase_Factor = GRAPH(TIME)
(0.00, 1.00), (10.0, 1.00), (20.0, 1.00), (30.0, 1.20), (40.0, 1.40), (50.0, 1.60), (60.0, 1.80), (70.0, 2.00), (80.0, 2.00), (90.0, 2.00), (100, 2.00)