-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug in modaradiation in case of warm start #40
Comments
I would argue that the best solution is both easier and has more impact at the same time: in the read- and writerestartfiles (at least) tnext should be included as well. |
I'd like it if all scheduled processes are handled in the same way. For example cross section netCDF writing has a similar scheduling mechanism, and works across restarts.
I also found such a line for radiation. Jan wrote in a mail "The |
Unfortunately, putting Adding |
I see, you're right. At the end of On the other hand, I start agreeing with Huug's point about |
Indeed, I think it would be worthwile to make an inventory of all subroutines where this time-dependence is of importance. I could imagine it's mainly important for the prognostic subroutines (so that the simulations are bitwise continuous); for the diagnostic subroutines it might be less important, although differences there could make it harder to compare results between numerical experiments. |
I agree. One more point for the radiation, from Stephan: currently a warm start must call the radiation routine on the first step. I think this is because the tendencies from radiation must be calculated there, because they are not stored in the save file (radiation tendencies seem to be stored only when MCICA is on). As long as this is the case, warm starts are not guaranteed to be bit-wise exact anyway. So for 4.2 we fix restarts with radiation and ensure radiation is called on the first step. We live with the fact that restarts aren't bitwise exact always. For 4.3 we re-think the time scheduling and save files? |
I think it would be worthwhile to make an inventory of the routines that are 'losing' data in a restart and/or are handled in such a way that a restart could yield results that are not (bit-wise) identical. |
Indeed
The only question remains how to keep the variable names consistent when adding more modules. So far I am considering option:
|
I'm working on a fix for the radiation & restart bug. Currently, I'm in favour of saving tnext for radiation and thlprad, the temperature tendency from radiation, in the init files. It seems runs with radiation are not going to be bitwise identical if restarted vs run at once anyway: both rrtmg and radfull use the current pressure profile at initialization, |
Radiation would not be performed after restarts at all, because tnext was initialized before the start time of the simulation (btime) was set. Now, tnext for radiation is set to btime at the end of modstartup, so that a radiation call is made at the very start of the simulation. For now I decided against trying to save the output from the radiation routine in the init files - because of interaction with surface and chemistry schemes, not just the temperature tendency but also other radiation quantities need to be saved. With radiation, restarts are still not bitwise exact. The initialization of the radiation schemes, at least RRTMG and radfull, use the current pressure profile, which is temperature dependent. This causes small differences when the radiation scheme is re-initialized at a warm start. If bitwise exact restarts are important, it may be enough to save the initial pressure profiles.
Proposed fix in commit 66d81a3, in the to4.3_Fredrik branch. Radiation would not be performed after restarts at all, because tnext was initialized before the start time of the simulation (btime) was set. Now, tnext for radiation is set to btime at the end of modstartup, so that a radiation call is made at the very start of the For now I decided against trying to save the output from the radiation routine in the init files - because of interaction with surface and chemistry schemes, not just the temperature tendency but also other radiation quantities need to be saved. With radiation, restarts are still not bitwise exact. The initialization of the radiation schemes, at least RRTMG and radfull, use the current pressure profile, which is temperature dependent. This causes small differences when the radiation scheme is re-initialized at a warm start. If bitwise exact restarts are important, it may be enough to save the initial pressure profiles. |
The fix above was applied in branch to4.3.
Leaving issue open since radfull restart is not bitwise exact yet. |
It has turned out that the bug is in the subroutine radiation in modradiation, line 204:
In the case of the warm start, the initial (modraddata) "tnext" is set lower than post-restart "timee". Therefore, (modraddata) "tnext" is never updated and radiation schemes are never computed. This leaves the model run only with 0 radiative tendency of large-scale radiate tendency.
The proposed quick fix is:
This will both:
a) set the tnext back on track in case of warm start in a consistent way
b) prevent running the radiation calculations btime/itimerad times
The other option is adding btime from modglobal to used variables, and adding lines:
The text was updated successfully, but these errors were encountered: