This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MINICERN / mathlib / gen / d / elpahy.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1996/04/01 15:02:18  mclareni
6 * Mathlib gen
7 *
8 *
9 #include "gen/pilot.h"
10       SUBROUTINE ELPAHY(F,IDIM1,IDIM2,DX,DY,COEFS,IBX,BWEST,BEAST,
11      1JBY,BSOUTH,BNORTH)
12       DIMENSION COEFS(3)
13       DIMENSION F(IDIM1,IDIM2)
14       DIMENSION BWEST(IDIM2),BEAST(IDIM2),BNORTH(IDIM1),BSOUTH(IDIM1)
15 C------------------------------------------
16 C   KIND OF EQUATION AND COEFFICIENTS     I
17 C------------------------------------------
18 C   IKIND=1-ELLIPTIC ,=2-PARABOLIC ,=3-HYPERBOLIC
19 C
20 C   DX2+AD*DY2+BD*DY+CD*Y=SOURCE
21 C
22       AD=COEFS(1)
23       BD=COEFS(2)
24       CD=COEFS(3)
25       IF(AD) 510,511,512
26  510  IKIND=3
27       GO TO 513
28  511  IKIND=2
29       GO TO 513
30  512  IKIND=1
31  513  CONTINUE
32 C------------------------------------------
33 C   MESH DIVISION AND CELL SIZE           I
34 C------------------------------------------
35 C   IDIM1 DIVISIONS ALONG THE X-DIRECTION
36 C   IDIM2 DIVISIONS ALONG THE Y-DIRECTION
37 C   DX = CELL SIZE ALOND X
38 C   DY = CELL SIZE ALONG Y
39 C
40       RAT=DX/DY
41       RAT2=RAT*RAT
42       DX2=DX*DX
43       AT=RAT2*AD
44       BT=RAT*DX*BD
45       CT=DX2*CD
46       DO 1 I=1,IDIM1
47       DO 1 J=1,IDIM2
48  1    F(I,J)=DX2*F(I,J)
49 C------------------------------------------
50 C   BOUNDARY CONDITIONS                   I
51 C------------------------------------------
52 C   ALONG THE WEST AND EAST BOUNDARIES
53 C   IBX=1-PERIODIC ,=2-DERIVATIVE ,=3-VALUE ,=4-VALUE+DERIVATIVE
54 C
55 C   ALONG THE SOUTH AND NORTH BOUNDARIES
56 C   JBY=1   VALUE=BSOUTH(I) ,VALUE=BNORTH(I)
57 C   JBY=2   DERIVATIVE=BSOUTH(I) ,DERIVATIVE=BNORTH(I)
58 C   JBY=3   VALUE=BSOUTH(I) ,DERIVATIVE=BNORTH(I)
59 C   JBY=4   DERIVATIVE=BSOUTH(I) ,VALUE=BNORTH(I)
60 C
61       GO TO (520,521,522,523) ,JBY
62  520  ALFAS=1.
63       BETAS=0.
64       ALFAN=1.
65       BETAN=0.
66       GO TO 524
67  521  ALFAS=0.
68       BETAS=1.
69       ALFAN=0.
70       BETAN=1.
71       GO TO 524
72  522  ALFAS=1.
73       BETAS=0.
74       ALFAN=0.
75       BETAN=1.
76       GO TO 524
77  523  ALFAS=0.
78       BETAS=1.
79       ALFAN=1.
80       BETAN=0.
81  524  CONTINUE
82 C
83 C   THIS SUBROUTINE MODIFIES THE SOURCE TERM
84 C   AT EACH END OF THE X-RANGE ACCORDING
85 C   TO THE TYPE OF BOUNDARY CONDITIONS
86 C   CHOSEN ALONG THAT DIRECTION
87 C
88       CALL NEWRO(IDIM1,IDIM2,IBX,DX,F,BWEST,BEAST,BSOUTH,BNORTH)
89 C
90 C   THIS SUBROUTINE PERFORMS THE APPROPRIATE
91 C   FOURIER ANALYSIS OF THE SOURCE TERM
92 C   ALONG THE X-DIRECTION USING FAST FOURIER
93 C   TRANSFORM TECHNIQUES
94 C
95       CALL ELANAL(IDIM1,IDIM2,IBX,F,BWEST,BEAST,BSOUTH,BNORTH)
96 C
97 C   THIS SUBROUTINE SOLVES THE TWO-POINTS
98 C   OR THREE-POINTS RECURRENCE FORMULA ALONG
99 C   THE SECOND DIMENSION FOR EITHER ONE OF
100 C   THE ELLIPTIC,PARABOLIC OR HYPERBOLIC TYPE
101 C   OF EQUATIONS
102 C
103       CALL ESOLVE(IDIM1,IDIM2,AT,BT,CT,DY,IBX,ALFAS,BETAS,ALFAN,BETAN,
104      1F,IKIND)
105 C
106 C   THIS SUBROUTINE PERFORMS THE APPROPRIATE
107 C   FOURIER SYNTHESIS OF THE UNKNOWWN FUNCTION
108 C   ALONG THE X-DIRECTION USING FAST FOURIER
109 C   TRANSFORM TECHNIQUES
110 C
111       CALL SYNT(IDIM1,IDIM2,IBX,F)
112 C
113 C
114       GO TO (100,110,120,130),IBX
115  100  DO 101 J=1,IDIM2
116  101  F(IDIM1,J)=F(1,J)
117       GO TO 110
118  120  DO 121 J=1,IDIM2
119       F(1,J)=BWEST(J)
120  121  F(IDIM1,J)=BEAST(J)
121       GO TO 110
122  130  DO 131 J=1,IDIM2
123  131  F(1,J)=BWEST(J)
124  110  RETURN
125       END