| 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 chezms(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 *** routine pour le calcul simultane des coeff. de tche- |
| 34 | c *** bytchef de n64 fonctions. la routine est completment |
| 35 | c *** craytinisee. |
| 36 | c *** f doit etre echantillonee dans n+1 points.. dimension minimal |
| 37 | c *** des tableaux: =(n64+1)*(n+3), ou n+1 est le nombre des points |
| 38 | c *** d'echantillonage. |
| 39 | c |
| 40 | c cette routine est legerement plus rapide que la chems. |
| 41 | c l'output est dans cc au lieu de cs |
| 42 | c |
| 43 | c |
| 44 | c arguments de la routine: |
| 45 | c |
| 46 | c n = nombre des degres de liberte-1. |
| 47 | c n64 = nombre des fonctions d'ont on veut calculer la trans- |
| 48 | c formation de tchebytchev. |
| 49 | c f =tableau imput. les valeurs echantillonnes des n64 |
| 50 | c fonctions sont stockees en 'parallel': dans f(1),f(2).. |
| 51 | c f(n64) on stocke le valeures de n64 fonctions en x=x0 |
| 52 | c dans f(1+n64),f(2+n64),...f(n64+n64), les valeures |
| 53 | c des n64 fonctions dans le point x1 et ainsi de suite. |
| 54 | c si n64 est un multiple de 8, pour des raisons de |
| 55 | c craytinisation les donnes sont stockees dan la fa- |
| 56 | c con suivante: f(1),f(2),...f(n64), f(n64+1+1), |
| 57 | c f(n64+1+2),...f(n64+1+n64). |
| 58 | c cc =output. les coeff. de tchebytchev sont sto- |
| 59 | c en 'parallel'. |
| 60 | c cs =tableau de travail |
| 61 | c |
| 62 | c |
| 63 | c tous les tests de routine ont ete effectues les 20/11/1986 |
| 64 | C |
| 65 | C $Id: chezms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $ |
| 66 | C $Log: chezms.f,v $ |
| 67 | C Revision 1.2 2012/03/30 12:12:42 j_novak |
| 68 | C Cleaning of fortran files |
| 69 | C |
| 70 | C Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon |
| 71 | C LORENE |
| 72 | C |
| 73 | c Revision 1.1 1997/10/23 08:16:43 eric |
| 74 | c Initial revision |
| 75 | c |
| 76 | C |
| 77 | C $Header: /cvsroot/Lorene/F77/Source/Poisson2d/chezms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $ |
| 78 | C |
| 79 | C |
| 80 | character*120 header |
| 81 | data header/'$Header: /cvsroot/Lorene/F77/Source/Poisson2d/chezms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $'/ |
| 82 | |
| 83 | dimension cc(*),cs(*),f(*) |
| 84 | dimension sen(513),fn11(513),y(513) |
| 85 | data ndim/0/ |
| 86 | data nfon/0/ |
| 87 | c## |
| 88 | save ndim, nfon, n1, n2, n21, an2, x0, pi, sen, n65 |
| 89 | save n63, n65n65, nm65, nm651, nm652, n6519, jinit |
| 90 | c |
| 91 | n513=513 |
| 92 | if(n.lt.n513) go to 12 |
| 93 | 200 format(10x,'dimensions insuffisantes dans chem64,n=',i4) |
| 94 | call exit |
| 95 | c |
| 96 | c preparation des quantites necessaires pour le calcul. |
| 97 | c ces quantites sont calculees la |
| 98 | c premiere fois qu'on appelle la routine. |
| 99 | c elles sont recalculees toutes les fois qu'on change |
| 100 | c n. |
| 101 | c |
| 102 | 12 continue |
| 103 | c if(n.eq.ndim) go to 10 |
| 104 | n1=n+1 |
| 105 | n2=n/2 |
| 106 | n21=n2+1 |
| 107 | an2=1.d+00/n2 |
| 108 | x0=0 |
| 109 | pi=2*acos(x0)/n |
| 110 | do 14 l=1,n1 |
| 111 | sen(l)=sin((l-1)*pi) |
| 112 | 14 continue |
| 113 | 10 continue |
| 114 | c if(nfon.eq.n64.and.n.eq.ndim) go to 18 |
| 115 | c |
| 116 | c preparation des quantites necessaires pour le calcul. |
| 117 | c ces quantites sont calculees la premiere fois qu'on |
| 118 | c appelle la routine. elles sont recalculees toutes |
| 119 | c les fois qu'on change n64. |
| 120 | c |
| 121 | n65=n64 |
| 122 | ndim=n |
| 123 | if((n64/8)*8.eq.n64) n65=n64+1 |
| 124 | n63=n64-1 |
| 125 | n65n65=n65+n65 |
| 126 | nm65=n65*n |
| 127 | nm651=nm65+n65 |
| 128 | nm652=n65*n21 |
| 129 | n6519=n65*(n21-2)+1 |
| 130 | jinit=3*n65+1 |
| 131 | nfon=n64 |
| 132 | 18 continue |
| 133 | c |
| 134 | c |
| 135 | c pondesration des la partie antisimmetrique des fonc- |
| 136 | c tions. |
| 137 | c |
| 138 | c |
| 139 | do 3 l=1,n65 |
| 140 | fn11(l)= (f(l)-f(l+nm65))*.5 |
| 141 | 3 continue |
| 142 | c |
| 143 | n21l=nm652 |
| 144 | n20l=n6519 |
| 145 | do 1 l=1,n2 |
| 146 | n2lx=n21l-n20l+1 |
| 147 | sen20l=sen(n21-l)+.5 |
| 148 | lx64=n20l+n63 |
| 149 | do 6 lx=n20l,lx64 |
| 150 | cs(lx)=(f(lx)-f(lx+n2lx))*sen20l |
| 151 | 6 continue |
| 152 | do 20 lx=n20l,lx64 |
| 153 | f(lx)=f(lx)-cs(lx) |
| 154 | f(lx+n2lx)=f(lx+n2lx)+cs(lx) |
| 155 | 20 continue |
| 156 | n21l=n21l+n65 |
| 157 | n20l=n20l-n65 |
| 158 | 1 continue |
| 159 | c |
| 160 | c calcul de la t.f. fonction precedente. |
| 161 | c |
| 162 | call tfm3s(n,n64,f,cc) |
| 163 | c |
| 164 | do 4 m=1,n65 |
| 165 | y(m)=0 |
| 166 | cs(m+n65)=0 |
| 167 | 4 continue |
| 168 | c |
| 169 | jl=n65n65 |
| 170 | do 9 l=jinit,nm65,n65n65 |
| 171 | jl2=l-1 |
| 172 | n65l=l+n63 |
| 173 | do 5 m=l,n65l |
| 174 | f(m)=cs(m-n65n65)-cc(m) |
| 175 | 5 continue |
| 176 | do 7 m=l,n65l |
| 177 | cs(m)=f(m) |
| 178 | 7 continue |
| 179 | do 8 m=1,n65 |
| 180 | y(m)=y(m)+cs(m+jl2) |
| 181 | 8 continue |
| 182 | 9 continue |
| 183 | c |
| 184 | do 13 m=1,n65 |
| 185 | f(m)=(fn11(m)-y(m))*an2 |
| 186 | 13 continue |
| 187 | c |
| 188 | jm0=n65 |
| 189 | do 11 l=1,n2 |
| 190 | jm=jm0+1 |
| 191 | jm65=jm0+n65 |
| 192 | do 15 m=jm,jm65 |
| 193 | cc(m)=cs(m)+f(m-jm0) |
| 194 | 15 continue |
| 195 | jm0=jm0+n65n65 |
| 196 | 11 continue |
| 197 | 110 format(1x,20i5) |
| 198 | 100 format(1x,10d12.4) |
| 199 | 101 format(1x,'chem64') |
| 200 | return |
| 201 | end |
| 202 | c |
| 203 |