00001 DOUBLE PRECISION FUNCTION VNORM (N, V, W) 00002 CLLL. OPTIMIZE 00003 C----------------------------------------------------------------------- 00004 C THIS FUNCTION ROUTINE COMPUTES THE WEIGHTED ROOT-MEAN-SQUARE NORM 00005 C OF THE VECTOR OF LENGTH N CONTAINED IN THE ARRAY V, WITH WEIGHTS 00006 C CONTAINED IN THE ARRAY W OF LENGTH N.. 00007 C VNORM = SQRT( (1/N) * SUM( V(I)*W(I) )**2 ) 00008 C----------------------------------------------------------------------- 00009 INTEGER N, I 00010 DOUBLE PRECISION V, W, SUM 00011 DIMENSION V(N), W(N) 00012 SUM = 0.0D0 00013 DO 10 I = 1,N 00014 10 SUM = SUM + (V(I)*W(I))**2 00015 VNORM = DSQRT(SUM/DBLE(N)) 00016 RETURN 00017 C----------------------- END OF FUNCTION VNORM ------------------------- 00018 END