Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_CECellsClearRequestsSize.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: wait until data is received by other processors
26 ! communicating with the current region adjacent to regions with
27 ! corner or edge cells.
28 !
29 ! Description: none.
30 !
31 ! Input:
32 ! regions = data of all regions
33 ! iReg = index of current region.
34 !
35 ! Output: None.
36 !
37 ! Notes: None.
38 !
39 !******************************************************************************
40 !
41 ! $Id: PLAG_CECellsClearRequestsSize.F90,v 1.3 2008/12/06 08:44:32 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2004 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 SUBROUTINE plag_cecellsclearrequestssize( regions, iReg )
48 
49  USE moddatatypes
50  USE moderror
51  USE modmpi
52  USE modparameters
53  USE modglobal, ONLY : t_global
54  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
55 
56  USE modpartlag, ONLY : t_plag
57 
58  IMPLICIT NONE
59 
60 ! ******************************************************************************
61 ! Definitions and declarations
62 ! ******************************************************************************
63 
64 ! ==============================================================================
65 ! Arguments
66 ! ==============================================================================
67 
68  TYPE(t_region), POINTER :: regions(:)
69 
70  INTEGER, INTENT(IN) :: ireg
71 
72 ! ==============================================================================
73 ! Locals
74 ! ==============================================================================
75 
76  CHARACTER(CHRLEN) :: rcsidentstring
77 
78 #ifdef MPI
79  INTEGER :: statusplag(mpi_status_size)
80 #endif
81  INTEGER :: ilev,ir,irequestplag
82 
83  LOGICAL :: dowait
84 
85  TYPE(t_global), POINTER :: global
86  TYPE(t_level), POINTER :: plevel
87  TYPE(t_plag), POINTER :: pplag
88  TYPE(t_region), POINTER :: pregion
89 
90 ! ******************************************************************************
91 ! Start
92 ! ******************************************************************************
93 
94  rcsidentstring = '$RCSfile: PLAG_CECellsClearRequestsSize.F90,v $ $Revision: 1.3 $'
95 
96  global => regions(1)%global
97 
98  CALL registerfunction( global,'PLAG_CECellsClearRequestsSize',&
99  'PLAG_CECellsClearRequestsSize.F90' )
100 
101 #ifdef MPI
102 
103 ! ******************************************************************************
104 ! Get dimensions
105 ! ******************************************************************************
106 
107  ilev = regions(ireg)%currLevel
108 
109 ! ******************************************************************************
110 ! Set pointers
111 ! ******************************************************************************
112 
113  pregion => regions(ireg)
114  plevel => regions(ireg)%levels(ilev)
115  pplag => plevel%plag
116 
117 ! ******************************************************************************
118 ! Wait for edges & corners being received by other processors
119 ! ******************************************************************************
120 
121  DO ir=1,global%nRegions
122  IF (regions(ireg)%levels(ilev)%sendEcCells(ir)%nCells > 0) THEN
123  irequestplag = plevel%sendEcCells(ir)%iRequestPlag
124  CALL mpi_wait( pplag%requestsCECells(irequestplag),statusplag, &
125  global%mpierr )
126  IF (global%mpierr /= err_none) &
127  CALL errorstop( global,err_mpi_trouble,__line__ )
128  ENDIF ! nCells
129  ENDDO ! ir
130 #endif
131 
132 ! ******************************************************************************
133 ! Finalize
134 ! ******************************************************************************
135 
136  CALL deregisterfunction( global )
137 
138 END SUBROUTINE plag_cecellsclearrequestssize
139 
140 !******************************************************************************
141 !
142 ! RCS Revision history:
143 !
144 ! $Log: PLAG_CECellsClearRequestsSize.F90,v $
145 ! Revision 1.3 2008/12/06 08:44:32 mtcampbe
146 ! Updated license.
147 !
148 ! Revision 1.2 2008/11/19 22:17:45 mtcampbe
149 ! Added Illinois Open Source License/Copyright
150 !
151 ! Revision 1.1 2004/12/01 20:57:07 fnajjar
152 ! Initial revision after changing case
153 !
154 ! Revision 1.1 2004/03/10 23:16:09 fnajjar
155 ! Initial import of routines to MPI-communicate buffer sizes
156 !
157 !******************************************************************************
158 
159 
160 
161 
162 
163 
164 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_cecellsclearrequestssize(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469