| 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 | |
| 23 | subroutine cd2yms(n,n64,cc,cs) |
| 24 | c |
| 25 | c## routine modifiee le 08.10.1993: ajout des save |
| 26 | c |
| 27 | |
| 28 | implicit double precision(a-h,o-z) |
| 29 | |
| 30 | c |
| 31 | c***** calcul de la derivee 2me de n64 fonctions simultanement. |
| 32 | c**** subroutine completement craytinisee et specialisee pour etre |
| 33 | c appelle par fuci2s ou fuci3s. |
| 34 | c |
| 35 | c arguments de la subroutine: |
| 36 | c |
| 37 | c n =nombre des degres de libertee-1 |
| 38 | c n64 =nombre des fonctions dont on veut calculer la derivee. |
| 39 | c cc =tableau imput contenant les coefficients de tchebytchev |
| 40 | c des fonctions a deriver. |
| 41 | c cs =output contenant le derivees des fonctions. |
| 42 | c |
| 43 | c toutes les donnes sont stockees dans le mode |
| 44 | c 'parallel' (voir les subroutines tfm ou,tfinm,chem64, |
| 45 | c chinm64 pour une explication detaillee') |
| 46 | c |
| 47 | c subroutine specializee pour etreappelle par fuci2s |
| 48 | c et fuci3s |
| 49 | c |
| 50 | c subroutine ayant aubit tous les test de routine le |
| 51 | c 16/12/86. |
| 52 | c |
| 53 | C |
| 54 | C $Id: cd2yms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $ |
| 55 | C $Log: cd2yms.f,v $ |
| 56 | C Revision 1.2 2012/03/30 12:12:42 j_novak |
| 57 | C Cleaning of fortran files |
| 58 | C |
| 59 | C Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon |
| 60 | C LORENE |
| 61 | C |
| 62 | c Revision 1.2 1997/05/23 11:34:25 hyc |
| 63 | c *** empty log message *** |
| 64 | c |
| 65 | C Revision 1.1 1997/03/17 20:21:05 hyc |
| 66 | C Initial revision |
| 67 | C |
| 68 | C |
| 69 | C $Header: /cvsroot/Lorene/F77/Source/Poisson2d/cd2yms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $ |
| 70 | C |
| 71 | C |
| 72 | character*120 header |
| 73 | data header/'$Header: /cvsroot/Lorene/F77/Source/Poisson2d/cd2yms.f,v 1.2 2012/03/30 12:12:42 j_novak Exp $'/ |
| 74 | |
| 75 | dimension cc(*),cs(*),somm(520),som1(520) |
| 76 | data nfon/0/ |
| 77 | data ndim/0/ |
| 78 | c## |
| 79 | save ndim, nfon, n1, n11, nn, n65, nm65, nm651, n65n65 |
| 80 | save nm065, nm965, n10 |
| 81 | |
| 82 | n520=520 |
| 83 | if(n64.gt.n520) then |
| 84 | print 200,n520,n64 |
| 85 | 200 format(10x,'dimension insuffisantes dans la sub.ced2m64' |
| 86 | , ,' dimensions max. admise=',i4,' n64=',i5) |
| 87 | call exit |
| 88 | endif |
| 89 | c |
| 90 | if(n.eq.ndim.and.nfon.eq.n64) go to 10 |
| 91 | ndim=n |
| 92 | n1=n+1 |
| 93 | n11=n+2 |
| 94 | n10=n-1 |
| 95 | nn=n+n |
| 96 | c |
| 97 | nfon=n64 |
| 98 | n65=n64 |
| 99 | if((n64/8)*8.eq.n64)n65=n64+1 |
| 100 | nm65=n*n65 |
| 101 | nm651=nm65+n65 |
| 102 | n65n65=n65+n65 |
| 103 | nm065=(n-1)*n65 |
| 104 | nm965=nm065-n65 |
| 105 | 10 continue |
| 106 | c |
| 107 | c |
| 108 | do 4 l=1,nm651 |
| 109 | cs(l)=0 |
| 110 | 4 continue |
| 111 | c |
| 112 | do 11 m=1,n64 |
| 113 | somm(m)=0 |
| 114 | som1(m)=0 |
| 115 | 11 continue |
| 116 | c |
| 117 | do 12 m=nm65+1,nm651 |
| 118 | cc(m)=cc(m)*.5 |
| 119 | 12 continue |
| 120 | c |
| 121 | al1=n |
| 122 | lm1=nm965 |
| 123 | lm=nm65 |
| 124 | do 1 lp=1,n10,2 |
| 125 | al2=al1**2 |
| 126 | al32=(al1-2)**2 |
| 127 | do 13 m=1,n64 |
| 128 | cpm=cc(m+lm)*al1 |
| 129 | somm(m)=somm(m)+cpm |
| 130 | som1(m)=som1(m)+cpm*al2 |
| 131 | 13 continue |
| 132 | c |
| 133 | do 14 m=1,n64 |
| 134 | cs(m+lm1)=som1(m)-somm(m)*al32 |
| 135 | 14 continue |
| 136 | c |
| 137 | al1=al1-2.d+00 |
| 138 | lm1=lm1-n65n65 |
| 139 | lm=lm-n65n65 |
| 140 | 1 continue |
| 141 | c |
| 142 | do 15 m=1,n64 |
| 143 | som1(m)=0 |
| 144 | somm(m)=0 |
| 145 | 15 continue |
| 146 | c |
| 147 | al1=n-1 |
| 148 | lm=nm065 |
| 149 | lm1=nm965 |
| 150 | do 2 lp=2,n10,2 |
| 151 | al2=al1**2 |
| 152 | al32=(al1-2)**2 |
| 153 | do 16 m=1,n64 |
| 154 | cpm=cc(m+lm)*al1 |
| 155 | somm(m)=somm(m)+cpm |
| 156 | som1(m)=som1(m)+cpm*al2 |
| 157 | 16 continue |
| 158 | c |
| 159 | do 17 m=1,n64 |
| 160 | cs(m+lm1-n65)=som1(m)-somm(m)*al32 |
| 161 | 17 continue |
| 162 | c |
| 163 | al1=al1-2 |
| 164 | lm=lm-n65n65 |
| 165 | lm1=lm1-n65n65 |
| 166 | c |
| 167 | 2 continue |
| 168 | c |
| 169 | 100 format(1x,'ced2m64',10d12.4) |
| 170 | 101 format(1x,'ced2m64') |
| 171 | 110 format(1x,'ced2m64',20i5) |
| 172 | c |
| 173 | return |
| 174 | end |