File: N:\mfix\model\dmp_modules\compar_mod.f

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(:) ::  &
66                     ijkstart3_all,ijkend3_all,    &
67                     istart_all,istart1_all,istart2_all,istart3_all, &
68                     jstart_all,jstart1_all,jstart2_all,jstart3_all, &
69                     kstart_all,kstart1_all,kstart2_all,kstart3_all, &
70                     iend_all,iend1_all,iend2_all,iend3_all, &
71                     jend_all,jend1_all,jend2_all,jend3_all, &
72                     kend_all,kend1_all,kend2_all,kend3_all, &
73                     ijksize3_all, displs
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 :: &
81                     ijksize3, ijkstart3,ijkend3, &
82                     istart3, iend3, jstart3, jend3, &
83                     kstart3, kend3, istart2, iend2, jstart2, jend2, &
84                     kstart2, kend2, istart1, iend1, jstart1, jend1, &
85                     kstart1, kend1
86     
87           integer :: istart, iend, jstart, jend, kstart, kend
88     
89     ! Variables used for fourth order methods
90           integer, allocatable,dimension(:) ::  &
91                     ijkstart4_all,ijkend4_all, ijksize4_all,&
92                     istart4_all, jstart4_all, kstart4_all, &
93                     iend4_all, jend4_all, kend4_all
94           integer :: &
95                     istart4, jstart4, kstart4, &
96                     iend4, jend4, kend4, &
97                     ijkstart4,ijkend4,ijksize4
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     
131             LOGICAL :: INCREMENT_ARRAYS_ALLOCATED
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     
169