errors (05/28/08)

CRHM Platform

Errors.

Mathematical errors.

DOMAIN    Argument was not in domain of function, such as log(-1).

SING    Argument would result in a singularity, such as pow(0, -2).

OVERFLOW    Argument would produce a function result greater than DBL_MAX (or LDBL_MAX), such as exp(1000).

UNDERFLOW     Argument would produce a function result less than DBL_MIN (or LDBL_MIN), such as exp(-1000).

TLOSS    Argument would produce function result with total loss of significant digits, such as sin(10e70).

Macro parsing errors.

Mathematical errors occur in macros as well as in any module execution. However, another source of errors in in parsing the user code.  When parsing errors occur CHRM displays the block of characters that it cannot breakdown into meaningful phrases.   Common problems are:

  1. No matching parentheses.
  2. Every 'if' or 'while' must have a closing 'endif' or 'endwhile'.
  3. Variables are accessed in the range '1, 2 ...' to 'NHRU' or "NOBS".
  4. In the case of observations CRHM will limit the upper range to the number of observations defined.
  5. The correct type of bracket must always be used. '[]' to define element access and '()' to block conditional statements.
  6. Strings containing spaces must be enclosed in double quotes, e.g. "Text with spaces".
  7. Case is important.

The error could also be in the earlier code which, though interpreting correctly is missing the support for the later code found to be in error.

Macro not giving the expected results.

Check the following.

  1. Variables must define there element access, e.g. '[hh]' or '[1]' will be assumed.
  2. Units must be enclosed in parentheses to be recognized, e.g. "(s)".
  3. Units must always be defined with only one term in the numerator, e.g. "(m/s)".
  4. There are implied enclosing brackets after the '/', e.g."(MJ/m^2*d)" is equivalent to "(MJ/(m^2*d))".