-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main_X.f95
107 lines (84 loc) · 2.3 KB
/
Main_X.f95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
SUBROUTINE XVELOCITY
USE GLOBAL
IMPLICIT NONE
REAL*8 P1,P2
NF=1
IF(LSOLVE(NF).eqv..TRUE.) THEN
IST=2
JST=2
ISTF=IST-1
JSTF=JST-1
CALL GAMSOR
DO I=2,L2
AREA=R(1)*XCV(I)
FLOW=AREA*MIV(I,2)*RHO(I,1)
DIF=AREA*GAM(I,1)/YDIF(2)
AJM(I,2)=DIF+MAX(0.0,FLOW)
ENDDO
DO J=2,M2
FLOW=ARX(J)*MIU(2,J)*RHO(1,J)
DIF=ARX(J)*GAM(1,J)/(XDIF(2)*SX(J))
AIM(2,J)=DIF+MAX(0.0,FLOW)
DO I=2,L2
IF(I==L2) THEN
FLOW=ARX(J)*MIU(L1,J)*RHO(L1,J)
DIF=ARX(J)*GAM(L1,J)/( XDIF(L1)*SX(J) )
ELSE
FLOW=ARX(J)*MIU(I+1,J)*( FX(I+1)*RHO(I+1,J)+FXM(I+1)*RHO(I,J) )
DIF=ARX(J)*2.0*GAM(I,J)*GAM(I+1,J)/( (XCV(I)*GAM(I+1,J)+XCV(I+1)*GAM(I,J)+1.0E-30)*SX(J) )
ENDIF
AIM(I+1,J)=DIF+MAX(0.,FLOW)
AIP(I,J)=AIM(I+1,J)-FLOW
FLUXE(I,J)=FLOW
AREA=RMN(J+1)*XCV(I)
IF(J==M2) THEN
FLOW=AREA*MIV(I,M1)*RHO(I,M1)
DIF=AREA*GAM(I,M1)/YDIF(M1)
ELSE
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