Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_CECellsWrapper.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: wrapper for corner and edge Cells update step in PLAG module.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all regions,
30 !
31 ! Output: regions%levels%plag = solution in corner and edge cells
32 ! after one RK stage.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PLAG_CECellsWrapper.F90,v 1.3 2008/12/06 08:44:33 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE plag_cecellswrapper( regions )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modmpi
51  USE modparameters
56 
57  IMPLICIT NONE
58 
59 ! ... parameters
60  TYPE(t_region), POINTER :: regions(:)
61 
62 ! ... loop variables
63  INTEGER :: ireg
64 
65 ! ... local variables
66  CHARACTER(CHRLEN) :: rcsidentstring
67 
68  TYPE(t_global), POINTER :: global
69 
70 !******************************************************************************
71 
72  rcsidentstring = '$RCSfile: PLAG_CECellsWrapper.F90,v $ $Revision: 1.3 $'
73 
74  global => regions(1)%global
75 
76  CALL registerfunction( global,'PLAG_CECellsWrapper',&
77  'PLAG_CECellsWrapper.F90' )
78 
79 ! check if module is active in any region======================================
80 
81  IF (.NOT. global%plagUsed) goto 999
82 
83 ! Load buffer data for on-processor regions -----------------------------------
84 
85  DO ireg=1,global%nRegions
86  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
87  regions(ireg)%active==active ) THEN ! on my processor
88 
89 #ifdef PLAG_CECELLS_DEBUG
90  WRITE(*,*) '----------------------------------------------------'
91  WRITE(*,*) 'Entering PLAG_CECellsGetBufferSize : iReg=',ireg
92 #endif
93  CALL plag_cecellsgetbuffersize( regions(ireg), ireg )
94 
95 #ifdef PLAG_CECELLS_DEBUG
96  WRITE(*,*) '----------------------------------------------------'
97  WRITE(*,*) 'Entering PLAG_CECellsLoadDataWrapper: iReg=',ireg
98 #endif
99  CALL plag_cecellsloaddatawrapper( regions , ireg )
100  ENDIF ! regions
101 
102  ENDDO ! iReg
103 
104 ! Exchange buffer for on-processor regions ------------------------------------
105 
106  DO ireg=1,global%nRegions
107  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
108  regions(ireg)%active==active ) THEN ! on my processor
109 
110 #ifdef PLAG_CECELLS_DEBUG
111  WRITE(*,*) '----------------------------------------------------'
112  WRITE(*,*) 'Entering PLAG_CECellsExchange: iReg=',ireg
113 #endif
114  CALL plag_cecellsexchange( regions, ireg )
115 
116  ENDIF ! regions
117 
118  ENDDO ! iReg
119 
120 ! ******************************************************************************
121 ! Synchronize through an MPI barrier
122 ! ******************************************************************************
123 
124 #ifdef MPI
125  CALL mpi_barrier( global%mpiComm,global%mpierr )
126  IF ( global%mpierr /= err_none ) &
127  CALL errorstop( global,err_mpi_trouble,__line__ )
128 #endif
129 
130 ! Communicate buffer data for off-processor regions ---------------------------
131 
132  CALL plag_cecellssendrecvwrapper( regions )
133 
134 ! finalize ====================================================================
135 
136 999 CONTINUE
137  CALL deregisterfunction( global )
138 
139 END SUBROUTINE plag_cecellswrapper
140 
141 !******************************************************************************
142 !
143 ! RCS Revision history:
144 !
145 ! $Log: PLAG_CECellsWrapper.F90,v $
146 ! Revision 1.3 2008/12/06 08:44:33 mtcampbe
147 ! Updated license.
148 !
149 ! Revision 1.2 2008/11/19 22:17:45 mtcampbe
150 ! Added Illinois Open Source License/Copyright
151 !
152 ! Revision 1.1 2004/12/01 20:57:21 fnajjar
153 ! Initial revision after changing case
154 !
155 ! Revision 1.4 2004/03/10 23:14:04 fnajjar
156 ! Cleaned dead sections and included call for MPI-based corner-edge cells wrapper
157 !
158 ! Revision 1.3 2004/03/05 22:09:03 jferry
159 ! created global variables for peul, plag, and inrt use
160 !
161 ! Revision 1.2 2004/01/26 22:54:43 fnajjar
162 ! Included new wrapper for load data, PLAG_cECellsLoadDataWrapper
163 !
164 ! Revision 1.1 2003/11/12 21:37:59 fnajjar
165 ! Initial import of Corner-Edge cells Infrastructure
166 !
167 !******************************************************************************
168 
169 
170 
171 
172 
173 
174 
subroutine plag_cecellsloaddatawrapper(regions, iReg)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_cecellsexchange(regions, iReg)
subroutine plag_cecellsgetbuffersize(region, iReg)
subroutine plag_cecellssendrecvwrapper(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine plag_cecellswrapper(regions)