atmtools / konrad

Implementation of a radiative-convective equilibrium model.
MIT License
19 stars 18 forks source link

Make rce write to ouput file at 1st time step #144

Closed moritz-g closed 3 years ago

moritz-g commented 3 years ago

It is problematic that the first time RCE.run() writes to the outputfile is after self.writeevery days and not in the beginning. I had some runs where the surface temperature strongly changed within the first day(s), which distorts the Gregoryplot, because in the netcdf file surface['temperature'][0] is not the surface temperature at the beginning of the simulation, but when the first value is written. The same is true for fluxes and can lead to an incorrect estimate for the effective forcing and total temperature change in scenarios with fast changes in the very beginning. The climate sensitivity parameter should be unaffected, because it only depends on the slope. Writing out in the 1st time step solves this problem.

I can provide graphs for illustrating this if needed. So far it didn't make a big difference for CO2 forcing, but for aerosol forcing.

lkluft commented 3 years ago

Hi Moritz, thanks for your PR! I very much support your changes but would like to stress that this will only store the state after the first iteration. While this is far better than the current approach, t=0 would still not be the exact initial condition. This is because some variables are only available after the first iteration (e.g. the radiative fluxes, or the convective top). Technically, this could be solved but would require some additional work and I don't know if this is necessary.

moritz-g commented 3 years ago

Thanks for that comment!

That's right. From looking at the data I think it's not necessary to write the very initial state, since the first iteration really makes almost no difference, while the first 100 or so iterations do.

lkluft commented 3 years ago

You're welcome! I agree and will merge your PR. Thanks for your contribution! :)