@@ -375,50 +375,7 @@ pure real(wp) function enorm(n, x)
375
375
integer , intent (in ) :: n ! ! a positive integer input variable.
376
376
real (wp), intent (in ) :: x(n) ! ! an input array of length n.
377
377
378
- integer :: i
379
- real (wp) :: agiant, s1, s2, s3, xabs, x1max, x3max
380
-
381
- real (wp), parameter :: rdwarf = 3.834e-20_wp
382
- real (wp), parameter :: rgiant = 1.304e19_wp
383
-
384
- s1 = zero
385
- s2 = zero
386
- s3 = zero
387
- x1max = zero
388
- x3max = zero
389
- agiant = rgiant/ real (n, wp)
390
- do i = 1 , n
391
- xabs = abs (x(i))
392
- if (xabs > rdwarf .and. xabs < agiant) then
393
- ! sum for intermediate components.
394
- s2 = s2 + xabs** 2
395
- elseif (xabs <= rdwarf) then
396
- ! sum for small components.
397
- if (xabs <= x3max) then
398
- if (xabs /= zero) s3 = s3 + (xabs/ x3max)** 2
399
- else
400
- s3 = one + s3* (x3max/ xabs)** 2
401
- x3max = xabs
402
- end if
403
- ! sum for large components.
404
- elseif (xabs <= x1max) then
405
- s1 = s1 + (xabs/ x1max)** 2
406
- else
407
- s1 = one + s1* (x1max/ xabs)** 2
408
- x1max = xabs
409
- end if
410
- end do
411
-
412
- ! calculation of norm.
413
-
414
- if (s1 /= zero) then
415
- enorm = x1max* sqrt (s1 + (s2/ x1max)/ x1max)
416
- elseif (s2 == zero) then
417
- enorm = x3max* sqrt (s3)
418
- else
419
- if (s2 >= x3max) enorm = sqrt (s2* (one + (x3max/ s2)* (x3max* s3)))
420
- if (s2 < x3max) enorm = sqrt (x3max* ((s2/ x3max) + (x3max* s3)))
421
- end if
378
+ enorm = norm2(x(1 :n))
422
379
423
380
end function enorm
424
381
! *****************************************************************************************
0 commit comments