-
Notifications
You must be signed in to change notification settings - Fork 3
/
Implicitcompute.f03
43 lines (41 loc) · 962 Bytes
/
Implicitcompute.f03
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
Subroutine Implicitcompute(l)
use COM
implicit none
integer i,j,l
real(8) omiga
real(8) dh,dhc,dhw,dhe,dhs,dhn,ahP,ahW,ahE,ahS,ahN,bh
omiga=1
DO j=1,Jg(l)
DO i=1,Ig(l)
ahP=Imps(l)%ahM(1,i,j)
ahW=Imps(l)%ahM(2,i,j)
ahE=Imps(l)%ahM(3,i,j)
ahS=Imps(l)%ahM(4,i,j)
ahN=Imps(l)%ahM(5,i,j)
bh=Imps(l)%bh(i,j)
dhc=Imps(l)%dh(i,j)
if(i==1) then
dhw=Boundatas(l)%dhbcl(j)
else
dhw=Imps(l)%dh(i-1,j)
end if
if(i==Ig(l)) then
dhe=Boundatas(l)%dhbcr(j)
else
dhe=Imps(l)%dh(i+1,j)
end if
if(j==1) then
dhs=Boundatas(l)%dhbcu(i)
else
dhs=Imps(l)%dh(i,j-1)
end if
if(j==Jg(l)) then
dhn=Boundatas(l)%dhbcd(i)
else
dhn=Imps(l)%dh(i,j+1)
end if
dh=omiga*((ahW*dhw+ahE*dhe+ahS*dhs+ahN*dhn+bh)/ahP)+(1-omiga)*dhc
Imps(l)%dh(i,j)=dh
end DO
end DO
end Subroutine Implicitcompute