GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ddwnrm.f
Go to the documentation of this file.
1C Work performed under the auspices of the U.S. Department of Energy
2C by Lawrence Livermore National Laboratory under contract number
3C W-7405-Eng-48.
4C
5 DOUBLE PRECISION FUNCTION ddwnrm(NEQ,V,RWT,RPAR,IPAR)
6C
7C***BEGIN PROLOGUE DDWNRM
8C***ROUTINES CALLED (NONE)
9C***DATE WRITTEN 890101 (YYMMDD)
10C***REVISION DATE 900926 (YYMMDD)
11C***END PROLOGUE DDWNRM
12C-----------------------------------------------------------------------
13C This function routine computes the weighted
14C root-mean-square norm of the vector of length
15C NEQ contained in the array V, with reciprocal weights
16C contained in the array RWT of length NEQ.
17C DDWNRM=SQRT((1/NEQ)*SUM(V(I)*RWT(I))**2)
18C-----------------------------------------------------------------------
19C
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))
2710 CONTINUE
28 IF(vmax .LE. 0.0d0) GO TO 30
29 sum = 0.0d0
30 DO 20 i = 1,neq
3120 sum = sum + ((v(i)*rwt(i))/vmax)**2
32 ddwnrm = vmax*sqrt(sum/neq)
3330 CONTINUE
34 RETURN
35C
36C------END OF FUNCTION DDWNRM-------------------------------------------
37 END
double precision function ddwnrm(neq, v, rwt, rpar, ipar)
Definition ddwnrm.f:6