Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_floFlimRecvCornEdgeCells.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: receives values for edge and corner cells from an adjacent
26 ! region.
27 !
28 ! Description: this is for the case if the other region is located
29 ! on a different processor.
30 !
31 ! Input: regions = data of all regions
32 ! iReg = current region.
33 !
34 ! Output: new values of FLD radiation variables.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RADI_floFlimRecvCornEdgeCells.F90,v 1.3 2008/12/06 08:44:38 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE radi_floflimrecvcornedgecells( regions,iReg )
47 
48  USE moddatatypes
49  USE modglobal, ONLY : t_global
50  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
53  USE moderror
54  USE modmpi
55  USE modparameters
57  IMPLICIT NONE
58 
59 #include "Indexing.h"
60 
61 ! ... parameters
62  TYPE(t_region), POINTER :: regions(:)
63 
64  INTEGER :: ireg
65 
66 ! ... loop variables
67  INTEGER :: ir, iedge, icorner, i, j, k, l, ijk
68 
69 ! ... local variables
70 #ifdef MPI
71  INTEGER :: status(mpi_status_size)
72 #endif
73  INTEGER :: ilev, ncv, iregsrc, ibuff, ndim, source, tag
74  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, icoff, ijcoff, ijkc
75 
76  REAL(RFREAL), POINTER :: rcv(:,:)
77 
78  TYPE(t_global), POINTER :: global
79  TYPE(t_level), POINTER :: level
80  TYPE(t_dcelltransf), POINTER :: rcvradieccell
81 
82 !******************************************************************************
83 
84  global => regions(ireg)%global
85 
86  CALL registerfunction( global,'RADI_FloFlimRecvCornEdgeCells',&
87  'RADI_floFlimRecvCornEdgeCells.F90' )
88 
89  ilev = regions(ireg)%currLevel
90  ncv = regions(ireg)%radiInput%nCv
91 
92  level => regions(ireg)%levels(ilev)
93  rcv => level%radi%cv
94 
95  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
96 
97 ! copy data from buffer to dummy cells
98 
99  DO ir=1,global%nRegions
100  IF (regions(ir)%procid /= global%myProcid) THEN
101  IF (level%rcvRadiEcCells(ir)%nCells > 0) THEN
102 
103  rcvradieccell => level%rcvRadiEcCells(ir)
104  ndim = rcvradieccell%nCells
105  ibuff = 0
106 
107 #ifdef MPI
108  source = regions(ir)%procid
109  tag = regions(ireg)%localNumber + radi_tag_shift
110  CALL mpi_recv( rcvradieccell%buff,ncv*ndim,mpi_rfreal, &
111  source,tag,global%mpiComm,status,global%mpierr )
112  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
113 #endif
114 
115 ! --- edges
116 
117  DO iedge=1,12
118  IF (level%edgeCells(iedge)%interact) THEN
119  CALL rflo_getedgecellsindices( regions(ireg),ilev,iedge, &
120  ibeg,iend,jbeg,jend,kbeg,kend )
121 
122  ijk = 0
123  DO k=kbeg,kend
124  DO j=jbeg,jend
125  DO i=ibeg,iend
126  ijk = ijk + 1
127  ijkc = indijk(i,j,k,icoff,ijcoff)
128  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
129  IF (iregsrc == ir) THEN
130  ibuff = ibuff + 1
131  IF (level%edgeCells(iedge)%cells(ijk)%rotate) THEN
132  ! rotational periodicity
133  ELSE
134  DO l=1,ncv
135  rcv(l,ijkc) = rcvradieccell%buff(ibuff+(l-1)*ndim)
136  ENDDO
137  ENDIF
138  ENDIF
139  ENDDO
140  ENDDO
141  ENDDO
142 
143  ENDIF ! interact
144  ENDDO ! iedge
145 
146 ! --- corners (currently not participating)
147 
148 ! DO icorner=1,8
149 ! IF (level%cornerCells(icorner)%interact) THEN
150 ! CALL RFLO_GetCornerCellsIndices( regions(iReg),iLev,icorner, &
151 ! ibeg,iend,jbeg,jend,kbeg,kend )
152 
153 ! ijk = 0
154 ! DO k=kbeg,kend
155 ! DO j=jbeg,jend
156 ! DO i=ibeg,iend
157 ! ijk = ijk + 1
158 ! ijkC = IndIJK(i,j,k,iCOff,ijCOff)
159 ! iRegSrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
160 ! IF (iRegSrc == ir) THEN
161 ! ibuff = ibuff + 1
162 ! IF (level%cornerCells(icorner)%cells(ijk)%rotate) THEN
163 ! ! rotational periodicity
164 ! ELSE
165 ! DO l=1,nCv
166 ! rcv(l,ijkC) = rcvRadiEcCell%buff(ibuff+(l-1)*nDim)
167 ! ENDDO
168 ! ENDIF
169 ! ENDIF
170 ! ENDDO
171 ! ENDDO
172 ! ENDDO
173 
174 ! ENDIF ! interact
175 ! ENDDO ! icorner
176 
177  ENDIF ! some cells to receive
178  ENDIF ! not my processor
179  ENDDO ! ir
180 
181 ! finalize
182 
183  CALL deregisterfunction( global )
184 
185 END SUBROUTINE radi_floflimrecvcornedgecells
186 
187 !******************************************************************************
188 !
189 ! RCS Revision history:
190 !
191 ! $Log: RADI_floFlimRecvCornEdgeCells.F90,v $
192 ! Revision 1.3 2008/12/06 08:44:38 mtcampbe
193 ! Updated license.
194 !
195 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
196 ! Added Illinois Open Source License/Copyright
197 !
198 ! Revision 1.1 2004/09/30 17:49:10 wasistho
199 ! prepared for full FLD radiation model
200 !
201 !
202 !
203 !******************************************************************************
204 
205 
206 
207 
208 
209 
210 
subroutine rflo_getedgecellsindices(region, iLev, iedge, iebeg, ieend, jebeg, jeend, kebeg, keend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ibeg
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
j indices j
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jend
CGAL::Point_2< R > source() const
Definition: Ray_2.h:128
subroutine radi_floflimrecvcornedgecells(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469