The break condition uses the wrong flux level for the OLR. I also suggest that we just use an OLR check and get rid of the temperature check, as we only care about OLR convergence. So, this could be changed to:
if abs(atm.LW_flux_up[0]-PrevOLR) < 50. and i > 5 :
print("break")
break # break here
We could also make the OLR convergence criterion depend on the magnitude of the flux expected, for example:
if abs(atm.LW_flux_up[0]-PrevOLR) < 0.1*(5.67e-8*atm.ts**4)**0.5. and i > 5 :
print("break")
break # break here
(here the extra **0.5 is to represent the fact that the upper atmosphere temperature typically does not scale linearly with surface temperature in this case). But, we could experiment with this.
https://github.com/OxfordPlanetaryClimate/couple-interior-atmosphere/blob/9dc781fe2f4e8cfdd46d737247c49673e603dbd9/SocRadConv.py#L129
The break condition uses the wrong flux level for the OLR. I also suggest that we just use an OLR check and get rid of the temperature check, as we only care about OLR convergence. So, this could be changed to:
We could also make the OLR convergence criterion depend on the magnitude of the flux expected, for example:
(here the extra **0.5 is to represent the fact that the upper atmosphere temperature typically does not scale linearly with surface temperature in this case). But, we could experiment with this.