Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_floFlimSendCornEdgeCells.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: send values to edge and corner cells of an adjacent region.
26 !
27 ! Description: this is for the case if the other region is located
28 ! on a different processor.
29 !
30 ! Input: regions = data of all regions
31 ! iReg = current region.
32 !
33 ! Output: new values of FLD radiation variables.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RADI_floFlimSendCornEdgeCells.F90,v 1.3 2008/12/06 08:44:38 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE radi_floflimsendcornedgecells( regions,iReg )
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49  USE moddatastruct, ONLY : t_region, t_level, t_dcelltransf
50  USE moderror
51  USE modmpi
52  USE modparameters
54  IMPLICIT NONE
55 
56 ! ... parameters
57  TYPE(t_region), POINTER :: regions(:)
58 
59  INTEGER :: ireg
60 
61 ! ... loop variables
62  INTEGER :: ir, iedge, icorner, ijk, l
63 
64 ! ... local variables
65  INTEGER :: ilev, ncv, iregsrc, icell, ibuff, ndim, dest, tag
66 
67  REAL(RFREAL), POINTER :: rcv(:,:)
68 
69  TYPE(t_global), POINTER :: global
70  TYPE(t_level), POINTER :: level
71  TYPE(t_dcelltransf), POINTER :: sndradieccell
72 
73 !******************************************************************************
74 
75  global => regions(ireg)%global
76 
77  CALL registerfunction( global,'RADI_FloFlimSendCornEdgeCells',&
78  'RADI_floFlimSendCornEdgeCells.F90' )
79 
80  ilev = regions(ireg)%currLevel
81  ncv = regions(ireg)%radiInput%nCv
82  rcv => regions(ireg)%levels(ilev)%radi%cv
83 
84 ! fill send buffers
85 
86  DO ir=1,global%nRegions
87  IF (regions(ir)%procid /= global%myProcid) THEN
88  IF (regions(ireg)%levels(ilev)%sndRadiEcCells(ir)%nCells > 0) THEN
89 
90  sndradieccell => regions(ireg)%levels(ilev)%sndRadiEcCells(ir)
91  level => regions(ir)%levels(ilev)
92  ndim = sndradieccell%nCells
93  ibuff = 0
94 
95  DO iedge=1,12
96  IF (level%edgeCells(iedge)%interact) THEN
97  DO ijk=1,ubound(level%edgeCells(iedge)%cells,1)
98  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
99  icell = level%edgeCells(iedge)%cells(ijk)%srcCell
100  IF (iregsrc == ireg) THEN
101  ibuff = ibuff + 1
102  DO l=1,ncv
103  sndradieccell%buff(ibuff+(l-1)*ndim) = rcv(l,icell)
104  ENDDO
105  ENDIF
106  ENDDO
107  ENDIF
108  ENDDO
109 
110 ! --- corners are not participating currently
111 
112 ! DO icorner=1,8
113 ! IF (level%cornerCells(icorner)%interact) THEN
114 ! DO ijk=1,UBOUND(level%cornerCells(icorner)%cells,1)
115 ! iRegSrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
116 ! icell = level%cornerCells(icorner)%cells(ijk)%srcCell
117 ! IF (iRegSrc == iReg) THEN
118 ! ibuff = ibuff + 1
119 ! DO l=1,nCv
120 ! sndRadiEcCell%buff(ibuff+(l-1)*nDim) = rcv(l,icell)
121 ! ENDDO
122 ! ENDIF
123 ! ENDDO
124 ! ENDIF
125 ! ENDDO
126 
127 #ifdef MPI
128  dest = regions(ir)%procid
129  tag = regions(ir)%localNumber + radi_tag_shift
130  CALL mpi_isend( sndradieccell%buff,ncv*ndim,mpi_rfreal, &
131  dest,tag,global%mpiComm, &
132  global%requests(sndradieccell%iRequest),global%mpierr )
133  IF (global%mpierr /= 0) CALL errorstop( global,err_mpi_trouble,__line__ )
134 #endif
135 
136  ENDIF ! some cells to send
137  ENDIF ! not my processor
138  ENDDO ! ir
139 
140 ! finalize
141 
142  CALL deregisterfunction( global )
143 
144 END SUBROUTINE radi_floflimsendcornedgecells
145 
146 !******************************************************************************
147 !
148 ! RCS Revision history:
149 !
150 ! $Log: RADI_floFlimSendCornEdgeCells.F90,v $
151 ! Revision 1.3 2008/12/06 08:44:38 mtcampbe
152 ! Updated license.
153 !
154 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
155 ! Added Illinois Open Source License/Copyright
156 !
157 ! Revision 1.1 2004/09/30 17:49:10 wasistho
158 ! prepared for full FLD radiation model
159 !
160 !
161 !
162 !******************************************************************************
163 
164 
165 
166 
167 
168 
169 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine radi_floflimsendcornedgecells(regions, iReg)
**********************************************************************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
**********************************************************************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 icell
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469