Skip to content

shr_wv_sat_mod routines should abort (or produce an obviously-incorrect answer) if init hasn't been called #83

@billsacks

Description

@billsacks

As @uturuncoglu pointed out in ESCOMP/CMEPS#653, if you try to use the routines in shr_wv_sat_mod without first calling shr_wv_sat_init, they can produce 0 values. It would be best if they aborted in this case, or at the very least (if aborting from within these functions isn't acceptable, e.g., because it would require changing functions to no longer be pure and that would be bad for performance) produced obviously-incorrect values that would allow failing faster - e.g., as in:

case default
! Providing a correct index is an important precondition for these
! functions. Since we don't have a way of signaling an error, produce an
! obviously unreasonable answer.
es = -huge(1._rk)

This could be done by having a module-level initialized variable that is checked in each function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions