| 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 dir1ms(n,n64,ind,cs,cc) |
| 23 | |
| 24 | implicit double precision(a-h,o-z) |
| 25 | |
| 26 | c |
| 27 | c routine pour la multiplication et la division |
| 28 | c de n64 fonctions par r. (div (par) r (avec resolution |
| 29 | c f(in) a l'origine |
| 30 | c |
| 31 | c arguments de la routine: |
| 32 | c |
| 33 | c n =nombrede degres de liberte-1 |
| 34 | c cas contraire. |
| 35 | c ind =parametre: si mult=1 la multiplication par x est |
| 36 | c effectuee si mult=-1 la division est effectuee. |
| 37 | c n64 =n64 est le nombre de fonctions qui doivent etre |
| 38 | c divisees (ou multipliees) par x |
| 39 | c cs =tableau contenant le n+1 coefficients de tcheby- |
| 40 | c tchev de la fonction qui doit etre divisee ou |
| 41 | c multipliee par x. |
| 42 | c cc =tableau contenant les coeff. de la fonction divisee. |
| 43 | c les dimensions des tableaux cc et cs doibent |
| 44 | c etre > (n64+1)*n1 |
| 45 | c |
| 46 | C |
| 47 | C $Id: dir1ms.f,v 1.2 2012/03/30 12:12:43 j_novak Exp $ |
| 48 | C $Log: dir1ms.f,v $ |
| 49 | C Revision 1.2 2012/03/30 12:12:43 j_novak |
| 50 | C Cleaning of fortran files |
| 51 | C |
| 52 | C Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon |
| 53 | C LORENE |
| 54 | C |
| 55 | c Revision 1.2 1997/05/23 11:29:46 hyc |
| 56 | c *** empty log message *** |
| 57 | c |
| 58 | C |
| 59 | C $Header: /cvsroot/Lorene/F77/Source/Poisson2d/dir1ms.f,v 1.2 2012/03/30 12:12:43 j_novak Exp $ |
| 60 | C |
| 61 | C |
| 62 | character*120 header |
| 63 | data header/'$Header: /cvsroot/Lorene/F77/Source/Poisson2d/dir1ms.f,v 1.2 2012/03/30 12:12:43 j_novak Exp $'/ |
| 64 | |
| 65 | dimension cs(*),cc(*),y(513) |
| 66 | n1=n+1 |
| 67 | if(n64.gt.513) then |
| 68 | print*,'dimensions insuff. dans la routine dir1ms, n64=',n64 |
| 69 | endif |
| 70 | c |
| 71 | n0=n-1 |
| 72 | n65=n64 |
| 73 | if((n64/8)*8.eq.n64) n65=n64+1 |
| 74 | n63=n64-1 |
| 75 | n064=(n-2)*n65+1 |
| 76 | nn64=n064+n65 |
| 77 | n164=nn64+n65 |
| 78 | c |
| 79 | if(ind.eq.1) then |
| 80 | c |
| 81 | c on effectue la multiplication |
| 82 | c |
| 83 | do 13 j=1,n64 |
| 84 | cc(j)=cs(j)-cs(j+n65) |
| 85 | 13 continue |
| 86 | c |
| 87 | jm1=n65+1 |
| 88 | jm2=jm1+n63 |
| 89 | do 1 l=2,n0 |
| 90 | do 2 m=jm1,jm2 |
| 91 | cc(m)=cs(m)-(cs(m+n65)+cs(m-n65))*.5 |
| 92 | 2 continue |
| 93 | jm1=jm1+n65 |
| 94 | jm2=jm1+n63 |
| 95 | 1 continue |
| 96 | do 5 m=nn64,nn64+n63 |
| 97 | cc(m)=cs(m)-cs(m-n65)*.5 |
| 98 | 5 continue |
| 99 | c |
| 100 | do 6 m=nn64,nn64+n63 |
| 101 | cc(m+n65)=-cs(m) |
| 102 | 6 continue |
| 103 | return |
| 104 | endif |
| 105 | c |
| 106 | c on effectue la division |
| 107 | c |
| 108 | if(ind.eq.-1) then |
| 109 | c |
| 110 | jm1=n65+1 |
| 111 | jm2=jm1+n63 |
| 112 | do 3 l=1,n0 |
| 113 | do 7 m=jm1,jm2 |
| 114 | cc(m)=cs(m-n65)+2*cs(m) |
| 115 | 7 continue |
| 116 | do 8 m=jm1,jm2 |
| 117 | cs(m)=cc(m) |
| 118 | 8 continue |
| 119 | jm1=jm1+n65 |
| 120 | jm2=jm1+n63 |
| 121 | 3 continue |
| 122 | c |
| 123 | do 9 m=n164,n164+n63 |
| 124 | cc(m)=0 |
| 125 | 9 continue |
| 126 | c |
| 127 | do 10 m=nn64,nn64+n63 |
| 128 | cc(m)=cs(m) |
| 129 | 10 continue |
| 130 | c |
| 131 | jm1=n064-1 |
| 132 | jm2=nn64-1 |
| 133 | do 4 ll=2,n |
| 134 | do 11 m=1,n64 |
| 135 | y(m)=cs(m+jm1)+cc(m+jm2) |
| 136 | 11 continue |
| 137 | c |
| 138 | do 12 m=1,n64 |
| 139 | cc(m+jm1)=y(m) |
| 140 | 12 continue |
| 141 | c |
| 142 | jm2=jm1 |
| 143 | jm1=jm1-n65 |
| 144 | 4 continue |
| 145 | endif |
| 146 | 100 format(1x,10e11.3) |
| 147 | 101 format(1x,' ') |
| 148 | return |
| 149 | end |