-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain_P.f95
120 lines (104 loc) · 2.52 KB
/
Main_P.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
108
109
110
111
112
113
114
115
116
117
118
119
120
SUBROUTINE PRESSURE
USE GLOBAL
IMPLICIT NONE
INTEGER(KIND=4)::INCOUNTER
REAL(KIND=4)::R0,RK,P1,P2
NF=3
CON=0
IF(LSOLVE(NF) .eqv. .TRUE.) THEN
IST=2
JST=2
ISTF=IST-1
JSTF=JST-1
CSUM=0.0
CALL GAMSOR
DO I=2,L2
ARHO=R(1)*XCV(I)*RHO(I,1)
CON(I,2)=CON(I,2)+ARHO*MIV(I,2)
AJM(I,2)=0.0
ENDDO
DO J=2,M2
ARHO=ARX(J)*RHO(1,J)
CON(2,J)=CON(2,J)+ARHO*MIU(2,J)
AIM(2,J)=0.
DO I=2,L2
IF(I .EQ. L2) THEN
ARHO=ARX(J)*RHO(L1,J)
CON(I,J)=CON(I,J)-ARHO*MIU(L1,J)
AIP(I,J)=0.0
ELSE
ARHO=ARX(J)*( FX(I+1)*RHO(I+1,J)+FXM(I+1)*RHO(I,J) )
FLOW=ARHO*MIU(I+1,J)
CON(I,J)=CON(I,J)-FLOW
CON(I+1,J)=CON(I+1,J)+FLOW
AIP(I,J)=ARHO*DEU(I+1,J)
AIM(I+1,J)=AIP(I,J)
ENDIF
IF(J .EQ. M2) THEN
ARHO=RMN(M1)*XCV(I)*RHO(I,M1)
CON(I,J)=CON(I,J)-ARHO*MIV(I,M1)
AJP(I,J)=0.
ELSE
ARHO=RMN(J+1)*XCV(I)*( FY(J+1)*RH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