Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CopyBoundaryData.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: copy data associated with a patch from finer to coarser grid.
26 !
27 ! Description: none.
28 !
29 ! Input: patchPrev = patch on previous grid level.
30 !
31 ! Output: patch = patch on current grid level.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_CopyBoundaryData.F90,v 1.4 2008/12/06 08:44:06 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_copyboundarydata( global,patchPrev,patch )
44 
45  USE moddatatypes
46  USE modbndpatch, ONLY : t_patch
47  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 #include "Indexing.h"
54 
55 ! ... parameters
56  TYPE(t_patch), POINTER :: patchprev, patch
57  TYPE(t_global), POINTER :: global
58 
59 ! ... local variables
60  INTEGER :: n1, n2, n1p, n2p, ioff, ijbeg, ijend, errorflag
61 
62 !******************************************************************************
63 
64  CALL registerfunction( global,'RFLO_CopyBoundaryData',&
65  'RFLO_CopyBoundaryData.F90' )
66 
67 ! copy switches
68 
69  IF (patch%mixt%nSwitches > 0) THEN
70  ALLOCATE( patch%mixt%switches(patch%mixt%nSwitches),stat=errorflag )
71  global%error = errorflag
72  IF (global%error /= 0) CALL errorstop( global,err_allocate,&
73  __line__ )
74  patch%mixt%switches(:) = patchprev%mixt%switches(:)
75  ENDIF
76 
77 ! copy distributions
78 
79  IF (patch%mixt%distrib == bcdat_distrib) THEN
80  n1p = abs(patchprev%l1end-patchprev%l1beg)
81  n2p = abs(patchprev%l2end-patchprev%l2beg)
82  n1 = abs(patch%l1end-patch%l1beg)
83  n2 = abs(patch%l2end-patch%l2beg)
84  ioff = n1 + 1
85  ijbeg = indij( 0, 0,ioff)
86  ijend = indij(n1,n2,ioff)
87  IF (patch%mixt%nData > 0) THEN
88  ALLOCATE( patch%mixt%vals(patch%mixt%nData,ijbeg:ijend), &
89  stat=errorflag )
90  global%error = errorflag
91  IF (global%error /= 0) CALL errorstop( global,err_allocate,&
92  __line__ )
93  CALL rflo_interpoldistrib( n1p,n2p,n1,n2,patch%mixt%nData, &
94  patchprev%mixt%vals,patch%mixt%vals )
95  ENDIF
96 
97  ELSE
98  IF (patch%mixt%nData > 0) THEN
99  ALLOCATE( patch%mixt%vals(patch%mixt%nData,0:1),stat=errorflag )
100  global%error = errorflag
101  IF (global%error /= 0) CALL errorstop( global,err_allocate,&
102  __line__ )
103  patch%mixt%vals(:,:) = patchprev%mixt%vals(:,:)
104  ENDIF
105  ENDIF
106 
107 ! finalize
108 
109  CALL deregisterfunction( global )
110 
111 END SUBROUTINE rflo_copyboundarydata
112 
113 !******************************************************************************
114 !
115 ! RCS Revision history:
116 !
117 ! $Log: RFLO_CopyBoundaryData.F90,v $
118 ! Revision 1.4 2008/12/06 08:44:06 mtcampbe
119 ! Updated license.
120 !
121 ! Revision 1.3 2008/11/19 22:17:20 mtcampbe
122 ! Added Illinois Open Source License/Copyright
123 !
124 ! Revision 1.2 2006/08/19 15:37:59 mparmar
125 ! Renamed patch variables
126 !
127 ! Revision 1.1 2004/11/29 21:25:16 wasistho
128 ! lower to upper case
129 !
130 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
131 ! Backing out RocfluidMP changes from 11-17-03
132 !
133 ! Revision 1.3 2003/05/15 02:57:01 jblazek
134 ! Inlined index function.
135 !
136 ! Revision 1.2 2002/10/25 18:36:19 jblazek
137 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
138 !
139 ! Revision 1.1 2002/10/19 00:40:30 jblazek
140 ! Added utility (rflosurf) to write out surface grids for GenX.
141 !
142 ! Revision 1.2 2002/09/27 00:57:10 jblazek
143 ! Changed makefiles - no makelinks needed.
144 !
145 ! Revision 1.1 2002/09/05 17:40:21 jblazek
146 ! Variable global moved into regions().
147 !
148 ! Revision 1.5 2002/02/27 18:38:19 jblazek
149 ! Changed extrapol. to dummy cells at injection boundaries and slip walls.
150 !
151 ! Revision 1.4 2002/01/28 23:55:22 jblazek
152 ! Added flux computation (central scheme).
153 !
154 ! Revision 1.3 2002/01/11 17:18:30 jblazek
155 ! Updated description of I/O variables.
156 !
157 ! Revision 1.2 2001/12/22 00:09:38 jblazek
158 ! Added routines to store grid and solution.
159 !
160 ! Revision 1.1 2001/12/07 16:54:31 jblazek
161 ! Added files to read user input.
162 !
163 !******************************************************************************
164 
165 
166 
167 
168 
169 
170 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine rflo_copyboundarydata(global, patchPrev, patch)
subroutine rflo_interpoldistrib(n1f, n2f, n1c, n2c, nData, valf, valc)
subroutine deregisterfunction(global)
Definition: ModError.F90:469