forked from aida-alvera/DINEOF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smeanByRow.F
47 lines (44 loc) · 2.33 KB
/
smeanByRow.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
subroutine smeanByRow
& (A, m, n, meanA, maxm, maxn,VALEX)
c---------------------------------------------------------------------c
c "iterativeEOF", Version 2.0, December, 2002. c
c A Krylov-based code for computing EOF c
c Vincent TOUMAZOU c
c CNES/MERCATOR-Ocean c
c 18, Avenue Edouard Belin c
c F-31401 TOULOUSE Cedex 4 c
c URL: http://www.mercator.com.fr c
c URL: http://www.cnes.fr c
c---------------------------------------------------------------------c
c This subroutine computes the raw mean of the matrix A c
c c
c INPUT : c
c ------ c
c - A : SINGLE PRECISION c
c m by n matrix c
c - m, n : INTEGER c
c Dimensions of A c
c - maxm, maxn are the leading dimension of A c
c c
c OUTPUT : c
c ------ c
c - meanA : SINGLE PRECISION c
c vector of length m whose components are the c
c means of the raws of A. c
c---------------------------------------------------------------------c
integer m, n, maxm, maxn
real A(maxm, maxn), meanA(maxm),VALEX
integer i,j,n1
n1=0
do i=1,m
meanA(i)=0.0
do j=1,n
if(A(i,j).ne.VALEX) then
meanA(i)=meanA(i)+A(i,j)
n1=n1+1
endif
enddo
meanA(i)=meanA(i)/n
enddo
end