# CDPINN -- calculates (weighted) inner product of two vectors # date author description # 12-01-87 J.-C. Hsu Design and coding # 03-09-90 J.-C. Hsu rewrite in SPP #------------------------------------------------------------------------------- double procedure cdpinn (a, b, weight, npts) double a[npts], b[npts] # input: vectors to nner-productweights double weight[npts] # input: weight int npts # input: number of data points double sum # output: the weighted inner product int i # loop index #------------------------------------------------------------------------------ begin sum = 0.d0 do i = 1, npts sum = sum + a[i] * b[i] * weight[i] return (sum) end