source: trunk/LMDZ.GENERIC/libf/filtrez/inifgn.F @ 1974

Last change on this file since 1974 was 1422, checked in by milmd, 10 years ago

In GENERIC, MARS and COMMON models replace some include files by modules (usefull for decoupling physics with dynamics).

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1      SUBROUTINE inifgn(dv)
2
3c    ...  H.Upadyaya , O.Sharma  ...
4c
5      IMPLICIT NONE
6c
7#include "dimensions.h"
8#include "paramet.h"
9#include "comgeom.h"
10
11c
12      REAL vec(iim,iim),vec1(iim,iim)
13      REAL dlonu(iim),dlonv(iim)
14      REAL du(iim),dv(iim),d(iim)
15      REAL pi
16      INTEGER i,j,k,imm1,nrot
17C
18#include "coefils.h"
19c
20      EXTERNAL SSUM, acc,eigen,jacobi
21      REAL SSUM
22c
23
24      imm1  = iim -1
25      pi = 2.* ASIN(1.)
26C
27      DO 5 i=1,iim
28       dlonu(i)=  xprimu( i )
29       dlonv(i)=  xprimv( i )
30   5  CONTINUE
31
32      DO 12 i=1,iim
33      sddv(i)   = SQRT(dlonv(i))
34      sddu(i)   = SQRT(dlonu(i))
35      unsddu(i) = 1./sddu(i)
36      unsddv(i) = 1./sddv(i)
37  12  CONTINUE
38C
39      DO 17 j=1,iim
40      DO 17 i=1,iim
41      vec(i,j)     = 0.
42      vec1(i,j)    = 0.
43      eignfnv(i,j) = 0.
44      eignfnu(i,j) = 0.
45  17  CONTINUE
46c
47c
48      eignfnv(1,1)    = -1.
49      eignfnv(iim,1)  =  1.
50      DO 20 i=1,imm1
51      eignfnv(i+1,i+1)= -1.
52      eignfnv(i,i+1)  =  1.
53  20  CONTINUE
54      DO 25 j=1,iim
55      DO 25 i=1,iim
56      eignfnv(i,j) = eignfnv(i,j)/(sddu(i)*sddv(j))
57  25  CONTINUE
58      DO 30 j=1,iim
59      DO 30 i=1,iim
60      eignfnu(i,j) = -eignfnv(j,i)
61  30  CONTINUE
62c
63#ifdef CRAY
64      CALL MXM(eignfnu,iim,eignfnv,iim,vec ,iim)
65      CALL MXM(eignfnv,iim,eignfnu,iim,vec1,iim)
66#else
67      DO j = 1, iim
68      DO i = 1, iim
69        vec (i,j) = 0.0
70        vec1(i,j) = 0.0
71       DO k = 1, iim
72        vec (i,j) = vec(i,j)  + eignfnu(i,k) * eignfnv(k,j)
73        vec1(i,j) = vec1(i,j) + eignfnv(i,k) * eignfnu(k,j)
74       ENDDO
75      ENDDO
76      ENDDO
77#endif
78
79c
80      CALL jacobi(vec,iim,iim,dv,eignfnv,nrot)
81      CALL acc(eignfnv,d,iim)
82      CALL eigen_sort(dv,eignfnv,iim,iim)
83c
84      CALL jacobi(vec1,iim,iim,du,eignfnu,nrot)
85      CALL acc(eignfnu,d,iim)
86      CALL eigen_sort(du,eignfnu,iim,iim)
87
88cc   ancienne version avec appels IMSL
89c
90c     CALL MXM(eignfnu,iim,eignfnv,iim,vec,iim)
91c     CALL MXM(eignfnv,iim,eignfnu,iim,vec1,iim)
92c     CALL EVCSF(iim,vec,iim,dv,eignfnv,iim)
93c     CALL acc(eignfnv,d,iim)
94c     CALL eigen(eignfnv,dv)
95c
96c     CALL EVCSF(iim,vec1,iim,du,eignfnu,iim)
97c     CALL acc(eignfnu,d,iim)
98c     CALL eigen(eignfnu,du)
99
100      RETURN
101      END
102
Note: See TracBrowser for help on using the repository browser.