-
Notifications
You must be signed in to change notification settings - Fork 1
/
forc3.f90
executable file
·75 lines (56 loc) · 1.47 KB
/
forc3.f90
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
subroutine forc3(ntr,inp,ptxAB,Vel)
USE param
USE mls_param
USE local_arrays, only: vz
USE mpi_param, only: kstart, kend
USE mls_local, only: for_zc
use mpih, only: myid
implicit none
real,dimension(nel) :: ui
real,dimension(nel) :: ptxAB(nel)
integer :: inp,ntr,inw,i,j,k
real Um, Vel
integer, dimension(3) :: pind_i, pind_o
real for
integer :: ii,jj,kk
integer :: kstartp
if (kstart.eq.1) then
kstartp = 2
else
kstartp = kstart
endif
!if (pind(6,ntr,inp).ge.kstartp .and. pind(6,ntr,inp).le.kend) then
if (pind(6,ntr,inp).ge.kstart .and. pind(6,ntr,inp).le.kend) then
pind_i(1)=pind(1,ntr,inp)-1; pind_o(1)=pind(1,ntr,inp)+1
pind_i(2)=pind(2,ntr,inp)-1; pind_o(2)=pind(2,ntr,inp)+1
pind_i(3)=pind(6,ntr,inp)-1; pind_o(3)=pind(6,ntr,inp)+1
inw = 1
Um = 0.
! spline weights for all three components
do k=pind_i(3), pind_o(3)
! kk = modulo(k-1,n3m) + 1 !
do j=pind_i(2), pind_o(2)
jj = modulo(j-1,n2m) + 1
do i=pind_i(1), pind_o(1)
ii = modulo(i-1,n1m) + 1
Um = Um + vz(ii,jj,k)*ptxAB(inw)
inw = inw + 1
enddo
enddo
enddo
! =========
! forcing
inw = 1
do k=pind_i(3), pind_o(3)
! kk = modulo(k-1,n3m) + 1 !
do j=pind_i(2), pind_o(2)
jj = modulo(j-1,n2m) + 1
do i=pind_i(1), pind_o(1)
ii = modulo(i-1,n1m) + 1
for_zc(ii,jj,k) = for_zc(ii,jj,k) + cfac(ntr,inp) * (Vel-Um) * ptxAB(inw)
inw = inw +1
enddo
enddo
enddo
endif
end