edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
24 stars 6 forks source link

Model crashes if `dumpFreq` < `dt` #88

Open edoddridge opened 7 years ago

edoddridge commented 7 years ago

I've just encountered an annoying scenario in which the model fails with a very unhelpful error message of "Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation."

It occurs when dumpFreq is less than dt. I got into this situation trying to debug the external solver by dumping every time step and then increasing the time step.

This could be avoided nicely by emitting a warning if dumpFreq < dt, possibly accompanied by forcing dumpFreq >= dt. This is one of the inputs that Aronnax should verify per #57.

axch commented 7 years ago

Another option is to allow the user to specify an integer dump frequency in time steps rather than time duration. It would be nice for the user-facing interface to allow either and do the right thing regardless of which is specified; but I am not sure whether Fortran namelist format will make it pleasant to do that. I guess defaults and sentinel values will work...

edoddridge commented 7 years ago

That would work.

My preference is to have the dump frequency in natural units - that way when one wants monthly means, the time step doesn't need to be taken into consideration. But, I'm not opposed to having the option to specify it either way.