I would never use a library that returns NaNs.
Considering the current Fortran standard with rudimentary to no support for this aspect, KISS will be preferable for FOSS libraries in Fortran:
FUNCTION
subprograms: employERROR STOP
for the exceptions that, hopefully, are as such!SUBROUTINE
s: includeSTAT
andERRMSG
arguments and follow intrinsic procedures: a)STAT
isINTENT(OUT)
and zero value meansSUCCESS
and b)ERRMSG
isINTENT(INOUT)