This relates to the unpredictable behavior of the intrinsic MAX function in FORTRAN when one has a NaN as argument.
We can speak about this. Of course, we can preprocess the data to check for NaNs. (We have a DISNAN function so this should not be too hard.)
I think we could also use an INTRINSIC for this.
FYI, I found a nice conversation about this issue at:http://objectmix.com/fortran/375103-wha ... t-nan.html
It's a mess indeed.
I am not sure what the MAX( NaN, 1) should be in the general case but
I think in our case, you are right, it makes more sense to have the
norm of a matrix with NaNs to be NaN.