GNU Octave  3.8.0 A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ddwnrm.f
Go to the documentation of this file.
1 C Work performed under the auspices of the U.S. Department of Energy
2 C by Lawrence Livermore National Laboratory under contract number
3 C W-7405-Eng-48.
4 C
5  DOUBLE PRECISION FUNCTION ddwnrm(NEQ,V,RWT,RPAR,IPAR)
6 C
7 C***BEGIN PROLOGUE DDWNRM
8 C***ROUTINES CALLED (NONE)
9 C***DATE WRITTEN 890101 (YYMMDD)
10 C***REVISION DATE 900926 (YYMMDD)
11 C***END PROLOGUE DDWNRM
12 C-----------------------------------------------------------------------
13 C This function routine computes the weighted
14 C root-mean-square norm of the vector of length
15 C NEQ contained in the array V, with reciprocal weights
16 C contained in the array RWT of length NEQ.
17 C DDWNRM=SQRT((1/NEQ)*SUM(V(I)*RWT(I))**2)
18 C-----------------------------------------------------------------------
19 C
20  IMPLICIT DOUBLE PRECISION(a-h,o-z)
21  dimension v(*),rwt(*)
22  dimension rpar(*),ipar(*)
23  ddwnrm = 0.0d0
24  vmax = 0.0d0
25  DO 10 i = 1,neq
26  IF(abs(v(i)*rwt(i)) .GT. vmax) vmax = abs(v(i)*rwt(i))
27 10 CONTINUE
28  IF(vmax .LE. 0.0d0) go to 30
29  sum = 0.0d0
30  DO 20 i = 1,neq
31 20 sum = sum + ((v(i)*rwt(i))/vmax)**2
32  ddwnrm = vmax*sqrt(sum/neq)
33 30 CONTINUE
34  RETURN
35 C
36 C------END OF FUNCTION DDWNRM-------------------------------------------
37  END