61 CHARACTER(CHRLEN) :: RCSIdentString = &
62 '$RCSfile: RFLU_ModReadWriteBcDataFile.F90,v $ $Revision: 1.6 $'
104 TYPE(t_region
),
POINTER :: pregion
110 CHARACTER(CHRLEN) :: rcsidentstring
113 TYPE(t_grid),
POINTER :: pgrid
114 TYPE(t_patch),
POINTER :: ppatch
120 global => pregion%global
123 'RFLU_ModReadWriteBcDataFile.F90')
129 pgrid => pregion%grid
137 DO ipatch = 1,pgrid%nPatches
138 ppatch => pregion%patches(ipatch)
144 IF ( (ppatch%bcCoupled == bc_not_coupled) .AND. &
145 (ppatch%mixt%distrib == bcdat_distrib) )
THEN
200 TYPE(t_region
),
POINTER :: pregion
206 CHARACTER(CHRLEN) :: errorstring,ifilename,sectionstring
207 INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch,ipatchglobal, &
208 loopcounter,nbfaces,ndata
210 TYPE(t_grid),
POINTER :: pgrid
211 TYPE(t_patch),
POINTER :: ppatch
217 global => pregion%global
220 'RFLU_ModReadWriteBcDataFile.F90')
222 IF ( global%myProcid == masterproc .AND. &
223 global%verbLevel > verbose_none )
THEN
224 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading boundary-condition data...'
231 pgrid => pregion%grid
240 pregion%iRegionGlobal,ifilename)
242 OPEN(ifile,file=ifilename,
form=
'FORMATTED',
status=
'OLD',iostat=errorflag)
243 global%error = errorflag
244 IF ( global%error /= err_none )
THEN
245 CALL
errorstop(global,err_file_open,__line__,
'File: '//trim(ifilename))
252 READ(ifile,
'(A)') sectionstring
253 IF ( trim(sectionstring) /=
'# ROCFLU boundary-condition data file' )
THEN
254 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
264 loopcounter = loopcounter + 1
266 READ(ifile,
'(A)') sectionstring
268 SELECT CASE ( trim(sectionstring) )
274 CASE (
'# Patch data' )
275 IF ( global%myProcid == masterproc .AND. &
276 global%verbLevel > verbose_low )
THEN
277 WRITE(stdout,
'(A,3X,A)') solver_name,
'Patch data...'
280 READ(ifile,*) ipatch,ipatchglobal,nbfaces,ndata
286 IF ( ipatch > pgrid%nPatches )
THEN
287 WRITE(errorstring,
'(A,1X,I3)')
'Patch index invalid:',ipatch
288 CALL
errorstop(global,err_bcdata_value_invalid,__line__, &
292 ppatch => pregion%patches(ipatch)
294 IF ( nbfaces /= ppatch%nBFaces )
THEN
295 WRITE(errorstring,
'(A,1X,I6)')
'Number of faces invalid:',nbfaces
296 CALL
errorstop(global,err_bcdata_value_invalid,__line__, &
300 IF ( ipatchglobal /= ppatch%iPatchGlobal )
THEN
301 WRITE(errorstring,
'(A,1X,I3)')
'Global patch index invalid:', &
303 CALL
errorstop(global,err_bcdata_value_invalid,__line__, &
307 IF ( ndata /= ppatch%mixt%nData )
THEN
308 WRITE(errorstring,
'(A,1X,I3)') &
309 'Number of pieces of data invalid:',ndata
310 CALL
errorstop(global,err_bcdata_value_invalid,__line__, &
318 DO ifl = 1,ppatch%nBFaces
319 DO idata = 1,ppatch%mixt%nData
320 READ(ifile,
'(1X,I6,1X,I2,1X,E23.16)') &
321 dummyinteger,dummyinteger,ppatch%mixt%vals(idata,ifl)
330 IF ( global%myProcid == masterproc .AND. &
331 global%verbLevel > verbose_low )
THEN
332 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
342 IF ( global%verbLevel > verbose_low )
THEN
343 WRITE(stdout,
'(A,3X,A)') solver_name,sectionstring
346 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
354 IF ( loopcounter >= limit_infinite_loop )
THEN
355 CALL
errorstop(global,err_infinite_loop,__line__)
364 CLOSE(ifile,iostat=errorflag)
365 global%error = errorflag
366 IF ( global%error /= err_none )
THEN
367 CALL
errorstop(global,err_file_close,__line__,
'File: '//trim(ifilename))
374 IF ( global%myProcid == masterproc .AND. &
375 global%verbLevel > verbose_none )
THEN
376 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading boundary-condition data done.'
420 TYPE(t_region
),
POINTER :: pregion
426 CHARACTER(CHRLEN) :: ifilename,sectionstring
427 INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch
429 TYPE(t_grid),
POINTER :: pgrid
430 TYPE(t_patch),
POINTER :: ppatch
436 global => pregion%global
439 'RFLU_ModReadWriteBcDataFile.F90')
441 IF ( global%myProcid == masterproc .AND. &
442 global%verbLevel > verbose_none )
THEN
443 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing boundary-condition data...'
450 pgrid => pregion%grid
459 pregion%iRegionGlobal,ifilename)
461 OPEN(ifile,file=ifilename,
form=
'FORMATTED',
status=
'UNKNOWN', &
463 global%error = errorflag
464 IF ( global%error /= err_none )
THEN
465 CALL
errorstop(global,err_file_open,__line__,
'File: '//trim(ifilename))
472 sectionstring =
'# ROCFLU boundary-condition data file'
473 WRITE(ifile,
'(A)') sectionstring
479 DO ipatch = 1,pgrid%nPatches
480 ppatch => pregion%patches(ipatch)
486 IF ( (ppatch%bcCoupled == bc_not_coupled) .AND. &
487 (ppatch%mixt%distrib == bcdat_distrib) )
THEN
488 WRITE(ifile,
'(A)')
'# Patch data'
489 WRITE(ifile,
'(2(1X,I3),1X,I6,1X,I2)') ipatch,ppatch%iPatchGlobal, &
493 DO ifl = 1,ppatch%nBFaces
494 DO idata = 1,ppatch%mixt%nData
495 WRITE(ifile,
'(1X,I6,1X,I2,1X,E23.16)') ifl,idata, &
496 ppatch%mixt%vals(idata,ifl)
506 sectionstring =
'# End'
507 WRITE(ifile,
'(A)') sectionstring
513 CLOSE(ifile,iostat=errorflag)
514 global%error = errorflag
515 IF ( global%error /= err_none )
THEN
516 CALL
errorstop(global,err_file_close,__line__,
'File: '//trim(ifilename))
523 IF ( global%myProcid == masterproc .AND. &
524 global%verbLevel > verbose_none )
THEN
525 WRITE(stdout,
'(A,1X,A)') solver_name, &
526 'Writing boundary-condition data done.'
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
subroutine, public rflu_readbcdatafile(pRegion)
subroutine, public rflu_writebcdatafile(pRegion)
LOGICAL function, public rflu_decidereadwritebcdatafile(pRegion)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)