/[lmdze]/trunk/filtrez/inifgn.f
ViewVC logotype

Contents of /trunk/filtrez/inifgn.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 152 - (show annotations)
Tue Jun 23 18:18:12 2015 UTC (8 years, 10 months ago) by guez
Original Path: trunk/Sources/filtrez/inifgn.f
File size: 1373 byte(s)
Clarification in procedure inifgn. The cost is that we use 3 instead
of 2 local 2-dimensional arrays. eignfnv and eignfnu were used as
temporary arrays to compute input to jacobi before being used as
arguments of jacobi. The corresponding dummy argument is intent(out)
in jacobi. It is clearer to have eignfnv and eignfnu appear only as
arguments of jacobi.

1 module inifgn_m
2
3 use dimens_m, only: iim
4
5 IMPLICIT NONE
6
7 private iim
8
9 real sddu(iim), sddv(iim) ! SQRT(dx / di)
10 real unsddu(iim), unsddv(iim)
11
12 real eignfnu(iim, iim), eignfnv(iim, iim)
13 ! eigenfunctions of the discrete laplacian
14
15 contains
16
17 SUBROUTINE inifgn(dv)
18
19 ! From LMDZ4/libf/filtrez/inifgn.F, v 1.1.1.1 2004/05/19 12:53:09
20
21 ! H. Upadyaya, O. Sharma
22
23 use acc_m, only: acc
24 USE dimens_m, ONLY: iim
25 USE dynetat0_m, ONLY: xprimu, xprimv
26 use numer_rec_95, only: jacobi, eigsrt
27
28 real, intent(out):: dv(:) ! (iim) eigenvalues sorted in descending order
29
30 ! Local:
31 REAL, dimension(iim, iim):: a, b, c
32 REAL du(iim)
33 INTEGER i
34
35 !----------------------------------------------------------------
36
37 print *, "Call sequence information: inifgn"
38
39 sddv = sqrt(xprimv(:iim))
40 sddu = sqrt(xprimu(:iim))
41 unsddu = 1. / sddu
42 unsddv = 1. / sddv
43
44 b = 0.
45 b(iim, 1) = 1. / (sddu(iim) * sddv(1))
46 forall (i = 1:iim) b(i, i) = - 1./ (sddu(i) * sddv(i))
47 forall (i = 1:iim - 1) b(i, i + 1) = 1. / (sddu(i) * sddv(i + 1))
48
49 c = - transpose(b)
50
51 a = matmul(c, b)
52 CALL jacobi(a, dv, eignfnv)
53 CALL acc(eignfnv)
54 CALL eigsrt(dv, eignfnv)
55
56 a = matmul(b, c)
57 CALL jacobi(a, du, eignfnu)
58 CALL acc(eignfnu)
59 CALL eigsrt(du, eignfnu)
60
61 END SUBROUTINE inifgn
62
63 end module inifgn_m

  ViewVC Help
Powered by ViewVC 1.1.21