-
Notifications
You must be signed in to change notification settings - Fork 12
Description
In ERSEM, switches are often used to select which bits of code are actually run. For example, when computing oxygen saturation concentrations, there is a choice between "legacy ERSEM" and "Weiss 1970". The former can be selected using a value of 1 and the latter a value of 2 according to the module documentation. If a value other than 1 or 2 is specified, it would be reasonable to expect the model to halt with an error message stating that an incorrect selection has been made. In-fact, this doesn't happen. Rather, nearly all this switches are implemented with if - elseif - else syntax, with the else catching the final option. However, the user has no way of knowing this, and it would be better if ERSEM did indeed check for invalid configuration options. It looks like FABM includes a procedure for invoking fatal errors. Is there an overhead/issue with invoking this when selecting between cases? Even if there is, I figure one could implement a workaround (e.g. only perform the check during module initialisation).