Atmosphere_Energy(t) = Atmosphere_Energy(t - dt) + (Infrared_to_Atm - Atm_to_Space - Atm_to_Surface) * dt
INIT Atmosphere_Energy = 0.0 {We do not know what this value should be. Let the model compute it for us.}

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 = 0.0 {We do not know to put here yet. Let the model compute it for us.}

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 = 0.766 {This value is to be determined by trial and error corection}
Atm_Heat_Capacity = Atm_Mass {kg} * Sp_Heat_Air {J/kg K}
DOCUMENT: 1st Law of Thermodynamics

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}
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}
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}