Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ReadBcFromFile.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: read boundary condition data from a file.
26 !
27 ! Description: none.
28 !
29 ! Input: global = global variables (needed for error function)
30 ! fname = file name
31 ! patch = BC patch for which the data is to be read in.
32 !
33 ! Output: patch%mixt%vals = BC data for the mixture.
34 !
35 ! Notes: currently only the mixture BC data are read in.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_ReadBcFromFile.F90,v 1.6 2008/12/06 08:44:07 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_readbcfromfile( global,fname,patch )
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49  USE modbndpatch, ONLY : t_patch
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  CHARACTER(*) :: fname
58 
59  TYPE(t_global), POINTER :: global
60  TYPE(t_patch), POINTER :: patch
61 
62 ! ... loop variables
63  INTEGER :: ireg, ipatch, n, i, j, ij
64 
65 ! ... local variables
66  INTEGER :: n1, n2, ioff, nf1, nf2, errorflag
67 
68 !******************************************************************************
69 
70  CALL registerfunction( global,'RFLO_ReadBcFromFile',&
71  'RFLO_ReadBcFromFile.F90' )
72 
73 ! dimensions
74 
75  n1 = abs(patch%l1end-patch%l1beg)
76  n2 = abs(patch%l2end-patch%l2beg)
77  ioff = n1 + 1
78 
79 ! read the file file
80 
81  WRITE(fname,'(A)') trim(global%inDir)//trim(fname)
82  OPEN(if_distr,file=fname,form='formatted',status='old',iostat=errorflag)
83  global%error = errorflag
84  IF (global%error /= 0) &
85  CALL errorstop( global,err_file_open,&
86  __line__,'File: '//trim(fname) )
87 
88  READ(if_distr,*,err=10,end=10) nf1,nf2
89  IF (nf1/=n1+1 .OR. nf2/=n2+1) &
90  CALL errorstop( global,err_patch_dimens,&
91  __line__ )
92 
93  DO n=1,patch%mixt%nData
94  DO j=0,n2
95  DO i=0,n1
96  ij = indij(i,j,ioff)
97  READ(if_distr,*,err=10,end=10) patch%mixt%vals(n,ij)
98  ENDDO
99  ENDDO
100  ENDDO
101 
102  CLOSE(if_distr,iostat=errorflag)
103  global%error = errorflag
104  IF (global%error /= 0) &
105  CALL errorstop( global,err_file_close,&
106  __line__,'File: '//trim(fname) )
107 
108 goto 999
109 
110 ! error handling
111 
112 10 CONTINUE
113  CALL errorstop( global,err_file_read,&
114  __line__,'File: '//trim(fname) )
115 
116 999 CONTINUE
117 
118  CALL deregisterfunction( global )
119 
120 END SUBROUTINE rflo_readbcfromfile
121 
122 !******************************************************************************
123 !
124 ! RCS Revision history:
125 !
126 ! $Log: RFLO_ReadBcFromFile.F90,v $
127 ! Revision 1.6 2008/12/06 08:44:07 mtcampbe
128 ! Updated license.
129 !
130 ! Revision 1.5 2008/11/19 22:17:20 mtcampbe
131 ! Added Illinois Open Source License/Copyright
132 !
133 ! Revision 1.4 2006/08/19 15:38:09 mparmar
134 ! Renamed patch variables
135 !
136 ! Revision 1.3 2005/05/04 19:03:26 wasistho
137 ! included dir-name in fname
138 !
139 ! Revision 1.2 2005/05/03 03:20:52 wasistho
140 ! added GOTO 999
141 !
142 ! Revision 1.1 2004/11/29 21:25:16 wasistho
143 ! lower to upper case
144 !
145 ! Revision 1.2 2003/05/15 02:57:01 jblazek
146 ! Inlined index function.
147 !
148 ! Revision 1.1 2002/10/19 00:40:30 jblazek
149 ! Added utility (rflosurf) to write out surface grids for GenX.
150 !
151 ! Revision 1.3 2002/10/12 03:20:50 jblazek
152 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
153 !
154 ! Revision 1.2 2002/09/27 00:57:10 jblazek
155 ! Changed makefiles - no makelinks needed.
156 !
157 ! Revision 1.1 2002/09/20 22:22:36 jblazek
158 ! Finalized integration into GenX.
159 !
160 !******************************************************************************
161 
162 
163 
164 
165 
166 
167 
subroutine rflo_readbcfromfile(global, fname, patch)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
Definition: patch.h:74
blockLoc i
Definition: read.cpp:79
**********************************************************************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 form
const NT & n
j indices j
Definition: Indexing.h:6
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469