MFIX  2016-1
function3_mod.f
Go to the documentation of this file.
1 MODULE function3
2 
3  USE functions
4 
5  !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
6  !
7  ! Function for generating the LOCAL 3-D array index IJK
8  ! from the 1-D indices I, J, and K.
9  !//FUNIJK is moved to compar for debugging purposes - Sreekanth-10/26/99
10  ! INTEGER FUNIJK3
11  ! Function for generating the LOCAL 3-D array index IJK
12  ! from the 1-D indices I, J, K and IPROC.
13  ! INTEGER FUNIJK3_PROC
14  ! Function for generating the GLOBAL 3-D array index IJK
15  ! from the 1-D indices I, J, and K.
16  ! INTEGER FUNIJK3_GL
17  !
18  ! Function for calculating IMJK
19  ! INTEGER IM3_OF
20  !
21  ! Function for calculating IPJK
22  ! INTEGER IP3_OF
23  !
24  ! Function for calculating IJMK
25  ! INTEGER JM3_OF
26  !
27  ! Function for calculating IJPK
28  ! INTEGER JP3_OF
29  !
30  ! Function for calculating IJKM
31  ! INTEGER KM3_OF
32  !
33  ! Function for calculating IJKP
34  ! INTEGER KP3_OF
35  !
36  ! Logical function to identify a fluid cell
37  ! LOGICAL FLUID3_AT
38  !
39  ! Logical function to identify a cyclic cell
40  ! LOGICAL CYCLIC3_AT
41  !
42  ! DUMMY INDICES
43  ! INTEGER LI3, LJ3, LK3, LIPROC3, IJK3
44  !
45 
46 contains
47 
48  INTEGER FUNCTION funijk3(LI3,LJ3,LK3)
49  USE compar
50  IMPLICIT NONE
51  INTEGER, INTENT(IN) :: LI3,LJ3,LK3
52  funijk3 = lj3 + c0_3 + li3*c1_3 + lk3*c2_3
53  END FUNCTION funijk3
54 
55  INTEGER FUNCTION funijk3_proc(LI3, LJ3, LK3, LIPROC3)
56  USE compar
57  IMPLICIT NONE
58  INTEGER, INTENT(IN) :: LI3,LJ3,LK3,LIPROC3
59  funijk3_proc = 1 + (lj3 - jstart4_all(liproc3))+ &
60  (li3-istart4_all(liproc3))*(jend4_all(liproc3)-jstart4_all(liproc3)+1) &
61  + (lk3-kstart4_all(liproc3))*(jend4_all(liproc3)-jstart4_all(liproc3)+1)* &
62  (iend4_all(liproc3)-istart4_all(liproc3)+1)
63  END FUNCTION funijk3_proc
64 
65  INTEGER FUNCTION funijk3_gl (LI3, LJ3, LK3)
67  IMPLICIT NONE
68  INTEGER, INTENT(IN) :: LI3,LJ3,LK3
69  funijk3_gl = 1 + (lj3 - jmin4) + (li3-imin4)*(jmax4-jmin4+1) &
70  + (lk3-kmin4)*(jmax4-jmin4+1)*(imax4-imin4+1)
71  END FUNCTION funijk3_gl
72 
73  INTEGER FUNCTION im3_of (IJK3)
74  USE indices
75  IMPLICIT NONE
76  INTEGER IJK3
77  im3_of = ijk3 + increment3_for_im(cell_class3(ijk3))
78  END FUNCTION im3_of
79 
80  INTEGER FUNCTION ip3_of (IJK3)
81  USE indices
82  IMPLICIT NONE
83  INTEGER IJK3
84  ip3_of = ijk3 + increment3_for_ip(cell_class3(ijk3))
85  END FUNCTION ip3_of
86 
87  INTEGER FUNCTION jm3_of (IJK3)
88  USE indices
89  IMPLICIT NONE
90  INTEGER IJK3
91  jm3_of = ijk3 + increment3_for_jm(cell_class3(ijk3))
92  END FUNCTION jm3_of
93 
94  INTEGER FUNCTION jp3_of (IJK3)
95  USE indices
96  IMPLICIT NONE
97  INTEGER IJK3
98  jp3_of = ijk3 + increment3_for_jp(cell_class3(ijk3))
99  END FUNCTION jp3_of
100 
101  INTEGER FUNCTION km3_of(IJK3)
103  IMPLICIT NONE
104  INTEGER IJK3
105  km3_of = ijk3 + increment3_for_km(cell_class3(ijk3))
106  END FUNCTION km3_of
107 
108  INTEGER FUNCTION kp3_of (IJK3)
110  IMPLICIT NONE
111  INTEGER IJK3
112  kp3_of = ijk3 + increment3_for_kp(cell_class3(ijk3))
113  END FUNCTION kp3_of
114 
115  LOGICAL FUNCTION fluid3_at(IJK3)
117  IMPLICIT NONE
118  INTEGER IJK3
119  fluid3_at = flag3(ijk3) .EQ. 1
120  END FUNCTION fluid3_at
121 
122  LOGICAL FUNCTION cyclic3_at(IJK3)
124  IMPLICIT NONE
125  INTEGER IJK3
126  cyclic3_at = flag3(ijk3) .EQ. 106 .OR. &
127  flag3(ijk3) .EQ. 107
128  END FUNCTION cyclic3_at
129 
130  INTEGER FUNCTION bound_funijk3(pLI, pLJ, pLK)
132  IMPLICIT NONE
133  INTEGER pLI, pLJ, pLK
134  bound_funijk3 = funijk3( min( iend4, max(istart4, pli) ),&
135  min( jend4, max(jstart4, plj) ),&
136  min( kend4, max(kstart4, plk) ) )
137  END FUNCTION bound_funijk3
138 
139 END MODULE function3
integer kend4
Definition: compar_mod.f:94
integer, dimension(:), allocatable jstart4_all
Definition: compar_mod.f:90
logical function cyclic3_at(IJK3)
integer, dimension(:), allocatable flag3
Definition: geometry_mod.f:101
integer, dimension(max_class) increment3_for_kp
Definition: indices_mod.f:36
integer iend4
Definition: compar_mod.f:94
integer function jm3_of(IJK3)
Definition: function3_mod.f:88
integer istart4
Definition: compar_mod.f:94
integer, dimension(max_class) increment3_for_jm
Definition: indices_mod.f:33
integer kmin4
Definition: geometry_mod.f:94
integer, dimension(:), allocatable istart4_all
Definition: compar_mod.f:90
integer function funijk3_proc(LI3, LJ3, LK3, LIPROC3)
Definition: function3_mod.f:56
integer imax4
Definition: geometry_mod.f:95
integer function km3_of(IJK3)
integer, dimension(max_class) increment3_for_im
Definition: indices_mod.f:31
integer, dimension(:), allocatable cell_class3
Definition: indices_mod.f:55
integer function kp3_of(IJK3)
integer c1_3
Definition: compar_mod.f:107
integer, dimension(:), allocatable kstart4_all
Definition: compar_mod.f:90
integer imin4
Definition: geometry_mod.f:94
integer c0_3
Definition: compar_mod.f:107
integer, dimension(:), allocatable jend4_all
Definition: compar_mod.f:90
integer jend4
Definition: compar_mod.f:94
integer, dimension(max_class) increment3_for_ip
Definition: indices_mod.f:32
integer jstart4
Definition: compar_mod.f:94
integer, dimension(max_class) increment3_for_km
Definition: indices_mod.f:35
integer, dimension(max_class) increment3_for_jp
Definition: indices_mod.f:34
integer c2_3
Definition: compar_mod.f:107
integer function jp3_of(IJK3)
Definition: function3_mod.f:95
integer jmin4
Definition: geometry_mod.f:94
integer kstart4
Definition: compar_mod.f:94
integer function bound_funijk3(pLI, pLJ, pLK)
integer function funijk3_gl(LI3, LJ3, LK3)
Definition: function3_mod.f:66
integer, dimension(:), allocatable iend4_all
Definition: compar_mod.f:90
logical function fluid3_at(IJK3)
integer function ip3_of(IJK3)
Definition: function3_mod.f:81
integer function funijk3(LI3, LJ3, LK3)
Definition: function3_mod.f:49
integer jmax4
Definition: geometry_mod.f:95
integer function im3_of(IJK3)
Definition: function3_mod.f:74