Then dt = 0 leads to rk3coef = 0, which causes a division by 0. If that's not caught, the model crashes with the traditional segfault in thermodynamics. Note: dt is an integer number of milliseconds, rdt is a floating-point number of seconds. The time calculation is done in milliseconds (timee) which is then converted to floating point (rtimee).
Specifying dtmax < 0.1 causes
dt = 0
here: https://github.com/dalesteam/dales/blob/1d63af5d6fefbe2915be67e3be1e094f0634acb3/src/modstartup.f90#L424Then dt = 0 leads to
rk3coef = 0
, which causes a division by 0. If that's not caught, the model crashes with the traditional segfault in thermodynamics. Note: dt is an integer number of milliseconds, rdt is a floating-point number of seconds. The time calculation is done in milliseconds (timee
) which is then converted to floating point (rtimee
).Proposed fix In modstartup.f90, replace
by
ensuring
dt >= 1
i.e. 1 ms.Bug found by Ho Yi Lydia Mak.