File: /nfs/home/0/users/jenkins/mfix.git/model/dmp_modules/compar_mod.f

1     !-------------------------------------------------------------------!
2     !                                                                   !
3     ! Purpose:                                                          !
4     !    Variables to be declared for parallel information. Removed     !
5     !    from geometry_mod and put in COMPAR module with some           !
6     !    additional variables used by AEOLUS                            !
7     !                                                                   !
8     ! Added by Ed and Sreekanth on 06/22/99.                            !
9     !-------------------------------------------------------------------!
10     
11           MODULE compar
12     
13     !-----------------------------------------------
14     ! Modules
15     !-----------------------------------------------
16           USE mpi
17     !-----------------------------------------------
18     
19     ! myPE - my processor id (it varies from 0 to nproc-1)
20     ! numPEs - total number of nodes
21           integer :: myPE, numPEs
22     
23     ! mpierr - used by AEOLUS for error checking
24           INTEGER :: mpierr
25     
26     ! specify the rank of the PE to be used for I/O
27           INTEGER :: PE_IO = 0
28     
29     ! nodesi, nodesj and nodesk represent the number of nodes
30     ! in i, j, k directions respectively.
31     ! nodesj = 1 (No decomposition along j-direction)
32     ! For 1-D decomposition, nodesk = nproc for a 3d problem and
33     ! nodesi = nproc for a 2D problem.
34           integer :: nodesi, nodesj, nodesk
35     
36     ! root represents the 'root' processor. For now it is defaulted to
37     ! zero
38           integer :: root
39           data root /0/
40     
41     ! nlayers_bicgs - Number of layers for send_recv in bicgs
42           integer :: nlayers_bicgs = 1
43     
44     
45     ! -istart1_all contains the starting i value for all the processors
46     !  excluding the ghost regions. istart2_all is for one extra ghost
47     !  layer and istart3_all is for two ghost layers. Similarly
48     !  iend1_all, iend2_all and iend3_all contain the ending values.
49     !  Similarly for j and k, jstart..., kstart.... are  prescribed.
50     ! -All the variables without the '_all' represent that processor
51     !  values. So ijkstart3 denotes the starting value of ijk, which
52     !  belongs to the processor = funijk(istart3_all(myid),
53     !  jstart3_all(myid), kstart3_all(myid) for a 1-d decompostion of a
54     !  3D problem. For more details see gridmap_mod.f90. Similarly the
55     !  end values are denoted by ijkend3_all
56     ! -displs has the necessary shift information to position the buffer
57     !  in the scatterv and gatherv routines.
58     ! -ijksize3 is the size of the element owned by each processor plus
59     !  the ghost regions.
60     ! -'_all' has information about all the processor mapping based on
61     !  above convention
62           integer, allocatable,dimension(:) ::  &
63                     ijkstart3_all,ijkend3_all,    &
64                     istart_all,istart1_all,istart2_all,istart3_all, &
65                     jstart_all,jstart1_all,jstart2_all,jstart3_all, &
66                     kstart_all,kstart1_all,kstart2_all,kstart3_all, &
67                     iend_all,iend1_all,iend2_all,iend3_all, &
68                     jend_all,jend1_all,jend2_all,jend3_all, &
69                     kend_all,kend1_all,kend2_all,kend3_all, &
70                     ijksize3_all, displs
71     
72     ! Variables used for mapping i, j, k to ii, jj, kk to take care of
73     ! of cyclic conditions...
74           integer, allocatable,dimension(:) :: imap, jmap, kmap
75           integer, allocatable,dimension(:) :: imap_c, jmap_c, kmap_c
76     
77           integer :: &
78                     ijksize3, ijkstart3,ijkend3, &
79                     istart3, iend3, jstart3, jend3, &
80                     kstart3, kend3, istart2, iend2, jstart2, jend2, &
81                     kstart2, kend2, istart1, iend1, jstart1, jend1, &
82                     kstart1, kend1
83     
84           integer :: istart, iend, jstart, jend, kstart, kend
85     
86     ! Variables used for fourth order methods
87           integer, allocatable,dimension(:) ::  &
88                     ijkstart4_all,ijkend4_all, ijksize4_all,&
89                     istart4_all, jstart4_all, kstart4_all, &
90                     iend4_all, jend4_all, kend4_all
91           integer :: &
92                     istart4, jstart4, kstart4, &
93                     iend4, jend4, kend4, &
94                     ijkstart4,ijkend4,ijksize4
95     
96     ! declaration for storing filebasename, e.g. mfix00000.dat
97           CHARACTER(len=5) :: fbname
98           INTEGER :: idbg = 1
99     
100     ! Funijk coefficients
101           integer :: c0, c1, c2
102     
103     ! Funijk3 coefficients
104           integer :: c0_3, c1_3, c2_3
105     
106     
107     !       Integer Array of IJK values at each (I,J,K) cell
108     
109             integer, allocatable, dimension(:,:,:) :: IJK_ARRAY_OF,FUNIJK_MAP_C
110     
111     !        integer, allocatable, dimension(:,:,:) :: funijk
112     
113     !       Integer Array of neighbor cells
114     
115             integer, allocatable, dimension(:)     :: WEST_ARRAY_OF,EAST_ARRAY_OF
116             integer, allocatable, dimension(:)     :: SOUTH_ARRAY_OF,NORTH_ARRAY_OF
117             integer, allocatable, dimension(:)     :: BOTTOM_ARRAY_OF,TOP_ARRAY_OF
118             integer, allocatable, dimension(:)     :: IM_ARRAY_OF,IP_ARRAY_OF
119             integer, allocatable, dimension(:)     :: JM_ARRAY_OF,JP_ARRAY_OF
120             integer, allocatable, dimension(:)     :: KM_ARRAY_OF,KP_ARRAY_OF
121     
122     !       Flag to identify dead (unused cells)
123     
124             LOGICAL, allocatable, dimension(:,:,:) :: DEAD_CELL_AT
125     
126     !       Flag to know if above neighbor arrays have been allocated
127     
128             LOGICAL :: INCREMENT_ARRAYS_ALLOCATED
129     
130     !       Number of Ghost Cells
131     
132             INTEGER :: NGC_EAST
133             INTEGER :: NGC_WEST
134             INTEGER :: NGC_NORTH
135             INTEGER :: NGC_SOUTH
136             INTEGER :: NGC_TOP
137             INTEGER :: NGC_BOTTOM
138     
139     !       List of Ghost Cells
140     
141             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_EAST
142             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_WEST
143             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_NORTH
144             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_SOUTH
145             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_TOP
146             INTEGER, ALLOCATABLE, DIMENSION(:) ::  LGC_BOTTOM
147     
148     !       Domain size of each processor
149     
150             INTEGER, ALLOCATABLE, DIMENSION(:) :: ISIZE_ALL,JSIZE_ALL,KSIZE_ALL
151     
152             LOGICAL :: DOMAIN_SIZE_ADJUSTED = .FALSE.
153     
154             INTEGER, ALLOCATABLE, DIMENSION(:) :: NCPP_UNIFORM
155     
156             LOGICAL :: NCPP_UNIFORM_BACKED_UP = .FALSE.
157     
158             integer, allocatable,dimension(:) ::  new_ijksize3_all
159     
160     !       Flag to exit gridmap_init after domain size is assigned
161             LOGICAL :: SHORT_GRIDMAP_INIT = .FALSE.
162     
163     
164           END MODULE compar
165     
166