Bug in the adaptive time step code in WRFV4.0 (and probably earlier versions)

Discussion/questions related to potential bugs found in any of the wrf-supported source code
Post Reply
LouisMarelle
Posts: 3
Joined: Mon Oct 08, 2018 2:17 pm

Bug in the adaptive time step code in WRFV4.0 (and probably earlier versions)

Post by LouisMarelle » Fri Feb 22, 2019 2:48 pm

Hello,

I found a bug related to the adaptive time step in WRFV4.0. I found very high spurious T2 differences (up to several Kelvins) between sensitivity runs using almost similar setups when using the adaptive time step. These differences are not caused by normal differences in internal model variability between the runs. They are instead due to differences in the calculated incident solar radiation between the runs, which is obvious when looking at the very different accumulated total downwelling radiation (i.e. ACSWDNT) at the end of the different runs. This has a large direct influence on the calculated TSK and T2. When running "what if" scenarios these spurious differences between runs can unfortunately erroneously be interpreted as meaningful signal.

I found that this was due to the implicit asumption in the radiation driver that the radiative code is called every radt exactly (the zenith angle is calculated at time+radt/2, time being the time when the radiation code is called). However, when the adaptive time step enabled, the call to the radiation code is not performed exactly every radt, but after a time greater than radt has elapsed since the last radiation call. This is a relatively minor difference but it is apparently enough to cause these high temperature difference at some time steps.

I fixed this issue by syncing the adaptive time step to radt in dyn_em/adapt_timestep_em.F, so that the radiation code is called exactly every radt (similar to what is already done to sync the adaptive time step with the ouptut timestep). This correction makes the spurious T2 and TSK differences disappear. I am happy to share the corrected code with the development team if they need it.

Louis Marelle
Postdoc at LATMOS/IPSL

Ming Chen
Posts: 1577
Joined: Mon Apr 23, 2018 9:42 pm

Re: Bug in the adaptive time step code in WRFV4.0 (and probably earlier versions)

Post by Ming Chen » Fri Feb 22, 2019 7:36 pm

Louis,
Thank you for the detailed description of the problem related to adaptive time step. Would you please send me your modified code to take a look?
Please also send me your namelist.wps and nameless.input for the test case. I would like to repeat your problem here in NCAR.
Ming
WRF Help Desk

joshuam
Posts: 5
Joined: Thu Apr 08, 2021 1:17 pm

Re: Bug in the adaptive time step code in WRFV4.0 (and probably earlier versions)

Post by joshuam » Thu Apr 15, 2021 9:59 pm

@LouisMarelle I know it has been several years now since this post, but I was wondering, would you be willing to share your code fix?

Thanks,
Joshua

LouisMarelle
Posts: 3
Joined: Mon Oct 08, 2018 2:17 pm

Re: Bug in the adaptive time step code in WRFV4.0 (and probably earlier versions)

Post by LouisMarelle » Fri Apr 16, 2021 8:30 am

Hello Joshua,
Here is a link to the updated adaptive time step module on github:
https://github.com/lmarelle/WRF-halogen ... estep_em.F
And the corresponding git commit
https://github.com/lmarelle/WRF-halogen ... a8bed03a19
My changes are also marked with a !LMarelle flag. I hope this helps!

Post Reply

Return to “Bug Reports”