Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_InterpolDistrib.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: interpolate distribution of boundary values from finer to coarser
26 ! grid.
27 !
28 ! Description: interpolation is based on simple arithmetic averaging. Area
29 ! weighted averaging would be more accurate, but ...
30 !
31 ! Input: n1f, n2f = no. of values on fine grid in 1st and 2nd direction
32 ! n1c, n2c = no. of values on coarse grid in 1st and 2nd direction
33 ! nData = number of equations per node/cell
34 ! valf = values on fine grid
35 !
36 ! Output: valc = values on coarse grid
37 !
38 ! Notes: none.
39 !
40 !******************************************************************************
41 !
42 ! $Id: RFLO_InterpolDistrib.F90,v 1.3 2008/12/06 08:44:07 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE rflo_interpoldistrib( n1f,n2f,n1c,n2c,nData,valf,valc )
49 
50  USE moddatatypes
51  USE moderror
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  INTEGER :: n1f, n2f, n1c, n2c, ndata
58 
59  REAL(RFREAL), POINTER :: valf(:,:), valc(:,:)
60 
61 ! ... loop variables
62  INTEGER :: i, j, n
63 
64 ! ... local variables
65  INTEGER :: icoff, ifoff, ii, jj, ijcp
66 
67 !******************************************************************************
68 ! loop over no. of data and patch` dimensions
69 
70  icoff = n1c + 1
71  ifoff = n1f + 1
72 
73  DO n=1,ndata
74  DO j=0,n2c
75  jj = 2*j
76  DO i=0,n1c
77  ii = 2*i
78  ijcp = indij(i,j,icoff)
79  valc(n,ijcp) = 0.25_rfreal*(valf(n,indij(ii ,jj ,ifoff))+ &
80  valf(n,indij(ii+1,jj ,ifoff))+ &
81  valf(n,indij(ii ,jj+1,ifoff))+ &
82  valf(n,indij(ii+1,jj+1,ifoff)))
83  ENDDO
84  ENDDO
85  ENDDO
86 
87 END SUBROUTINE rflo_interpoldistrib
88 
89 !******************************************************************************
90 !
91 ! RCS Revision history:
92 !
93 ! $Log: RFLO_InterpolDistrib.F90,v $
94 ! Revision 1.3 2008/12/06 08:44:07 mtcampbe
95 ! Updated license.
96 !
97 ! Revision 1.2 2008/11/19 22:17:20 mtcampbe
98 ! Added Illinois Open Source License/Copyright
99 !
100 ! Revision 1.1 2004/11/29 21:25:16 wasistho
101 ! lower to upper case
102 !
103 ! Revision 1.6 2003/05/15 02:57:01 jblazek
104 ! Inlined index function.
105 !
106 ! Revision 1.5 2002/09/05 17:40:19 jblazek
107 ! Variable global moved into regions().
108 !
109 ! Revision 1.4 2002/03/30 00:50:48 jblazek
110 ! Cleaned up with flint.
111 !
112 ! Revision 1.3 2002/01/11 17:13:30 jblazek
113 ! Added time stamp or iteration number to file names.
114 !
115 ! Revision 1.2 2001/12/22 00:09:36 jblazek
116 ! Added routines to store grid and solution.
117 !
118 ! Revision 1.1 2001/12/08 00:18:40 jblazek
119 ! Added routines to read BC input file.
120 !
121 !******************************************************************************
122 
123 
124 
125 
126 
127 
blockLoc i
Definition: read.cpp:79
const NT & n
j indices j
Definition: Indexing.h:6
subroutine rflo_interpoldistrib(n1f, n2f, n1c, n2c, nData, valf, valc)