Debian Codegraph @

F77/Source/Poisson2d/chexms.f

raw symbols SCIP
1 C
2 C Copyright (c) 1997 Silvano Bonazzola
3 C
4 C This file is part of LORENE.
5 C
6 C LORENE is free software; you can redistribute it and/or modify
7 C it under the terms of the GNU General Public License as published by
8 C the Free Software Foundation; either version 2 of the License, or
9 C (at your option) any later version.
10 C
11 C LORENE is distributed in the hope that it will be useful,
12 C but WITHOUT ANY WARRANTY; without even the implied warranty of
13 C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 C GNU General Public License for more details.
15 C
16 C You should have received a copy of the GNU General Public License
17 C along with LORENE; if not, write to the Free Software
18 C Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 C
20 C
21
22 subroutine chexms(n,n64,f,cc,cs)
23
24 implicit double precision(a-h,o-z)
25
26 C
27 C version du 04.12.1996
28 c
29 c## routine modifiee le 08.10.1993: ajout des save
30 c et suppression des variables declarees
31 c mais non utilisees
32 c
33 c
34 c *** routine pour le calcul simultane des coeff. de tche-
35 c *** bytchef de n64 fonctions. la routine est completment
36 c craytinisee.
37 c **** f doit etre echantillonee dans n+1 points.. dimension minimal
38 c *** des tableaux: =(n64+1)*(n+3), ou n+1 est le nombre des points
39 c *** d'echantillonage.
40 c
41 c cette routine est legerement plus rapide que la chems.
42 c l'output est dans cc au lieu de cs
43 c
44 c
45 c arguments de la routine:
46 c
47 c n = nombre des degres de liberte-1.
48 c n64 = nombre des fonctions d'ont on veut calculer la trans-
49 c formation de tchebytchev.
50 c f =tableau imput. les valeurs echantillonnes des n64
51 c fonctions sont stockees en 'parallel': dans f(1),f(2)..
52 c f(n64) on stocke le valeures de n64 fonctions en x=x0
53 c dans f(1+n64),f(2+n64),...f(n64+n64), les valeures
54 c des n64 fonctions dans le point x1 et ainsi de suite.
55 c si n64 est un multiple de 8, pour des raisons de
56 c craytinisation les donnes sont stockees dan la fa-
57 c con suivante: f(1),f(2),...f(n64), f(n64+1+1),
58 c f(n64+1+2),...f(n64+1+n64).
59 c cc =output. les coeff. de tchebytchev sont sto-
60 c en 'parallel'.
61 c cs =tableau de travail
62 c
63 c
64 c tous les tests de routine ont ete effectues les 20/11/1986
65 C
66 C $Id: chexms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $
67 C $Log: chexms.f,v $
68 C Revision 1.2 2012/03/30 12:12:42 j_novak
69 C Cleaning of fortran files
70 C
71 C Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon
72 C LORENE
73 C
74 c Revision 1.1 1997/10/23 08:15:39 eric
75 c Initial revision
76 c
77 C
78 C $Header: /cvsroot/Lorene/F77/Source/Poisson2d/chexms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $
79 C
80 C
81 character*120 header
82 data header/'$Header: /cvsroot/Lorene/F77/Source/Poisson2d/chexms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $'/
83
84
85 dimension cc(*),cs(*),f(*)
86 dimension sen(513),fn11(513),y(513)
87 data ndim/0/
88 data nfon/0/
89 c##
90 save ndim, nfon, n1, n2, n21, an2, x0, pi, sen, n65
91 save n63, n65n65, nm65, nm651, nm652, n6519, jinit
92 c
93 n513=513
94 if(n.lt.n513) go to 12
95 200 format(10x,'dimensions insuffisantes dans chem64,n=',i4)
96 call exit
97 c
98 c preparation des quantites necessaires pour le calcul.
99 c ces quantites sont calculees la
100 c premiere fois qu'on appelle la routine.
101 c elles sont recalculees toutes les fois qu'on change
102 c n.
103 c
104 12 continue
105 c if(n.eq.ndim) go to 10
106 n1=n+1
107 n2=n/2
108 n21=n2+1
109 an2=1.d+00/n2
110 x0=0
111 pi=2*acos(x0)/n
112 do 14 l=1,n1
113 sen(l)=sin((l-1)*pi)
114 14 continue
115 10 continue
116 c if(nfon.eq.n64.and.n.eq.ndim) go to 18
117 c
118 c preparation des quantites necessaires pour le calcul.
119 c ces quantites sont calculees la premiere fois qu'on
120 c appelle la routine. elles sont recalculees toutes
121 c les fois qu'on change n64.
122 c
123 n65=n64
124 ndim=n
125 if((n64/8)*8.eq.n64) n65=n64+1
126 n63=n64-1
127 n65n65=n65+n65
128 nm65=n65*n
129 nm651=nm65+n65
130 nm652=n65*n21
131 n6519=n65*(n21-2)+1
132 jinit=3*n65+1
133 nfon=n64
134 18 continue
135 c
136 c
137 c pondesration des la partie antisimmetrique des fonc-
138 c tions.
139 c
140 c
141 do 3 l=1,n65
142 fn11(l)= (f(l)-f(l+nm65))*.5
143 3 continue
144 c
145 n21l=nm652
146 n20l=n6519
147 do 1 l=1,n2
148 n2lx=n21l-n20l+1
149 sen20l=sen(n21-l)+.5
150 lx64=n20l+n63
151 do 6 lx=n20l,lx64
152 cs(lx)=(f(lx)-f(lx+n2lx))*sen20l
153 6 continue
154 do 20 lx=n20l,lx64
155 f(lx)=f(lx)-cs(lx)
156 f(lx+n2lx)=f(lx+n2lx)+cs(lx)
157 20 continue
158 n21l=n21l+n65
159 n20l=n20l-n65
160 1 continue
161 c
162 c calcul de la t.f. fonction precedente.
163 c
164 call tfm1s(n,n64,f,cc)
165 c
166 do 4 m=1,n65
167 y(m)=0
168 cs(m+n65)=0
169 4 continue
170 c
171 jl=n65n65
172 do 9 l=jinit,nm65,n65n65
173 jl2=l-1
174 n65l=l+n63
175 do 5 m=l,n65l
176 f(m)=cs(m-n65n65)-cc(m)
177 5 continue
178 do 7 m=l,n65l
179 cs(m)=f(m)
180 7 continue
181 do 8 m=1,n65
182 y(m)=y(m)+cs(m+jl2)
183 8 continue
184 9 continue
185 c
186 do 13 m=1,n65
187 f(m)=(fn11(m)-y(m))*an2
188 13 continue
189 c
190 jm0=n65
191 do 11 l=1,n2
192 jm=jm0+1
193 jm65=jm0+n65
194 do 15 m=jm,jm65
195 cc(m)=cs(m)+f(m-jm0)
196 15 continue
197 jm0=jm0+n65n65
198 11 continue
199 110 format(1x,20i5)
200 100 format(1x,10d12.4)
201 101 format(1x,'chem64')
202 return
203 end
204 c