Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_WriteIntegrals1245OLES.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: Write optimal LES integrals in ASCII ROCFLU format.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLU_WriteIntegrals1245OLES.F90,v 1.7 2008/12/06 08:44:30 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflu_writeintegrals1245oles(pRegion)
45 
46  USE modglobal, ONLY: t_global
47  USE moddatatypes
48  USE modparameters
49  USE moderror
50  USE modbndpatch, ONLY: t_patch
51  USE modgrid, ONLY: t_grid
52  USE moddatastruct, ONLY: t_region
53  USE modmpi
54 
55  USE rflu_modoles
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Declarations and definitions
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Local variables
65 ! ==============================================================================
66 
67  INTEGER :: errorflag,hloc,i,icmp,ic1l,ic2l,ic3l,ic4l,ifcp,ifile,ifun,j,k, &
68  l,m,ncells,vloc
69  CHARACTER(CHRLEN) :: ifilename,sectionstring,rcsidentstring
70  TYPE(t_grid), POINTER :: pgrid
71  TYPE(t_global), POINTER :: global
72 
73 ! ==============================================================================
74 ! Arguments
75 ! ==============================================================================
76 
77  TYPE(t_region), POINTER :: pregion
78 
79 ! ******************************************************************************
80 ! Start, set pointer
81 ! ******************************************************************************
82 
83  rcsidentstring = '$RCSfile: RFLU_WriteIntegrals1245OLES.F90,v $ $Revision: 1.7 $'
84 
85  pgrid => pregion%grid
86 
87 ! ******************************************************************************
88 ! Open file
89 ! ******************************************************************************
90 
91  global => pregion%global
92 
93  CALL registerfunction(global,'RFLU_WriteIntegrals1245OLES',&
94  'RFLU_WriteIntegrals1245OLES.F90')
95 
96  ncells = SIZE(pgrid%fsOLES,1)
97 
98  IF ( global%myProcid == masterproc .AND. &
99  global%verbLevel > verbose_none ) THEN
100  WRITE(stdout,'(A)') solver_name
101  WRITE(stdout,'(A,1X,A)') solver_name,'Writing optimal LES integrals...'
102  END IF ! global%verbLevel
103 
104  WRITE(ifilename,'(A,I1)') trim(global%outDir)// &
105  trim(global%casename)//'.int_',ncells
106 
107  ifile = if_integ_oles
108  OPEN(ifile,file=ifilename,form="FORMATTED",status="UNKNOWN", &
109  iostat=errorflag)
110  global%error = errorflag
111  IF ( global%error /= err_none ) THEN
112  CALL errorstop(global,err_file_open,__line__,ifilename)
113  END IF ! global%error
114 
115 ! ==============================================================================
116 ! Integral 1
117 ! ==============================================================================
118 
119  IF ( global%myProcid == masterproc .AND. &
120  global%verbLevel > verbose_low ) THEN
121  WRITE(stdout,'(A,3X,A)') solver_name,'Integral 1...'
122  END IF ! global%verbLevel
123 
124  sectionstring = '# Integral 1'
125  WRITE(ifile,'(A)') trim(sectionstring)
126 
127 ! DO icmp = 1,3
128 ! DO ifcp = 1,3
129 ! DO i = 1,3*nCells
130 ! WRITE(iFile,'(E15.6)') pGrid%int1OLES(icmp,ifcp,i)
131 ! END DO ! i
132 ! END DO ! ifcp
133 ! END DO ! icmp
134 
135  DO ifcp = 1,3
136  DO ic1l = 1,ncells
137  DO ifun = 1,9
138  CALL rflu_mapk2ij(ifun,l,i)
139  vloc = rflu_geti1posoles(l,ic1l)
140 
141  WRITE(ifile,'(E15.6,3X,I2,3X,I2,2X,2(1X,I2),3X,I3)') &
142  pgrid%int1OLES(i,ifcp,vloc),ifcp,ic1l,l,i,vloc
143  END DO ! iFun
144  END DO ! ic1l
145  END DO ! ifcp
146 
147 ! ==============================================================================
148 ! Integral 2
149 ! ==============================================================================
150 
151  IF ( global%myProcid == masterproc .AND. &
152  global%verbLevel > verbose_low ) THEN
153  WRITE(stdout,'(A,3X,A)') solver_name,'Integral 2...'
154  END IF ! global%verbLevel
155 
156  sectionstring = '# Integral 2'
157  WRITE(ifile,'(A)') trim(sectionstring)
158 
159 ! DO ifcp = 1,3
160 ! DO i = 1,3*nCells
161 ! DO j = 1,3*nCells
162 ! WRITE(iFile,'(2(E15.6,1X))') pGrid%int20OLES(ifcp,i,j), &
163 ! pGrid%int21OLES(ifcp,i,j)
164 ! END DO ! j
165 ! END DO ! i
166 ! END DO ! ifcp
167 
168  DO ifcp = 1,3
169  DO ic1l = 1,ncells
170  DO ic2l = 1,ncells
171  DO ifun = 1,9
172  CALL rflu_mapk2ij(ifun,l,j)
173  vloc = rflu_geti1posoles(l,ic1l)
174  hloc = rflu_getlposoles(j,ic2l)
175 
176  WRITE(ifile,1) &
177  pgrid%int20OLES(ifcp,vloc,hloc), &
178  pgrid%int21OLES(ifcp,vloc,hloc), &
179  ifcp,ic1l,ic2l,l,j,vloc,hloc
180  END DO ! iFun
181  END DO ! ic2l
182  END DO ! ic1l
183  END DO ! ifcp
184 
185 ! ==============================================================================
186 ! Integral 4
187 ! ==============================================================================
188 
189  IF ( global%myProcid == masterproc .AND. &
190  global%verbLevel > verbose_low ) THEN
191  WRITE(stdout,'(A,3X,A)') solver_name,'Integral 4...'
192  END IF ! global%verbLevel
193 
194  sectionstring = '# Integral 4'
195  WRITE(ifile,'(A)') trim(sectionstring)
196 
197 ! DO icmp = 1,3
198 ! DO ifcp = 1,3
199 ! DO i = 1,9*nCells*nCells
200 ! WRITE(iFile,'(3(E15.6,1X))') pGrid%int40OLES(icmp,ifcp,i), &
201 ! pGrid%int41OLES(icmp,ifcp,i), &
202 ! pGrid%int42OLES(icmp,ifcp,i)
203 ! END DO ! i
204 ! END DO ! ifcp
205 ! END DO ! icmp
206 
207  DO ifcp = 1,3
208  DO ic1l = 1,ncells
209  DO ic2l = 1,ncells
210  DO ifun = 1,27
211  CALL rflu_mapl2ijk(ifun,l,m,i)
212  vloc = rflu_geti4posoles(l,m,ic1l,ic2l,ncells)
213 
214  WRITE(ifile,2) &
215  pgrid%int40OLES(i,ifcp,vloc), &
216  pgrid%int41OLES(i,ifcp,vloc), &
217  pgrid%int42OLES(i,ifcp,vloc), &
218  ifcp,ic1l,ic2l,l,m,i,vloc
219  END DO ! iFun
220  END DO ! ic2l
221  END DO ! ic1l
222  END DO ! ifcp
223 
224 ! ==============================================================================
225 ! Integral 5
226 ! ==============================================================================
227 
228  IF ( global%myProcid == masterproc .AND. &
229  global%verbLevel > verbose_low ) THEN
230  WRITE(stdout,'(A,3X,A)') solver_name,'Integral 5...'
231  END IF ! global%verbLevel
232 
233  sectionstring = '# Integral 5'
234  WRITE(ifile,'(A)') trim(sectionstring)
235 
236 ! DO ifcp = 1,3
237 ! DO i = 1,9*nCells*nCells
238 ! DO j = 1,9*nCells*nCells
239 ! WRITE(iFile,'(3(E15.6,1X))') pGrid%int50OLES(ifcp,i,j), &
240 ! pGrid%int51OLES(ifcp,i,j), &
241 ! pGrid%int52OLES(ifcp,i,j)
242 ! END DO ! j
243 ! END DO ! i
244 ! END DO ! ifcp
245 
246  DO ifcp = 1,3
247  DO ic1l = 1,ncells
248  DO ic2l = 1,ncells
249  DO ic3l = 1,ncells
250  DO ic4l = 1,ncells
251  DO ifun = 1,81
252  CALL rflu_mapm2ijkl(ifun,l,m,j,k)
253  vloc = rflu_getqposoles(j,k,ic3l,ic4l,ncells)
254  hloc = rflu_geti4posoles(l,m,ic1l,ic2l,ncells)
255 
256  WRITE(ifile,3) &
257  pgrid%int50OLES(ifcp,vloc,hloc), &
258  pgrid%int51OLES(ifcp,vloc,hloc), &
259  pgrid%int52OLES(ifcp,vloc,hloc), &
260  ifcp,ic1l,ic2l,ic3l,ic4l,l,m,j,k,vloc,hloc
261  END DO ! iFun
262  END DO ! ic4l
263  END DO ! ic3l
264  END DO ! ic2l
265  END DO ! ic1l
266  END DO ! ifcp
267 
268 ! ==============================================================================
269 ! Write footer
270 ! ==============================================================================
271 
272  sectionstring = '# End'
273  WRITE(ifile,'(A)') trim(sectionstring)
274 
275 ! ==============================================================================
276 ! Close file
277 ! ==============================================================================
278 
279  CLOSE(ifile,iostat=errorflag)
280  global%error = errorflag
281  IF ( global%error /= err_none ) THEN
282  CALL errorstop(global,err_file_close,__line__,ifilename)
283  END IF ! global%error
284 
285  IF ( global%myProcid == masterproc .AND. &
286  global%verbLevel > verbose_none ) THEN
287  WRITE(stdout,'(A,1X,A)') solver_name,'Writing optimal LES integrals done.'
288  END IF ! global%verbLevel
289 
290  CALL deregisterfunction(global)
291 
292 1 FORMAT(2(e15.6,1x),2x,i2,2x,2(1x,i2),2x,2(1x,i2),2x,2(1x,i3))
293 2 FORMAT(3(e15.6,1x),2x,i2,2x,2(1x,i2),2x,3(1x,i2),3x,i3)
294 3 FORMAT(3(e15.6,1x),2x,i2,2x,4(1x,i2),2x,4(1x,i2),2x,2(1x,i3))
295 
296 ! ******************************************************************************
297 ! End
298 ! ******************************************************************************
299 
300 END SUBROUTINE rflu_writeintegrals1245oles
301 
302 
303 ! ******************************************************************************
304 !
305 ! RCS Revision history:
306 !
307 ! $Log: RFLU_WriteIntegrals1245OLES.F90,v $
308 ! Revision 1.7 2008/12/06 08:44:30 mtcampbe
309 ! Updated license.
310 !
311 ! Revision 1.6 2008/11/19 22:17:43 mtcampbe
312 ! Added Illinois Open Source License/Copyright
313 !
314 ! Revision 1.5 2006/12/15 13:27:02 haselbac
315 ! Fixed bug in format statement, found by ifort
316 !
317 ! Revision 1.4 2004/01/22 16:04:34 haselbac
318 ! Changed declaration to eliminate warning on ALC
319 !
320 ! Revision 1.3 2002/10/08 15:49:29 haselbac
321 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
322 !
323 ! Revision 1.2 2002/10/05 19:35:41 haselbac
324 ! GENX integration: added outDir to file name
325 !
326 ! Revision 1.1 2002/09/09 16:28:02 haselbac
327 ! Initial revision
328 !
329 ! ******************************************************************************
330 
331 
332 
333 
334 
335 
336 
FT m(int i, int j) const
j indices k indices k
Definition: Indexing.h:6
subroutine rflu_writeintegrals1245oles(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
INTEGER function, public rflu_geti1posoles(l, d)
INTEGER function, public rflu_getlposoles(j, a)
subroutine, public rflu_mapk2ij(k, i, j)
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
**********************************************************************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
subroutine, public rflu_mapm2ijkl(m, i, j, k, l)
INTEGER function, public rflu_geti4posoles(l, m, d, e, nCells)
j indices j
Definition: Indexing.h:6
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, public rflu_mapl2ijk(l, i, j, k)
INTEGER function, public rflu_getqposoles(j, k, b, g, nCells)
subroutine deregisterfunction(global)
Definition: ModError.F90:469