MFIX  2016-1
compar_mod.f
Go to the documentation of this file.
1 ! -*- f90 -*-
2 !-------------------------------------------------------------------!
3 ! !
4 ! Purpose: !
5 ! Variables to be declared for parallel information. Removed !
6 ! from geometry_mod and put in COMPAR module with some !
7 ! additional variables used by AEOLUS !
8 ! !
9 ! Added by Ed and Sreekanth on 06/22/99. !
10 !-------------------------------------------------------------------!
11 
12  MODULE compar
13 
14 !-----------------------------------------------
15 ! Modules
16 !-----------------------------------------------
17 #ifdef MPI
18  USE mpi ! ignore-depcomp
19 #endif
20 !-----------------------------------------------
21 
22 ! myPE - my processor id (it varies from 0 to nproc-1)
23 ! numPEs - total number of nodes
24  integer :: mype, numpes
25 
26 ! mpierr - used by AEOLUS for error checking
27  INTEGER :: mpierr
28 
29 ! specify the rank of the PE to be used for I/O
30  INTEGER :: pe_io = 0
31 
32 ! nodesi, nodesj and nodesk represent the number of nodes
33 ! in i, j, k directions respectively.
34 ! nodesj = 1 (No decomposition along j-direction)
35 ! For 1-D decomposition, nodesk = nproc for a 3d problem and
36 ! nodesi = nproc for a 2D problem.
37  integer :: nodesi, nodesj, nodesk
38 
39 ! root represents the 'root' processor. For now it is defaulted to
40 ! zero
41  integer :: root
42  data root /0/
43 
44 ! nlayers_bicgs - Number of layers for send_recv in bicgs
45  integer :: nlayers_bicgs = 1
46 
47 
48 ! -istart1_all contains the starting i value for all the processors
49 ! excluding the ghost regions. istart2_all is for one extra ghost
50 ! layer and istart3_all is for two ghost layers. Similarly
51 ! iend1_all, iend2_all and iend3_all contain the ending values.
52 ! Similarly for j and k, jstart..., kstart.... are prescribed.
53 ! -All the variables without the '_all' represent that processor
54 ! values. So ijkstart3 denotes the starting value of ijk, which
55 ! belongs to the processor = funijk(istart3_all(myid),
56 ! jstart3_all(myid), kstart3_all(myid) for a 1-d decompostion of a
57 ! 3D problem. For more details see gridmap_mod.f90. Similarly the
58 ! end values are denoted by ijkend3_all
59 ! -displs has the necessary shift information to position the buffer
60 ! in the scatterv and gatherv routines.
61 ! -ijksize3 is the size of the element owned by each processor plus
62 ! the ghost regions.
63 ! -'_all' has information about all the processor mapping based on
64 ! above convention
65  integer, allocatable,dimension(:) :: &
74 
75 ! Variables used for mapping i, j, k to ii, jj, kk to take care of
76 ! of cyclic conditions...
77  integer, allocatable,dimension(:) :: imap, jmap, kmap
78  integer, allocatable,dimension(:) :: imap_c, jmap_c, kmap_c
79 
80  integer :: &
85  kstart1, kend1
86 
87  integer :: istart, iend, jstart, jend, kstart, kend
88 
89 ! Variables used for fourth order methods
90  integer, allocatable,dimension(:) :: &
94  integer :: &
96  iend4, jend4, kend4, &
98 
99 ! declaration for storing filebasename, e.g. mfix00000.dat
100  CHARACTER(len=5) :: fbname
101  INTEGER :: idbg = 1
102 
103 ! Funijk coefficients
104  integer :: c0, c1, c2
105 
106 ! Funijk3 coefficients
107  integer :: c0_3, c1_3, c2_3
108 
109 
110 ! Integer Array of IJK values at each (I,J,K) cell
111 
112  integer, allocatable, dimension(:,:,:) :: ijk_array_of,funijk_map_c
113 
114 ! integer, allocatable, dimension(:,:,:) :: funijk
115 
116 ! Integer Array of neighbor cells
117 
118  integer, allocatable, dimension(:) :: west_array_of,east_array_of
119  integer, allocatable, dimension(:) :: south_array_of,north_array_of
120  integer, allocatable, dimension(:) :: bottom_array_of,top_array_of
121  integer, allocatable, dimension(:) :: im_array_of,ip_array_of
122  integer, allocatable, dimension(:) :: jm_array_of,jp_array_of
123  integer, allocatable, dimension(:) :: km_array_of,kp_array_of
124 
125 ! Flag to identify dead (unused cells)
126 
127  LOGICAL, allocatable, dimension(:,:,:) :: dead_cell_at
128 
129 ! Flag to know if above neighbor arrays have been allocated
130 
132 
133 ! Number of Ghost Cells
134 
135  INTEGER :: ngc_east
136  INTEGER :: ngc_west
137  INTEGER :: ngc_north
138  INTEGER :: ngc_south
139  INTEGER :: ngc_top
140  INTEGER :: ngc_bottom
141 
142 ! List of Ghost Cells
143 
144  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_east
145  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_west
146  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_north
147  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_south
148  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_top
149  INTEGER, ALLOCATABLE, DIMENSION(:) :: lgc_bottom
150 
151 ! Domain size of each processor
152 
153  INTEGER, ALLOCATABLE, DIMENSION(:) :: isize_all,jsize_all,ksize_all
154 
155  LOGICAL :: domain_size_adjusted = .false.
156 
157  INTEGER, ALLOCATABLE, DIMENSION(:) :: ncpp_uniform
158 
159  LOGICAL :: ncpp_uniform_backed_up = .false.
160 
161  integer, allocatable,dimension(:) :: new_ijksize3_all
162 
163 ! Flag to exit gridmap_init after domain size is assigned
164  LOGICAL :: short_gridmap_init = .false.
165 
166 
167  END MODULE compar
168 
integer, dimension(:), allocatable istart1_all
Definition: compar_mod.f:65
integer jend2
Definition: compar_mod.f:80
integer, dimension(:), allocatable imap
Definition: compar_mod.f:77
integer, dimension(:), allocatable jmap_c
Definition: compar_mod.f:78
integer iend3
Definition: compar_mod.f:80
integer, dimension(:), allocatable kstart1_all
Definition: compar_mod.f:65
integer, dimension(:,:,:), allocatable ijk_array_of
Definition: compar_mod.f:112
integer ngc_north
Definition: compar_mod.f:137
character(len=5) fbname
Definition: compar_mod.f:100
integer, dimension(:), allocatable kmap_c
Definition: compar_mod.f:78
integer nlayers_bicgs
Definition: compar_mod.f:45
integer c0
Definition: compar_mod.f:104
integer jstart3
Definition: compar_mod.f:80
integer ijkend3
Definition: compar_mod.f:80
integer kend1
Definition: compar_mod.f:80
integer ngc_west
Definition: compar_mod.f:136
integer istart1
Definition: compar_mod.f:80
integer kend4
Definition: compar_mod.f:94
integer, dimension(:), allocatable jstart4_all
Definition: compar_mod.f:90
integer, dimension(:), allocatable kend4_all
Definition: compar_mod.f:90
integer, dimension(:), allocatable kend1_all
Definition: compar_mod.f:65
integer iend1
Definition: compar_mod.f:80
integer, dimension(:), allocatable istart2_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable km_array_of
Definition: compar_mod.f:123
integer iend
Definition: compar_mod.f:87
integer ngc_bottom
Definition: compar_mod.f:140
logical short_gridmap_init
Definition: compar_mod.f:164
integer ijksize3
Definition: compar_mod.f:80
integer iend4
Definition: compar_mod.f:94
integer, dimension(:), allocatable kstart2_all
Definition: compar_mod.f:65
integer ijkstart4
Definition: compar_mod.f:94
logical ncpp_uniform_backed_up
Definition: compar_mod.f:159
integer ijkend4
Definition: compar_mod.f:94
integer istart2
Definition: compar_mod.f:80
integer istart4
Definition: compar_mod.f:94
integer, dimension(:), allocatable iend3_all
Definition: compar_mod.f:65
integer iend2
Definition: compar_mod.f:80
integer, dimension(:), allocatable istart4_all
Definition: compar_mod.f:90
integer kstart3
Definition: compar_mod.f:80
integer, dimension(:), allocatable ijksize4_all
Definition: compar_mod.f:90
integer, dimension(:), allocatable istart_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable bottom_array_of
Definition: compar_mod.f:120
logical increment_arrays_allocated
Definition: compar_mod.f:131
integer mpierr
Definition: compar_mod.f:27
integer kend2
Definition: compar_mod.f:80
integer ijksize4
Definition: compar_mod.f:94
integer kstart2
Definition: compar_mod.f:80
integer kstart
Definition: compar_mod.f:87
integer kstart1
Definition: compar_mod.f:80
integer kend3
Definition: compar_mod.f:80
integer numpes
Definition: compar_mod.f:24
integer, dimension(:), allocatable im_array_of
Definition: compar_mod.f:121
integer pe_io
Definition: compar_mod.f:30
integer c1_3
Definition: compar_mod.f:107
integer, dimension(:), allocatable lgc_north
Definition: compar_mod.f:146
integer, dimension(:), allocatable ijkstart4_all
Definition: compar_mod.f:90
integer c2
Definition: compar_mod.f:104
integer, dimension(:), allocatable kstart4_all
Definition: compar_mod.f:90
integer, dimension(:), allocatable jend_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable kstart3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable istart3_all
Definition: compar_mod.f:65
logical, dimension(:,:,:), allocatable dead_cell_at
Definition: compar_mod.f:127
integer, dimension(:), allocatable lgc_east
Definition: compar_mod.f:144
integer c0_3
Definition: compar_mod.f:107
integer, dimension(:), allocatable jend2_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable ijkend3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable jend4_all
Definition: compar_mod.f:90
integer jend3
Definition: compar_mod.f:80
integer root
Definition: compar_mod.f:41
integer jstart2
Definition: compar_mod.f:80
integer, dimension(:), allocatable iend2_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable west_array_of
Definition: compar_mod.f:118
integer, dimension(:), allocatable jstart3_all
Definition: compar_mod.f:65
integer ngc_south
Definition: compar_mod.f:138
integer jend4
Definition: compar_mod.f:94
integer, dimension(:), allocatable jstart_all
Definition: compar_mod.f:65
integer ngc_top
Definition: compar_mod.f:139
integer jstart4
Definition: compar_mod.f:94
integer, dimension(:), allocatable new_ijksize3_all
Definition: compar_mod.f:161
integer, dimension(:), allocatable kend2_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable lgc_south
Definition: compar_mod.f:147
integer, dimension(:), allocatable imap_c
Definition: compar_mod.f:78
integer, dimension(:), allocatable jsize_all
Definition: compar_mod.f:153
integer c2_3
Definition: compar_mod.f:107
integer kend
Definition: compar_mod.f:87
integer, dimension(:), allocatable jstart1_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable lgc_top
Definition: compar_mod.f:148
integer, dimension(:), allocatable south_array_of
Definition: compar_mod.f:119
integer kstart4
Definition: compar_mod.f:94
integer, dimension(:), allocatable kend3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable isize_all
Definition: compar_mod.f:153
integer jstart
Definition: compar_mod.f:87
integer mype
Definition: compar_mod.f:24
integer nodesj
Definition: compar_mod.f:37
logical domain_size_adjusted
Definition: compar_mod.f:155
integer ijkstart3
Definition: compar_mod.f:80
integer, dimension(:), allocatable jend3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable jend1_all
Definition: compar_mod.f:65
integer nodesk
Definition: compar_mod.f:37
integer istart
Definition: compar_mod.f:87
integer jend
Definition: compar_mod.f:87
integer idbg
Definition: compar_mod.f:101
integer, dimension(:), allocatable iend_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable jmap
Definition: compar_mod.f:77
integer, dimension(:), allocatable ijkend4_all
Definition: compar_mod.f:90
integer nodesi
Definition: compar_mod.f:37
integer, dimension(:), allocatable iend4_all
Definition: compar_mod.f:90
integer, dimension(:), allocatable displs
Definition: compar_mod.f:65
integer, dimension(:), allocatable lgc_bottom
Definition: compar_mod.f:149
integer ngc_east
Definition: compar_mod.f:135
integer, dimension(:), allocatable kstart_all
Definition: compar_mod.f:65
integer istart3
Definition: compar_mod.f:80
integer, dimension(:), allocatable jm_array_of
Definition: compar_mod.f:122
integer, dimension(:), allocatable ijksize3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable jstart2_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable lgc_west
Definition: compar_mod.f:145
integer, dimension(:), allocatable ijkstart3_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable kend_all
Definition: compar_mod.f:65
integer, dimension(:), allocatable ncpp_uniform
Definition: compar_mod.f:157
integer, dimension(:), allocatable kmap
Definition: compar_mod.f:77
integer, dimension(:), allocatable iend1_all
Definition: compar_mod.f:65
integer c1
Definition: compar_mod.f:104
integer jend1
Definition: compar_mod.f:80
integer jstart1
Definition: compar_mod.f:80