For norm2 (L2 norm), one essentially does:
tmp = max(array) ! = L_infinity norm
norm2 = tmp * sqrt( (array/tmp)**2)
to avoid an overflow. However, it is implemented using a single pass.
For NORM2, an algorithm based on the one in BLAS is used though I have
realized that I start with SCALE == 1, RESULT = 0 while BLAS uses the
opposite starting values. Both seem to lead to the same result, thus, I
do not know which one is better. Quickly thinking about it, mine seems
to be better (faster + more accurate) for small values (<= 1.0), but I
might be wrong. Cf. http://www.netlib.org/blas/snrm2.f