-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModTGfilter.f90
executable file
·98 lines (57 loc) · 1.79 KB
/
ModTGfilter.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
MODULE ModTGfilter
CONTAINS
SUBROUTINE PerformTGfilter(var,dirn,out,op_flag)
USE ModuleVariables
IMPLICIT NONE
REAL(KIND=8) :: var(-3:Nz+4,-3:Nr+4,1), out(-3:Nz+4,-3:Nr+4,1)
INTEGER :: dirn
CHARACTER(LEN=8), OPTIONAL :: op_flag
!out = 0.0D0
IF(dirn .eq. 1)THEN
DO i = 1, Nz
DO j = 1, Nr
DO k = 1, 1
IF(ibval(i,j,k) .eq. 0)CYCLE
IF(is_it_i_patch(i,j,k) .eq. 1)THEN
patch_no = which_i_patch(i,j,k)
IF(patch(patch_no)%bc_dir .eq. 1)THEN
i_start = patch(patch_no)%i_start
SBP_row = i - i_start
out(i,j,k) = DOT_PRODUCT( TGfilt(SBP_row,0:10),var(i_start:i_start+10,j,k) )
ELSEIF(patch(patch_no)%bc_dir .eq. -1)THEN
i_end = patch(patch_no)%i_end
SBP_row = 8 + i - i_end
out(i,j,k) = DOT_PRODUCT( TGfilt(SBP_row,0:10),var(i_end-10:i_end,j,k) )
ENDIF
ELSE
out(i,j,k) = DOT_PRODUCT( TGfilt(4,0:8),var(i-4:i+4,j,k) )
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF
IF(dirn .eq. 2)THEN
DO i = 1, Nz
DO j = 1, Nr
DO k = 1, 1
IF(ibval(i,j,k) .eq. 0)CYCLE
IF(is_it_j_patch(i,j,k) .eq. 1)THEN
patch_no = which_j_patch(i,j,k)
IF(patch(patch_no)%bc_dir .eq. 2)THEN
j_start = patch(patch_no)%j_start
SBP_row = j - j_start
out(i,j,k) = DOT_PRODUCT( TGfilt(SBP_row,0:10),var(i,j_start:j_start+10,k) )
ELSEIF(patch(patch_no)%bc_dir .eq. -2)THEN
j_end = patch(patch_no)%j_end
SBP_row = 8 + j - j_end
out(i,j,k) = DOT_PRODUCT( TGfilt(SBP_row,0:10),var(i,j_end-10:j_end,k) )
ENDIF
ELSE
out(i,j,k) = DOT_PRODUCT( TGfilt(4,0:8),var(i,j-4:j+4,k) )
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF
END SUBROUTINE PerformTGfilter
END MODULE ModTGfilter