Open
Description
The error handling is somewhat ad-hoc, with error codes largely selected at random.
The convention is as follows:
0 = OK
positive = fatal error
negative = warning (or recoverable error)
We should really use named variables in globalData.f90
, i.e.,
integer(i4b),parameter,public :: ok=0
integer(i4b),parameter,public :: recoverableError=-1
integer(i4b),parameter,public :: fatalError=1
Then the error checking can (in most cases) be
if(err/=ok)then
message=trim(message)//trim(cmessage)
return
endif
or (in special cases
if(err==recoverableError) [doSomething]
Note that this will change MANY lines of code, so should be included as a separate branch.