/[MITgcm]/MITgcm_contrib/osse/EnKF/saxpy.F
ViewVC logotype

Annotation of /MITgcm_contrib/osse/EnKF/saxpy.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Wed May 19 15:43:11 2004 UTC (21 years, 2 months ago) by afe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
o refining osse setup

1 afe 1.1 subroutine saxpy(n,sa,sx,incx,sy,incy)
2     c
3     c constant times a vector plus a vector.
4     c uses unrolled loop for increments equal to one.
5     c jack dongarra, linpack, 3/11/78.
6     c
7     real sx(1),sy(1),sa
8     integer i,incx,incy,ix,iy,m,mp1,n
9     c
10     if(n.le.0)return
11     if (sa .eq. 0.0) return
12     if(incx.eq.1.and.incy.eq.1)go to 20
13     c
14     c code for unequal increments or equal increments
15     c not equal to 1
16     c
17     ix = 1
18     iy = 1
19     if(incx.lt.0)ix = (-n+1)*incx + 1
20     if(incy.lt.0)iy = (-n+1)*incy + 1
21     do 10 i = 1,n
22     sy(iy) = sy(iy) + sa*sx(ix)
23     ix = ix + incx
24     iy = iy + incy
25     10 continue
26     return
27     c
28     c code for both increments equal to 1
29     c
30     c
31     c clean-up loop
32     c
33     20 m = mod(n,4)
34     if( m .eq. 0 ) go to 40
35     do 30 i = 1,m
36     sy(i) = sy(i) + sa*sx(i)
37     30 continue
38     if( n .lt. 4 ) return
39     40 mp1 = m + 1
40     do 50 i = mp1,n,4
41     sy(i) = sy(i) + sa*sx(i)
42     sy(i + 1) = sy(i + 1) + sa*sx(i + 1)
43     sy(i + 2) = sy(i + 2) + sa*sx(i + 2)
44     sy(i + 3) = sy(i + 3) + sa*sx(i + 3)
45     50 continue
46     return
47     end

  ViewVC Help
Powered by ViewVC 1.1.22