62 CHARACTER(CHRLEN) :: &
63 RCSIdentString =
'$RCSfile: RFLU_ModProbes.F90,v $ $Revision: 1.6 $'
104 TYPE (t_region
),
POINTER :: pregion
110 INTEGER :: errorflag,iprobe
117 global => pregion%global
120 'RFLU_ModProbes.F90')
126 DO iprobe = 1,global%nProbes
132 IF ( global%probePos(iprobe,probe_region) == pregion%iRegionGlobal )
THEN
133 CLOSE(if_probe+iprobe-1,iostat=errorflag)
134 global%error = errorflag
135 IF ( global%error /= err_none )
THEN
136 CALL
errorstop(global,err_file_close,__line__)
192 LOGICAL :: logical1,logical2,logical3
199 'RFLU_ModProbes.F90')
215 IF ( global%flowType == flow_unsteady )
THEN
216 logical1 = abs(global%timeSinceProbe-global%probeSaveTime) &
217 < 0.1_rfreal*global%dtMin
218 logical2 = (global%timeSinceProbe > global%probeSaveTime)
219 logical3 = (global%iterSinceRestart == 1)
221 IF ( logical1 .OR. logical2 .OR. logical3 )
THEN
232 IF ( global%currentIter == 1 )
THEN
288 TYPE(t_region
),
POINTER :: pregion
294 INTEGER :: ccsize,errorflag,icg,iprobe
295 INTEGER,
DIMENSION(:),
ALLOCATABLE :: cc
296 REAL(RFREAL) :: delfrac,xdel,xp,
xmax,
xmin,ydel,yp,
ymax,
ymin,zdel,zp,
zmax,
zmin
298 TYPE(t_grid),
POINTER :: pgrid
304 global => pregion%global
307 'RFLU_ModProbes.F90')
309 IF ( global%myProcid == masterproc .AND. &
310 global%verbLevel >= verbose_high )
THEN
311 WRITE(stdout,
'(A,1X,A)') solver_name,
'Finding cells containing probes...'
318 pgrid => pregion%grid
320 delfrac = 0.01_rfreal
322 ccsize =
min(100,pgrid%nCells)
324 ALLOCATE(cc(ccsize),stat=errorflag)
325 global%error = errorflag
326 IF ( global%error /= err_none )
THEN
327 CALL
errorstop(global,err_allocate,__line__,
'cc')
334 xmin = minval(pgrid%xyz(xcoord,1:pgrid%nVert))
335 xmax = maxval(pgrid%xyz(xcoord,1:pgrid%nVert))
336 ymin = minval(pgrid%xyz(ycoord,1:pgrid%nVert))
337 ymax = maxval(pgrid%xyz(ycoord,1:pgrid%nVert))
338 zmin = minval(pgrid%xyz(zcoord,1:pgrid%nVert))
339 zmax = maxval(pgrid%xyz(zcoord,1:pgrid%nVert))
359 pgrid%cofg(ycoord,1:pgrid%nCells), &
360 pgrid%cofg(zcoord,1:pgrid%nCells), &
367 DO iprobe = 1,global%nProbes
373 xp = global%probeXyz(iprobe,1)
374 yp = global%probeXyz(iprobe,2)
375 zp = global%probeXyz(iprobe,3)
390 cellloop:
DO icg = 1,ccsize
392 global%probePos(iprobe,probe_region) = pregion%iRegionGlobal
393 global%probePos(iprobe,probe_cell) = cc(icg)
407 DEALLOCATE(cc,stat=errorflag)
408 global%error = errorflag
409 IF ( global%error /= err_none )
THEN
410 CALL
errorstop(global,err_deallocate,__line__,
'cc')
417 IF ( global%myProcid == masterproc .AND. &
418 global%verbLevel >= verbose_high )
THEN
419 WRITE(stdout,
'(A,1X,A)') solver_name,
'Finding cells containing probes done.'
465 TYPE (t_region
),
POINTER :: pregion
471 LOGICAL :: fileappend,fileexists
472 CHARACTER(CHRLEN+9) :: fname
473 INTEGER :: errorflag,iprobe,probeiter
474 REAL(RFREAL) :: probetime
481 global => pregion%global
484 'RFLU_ModProbes.F90')
490 probetime = huge(1.0_rfreal)
496 DO iprobe = 1,global%nProbes
502 IF ( global%probePos(iprobe,probe_region) == pregion%iRegionGlobal )
THEN
508 WRITE(fname,
'(A,I4.4)') trim(global%outDir)// &
509 trim(global%casename)//
'.prb_',iprobe
515 IF ( (global%flowType == flow_unsteady .AND. &
516 global%currentTime > 0.0_rfreal) .OR. &
517 (global%flowType == flow_steady .AND. &
518 global%currentIter > 1) )
THEN
519 INQUIRE(file=fname,exist=fileexists)
521 IF ( fileexists .EQV. .true. )
THEN
524 OPEN(if_probe+iprobe-1,file=fname,
form=
'FORMATTED',
status=
'OLD', &
525 position=
'APPEND',iostat=errorflag)
529 OPEN(if_probe+iprobe-1,file=fname,
form=
'FORMATTED',
status=
'UNKNOWN', &
535 OPEN(if_probe+iprobe-1,file=fname,
form=
'FORMATTED',
status=
'UNKNOWN', &
539 global%error = errorflag
540 IF (global%error /= err_none )
THEN
541 CALL
errorstop(global,err_file_open,__line__,
'File: '//trim(fname))
550 IF ( fileappend .EQV. .true. )
THEN
554 IF ( global%flowType == flow_unsteady )
THEN
555 emptyloopunsteady:
DO
556 backspace(if_probe+iprobe-1,iostat=errorflag)
557 IF ( errorflag /= err_none )
THEN
558 EXIT emptyloopunsteady
561 READ(if_probe+iprobe-1,*,iostat=errorflag) probetime
562 IF ( errorflag /= err_none )
THEN
563 EXIT emptyloopunsteady
566 IF (
floatless(probetime,global%currentTime) .EQV. .true. )
THEN
567 EXIT emptyloopunsteady
569 backspace(if_probe+iprobe-1,iostat=errorflag)
570 IF ( errorflag /= err_none )
THEN
571 EXIT emptyloopunsteady
574 END DO emptyloopunsteady
580 backspace(if_probe+iprobe-1,iostat=errorflag)
581 IF ( errorflag /= err_none )
THEN
585 READ(if_probe+iprobe-1,*,iostat=errorflag) probeiter
586 IF ( errorflag /= err_none )
THEN
590 IF ( probeiter < global%currentIter )
THEN
593 backspace(if_probe+iprobe-1,iostat=errorflag)
594 IF ( errorflag /= err_none )
THEN
598 END DO emptyloopsteady
656 CHARACTER(CHRLEN) :: errorstring
657 INTEGER :: errorflag,iprobe
658 INTEGER,
DIMENSION(:),
ALLOCATABLE :: globalvals,localvals
665 'RFLU_ModProbes.F90')
667 IF ( global%myProcid == masterproc .AND. &
668 global%verbLevel >= verbose_high )
THEN
669 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing probe information...'
680 ALLOCATE(localvals(global%nProbes),stat=errorflag)
681 global%error = errorflag
682 IF ( global%error /= err_none )
THEN
683 CALL
errorstop(global,err_allocate,__line__,
'localVals')
686 ALLOCATE(globalvals(global%nProbes),stat=errorflag)
687 global%error = errorflag
688 IF ( global%error /= err_none )
THEN
689 CALL
errorstop(global,err_allocate,__line__,
'globalVals')
696 DO iprobe = 1,global%nProbes
697 localvals(iprobe) = global%probePos(iprobe,probe_region)
700 CALL mpi_allreduce(localvals,globalvals,global%nProbes,mpi_integer,mpi_max, &
701 global%mpiComm,errorflag)
702 global%error = errorflag
703 IF ( global%error /= err_none )
THEN
704 CALL
errorstop(global,err_mpi_trouble,__line__)
707 DO iprobe = 1,global%nProbes
708 global%probePos(iprobe,probe_region) = globalvals(iprobe)
711 DO iprobe = 1,global%nProbes
712 localvals(iprobe) = global%probePos(iprobe,probe_cell)
715 CALL mpi_allreduce(localvals,globalvals,global%nProbes,mpi_integer,mpi_max, &
716 global%mpiComm,errorflag)
717 global%error = errorflag
718 IF ( global%error /= err_none )
THEN
719 CALL
errorstop(global,err_mpi_trouble,__line__)
722 DO iprobe = 1,global%nProbes
723 global%probePos(iprobe,probe_cell) = globalvals(iprobe)
730 DEALLOCATE(localvals,stat=errorflag)
731 global%error = errorflag
732 IF ( global%error /= err_none )
THEN
733 CALL
errorstop(global,err_deallocate,__line__,
'localVals')
736 DEALLOCATE(globalvals,stat=errorflag)
737 global%error = errorflag
738 IF ( global%error /= err_none )
THEN
739 CALL
errorstop(global,err_deallocate,__line__,
'globalVals')
747 IF ( global%myProcid == masterproc )
THEN
748 DO iprobe = 1,global%nProbes
749 IF ( (global%probePos(iprobe,probe_region) == crazy_value_int) .OR. &
750 (global%probePos(iprobe,probe_cell ) == crazy_value_int) )
THEN
751 WRITE(errorstring,
'(A,1X,I3)')
'Probe:',iprobe
752 CALL
errorstop(global,err_probe_location,__line__,trim(errorstring))
761 IF ( global%myProcid == masterproc .AND. &
762 global%verbLevel >= verbose_high )
THEN
763 WRITE(stdout,
'(A,5X,A,3X,A,8X,A)') solver_name,
'#',
'Region',
'Cell'
765 DO iprobe = 1,global%nProbes
766 WRITE(stdout,
'(A,3X,I3,3X,I6,3X,I9)') solver_name,iprobe, &
767 global%probePos(iprobe,probe_region),global%probePos(iprobe,probe_cell)
775 IF ( global%myProcid == masterproc .AND. &
776 global%verbLevel >= verbose_high )
THEN
777 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing probe information done.'
subroutine, public rflu_queryoctree(XPT, YPT, ZPT, NUMP, NEIGHP)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine, public rflu_buildoctree(XI, YI, ZI, XLOW, XUPP, YLOW, YUPP, ZLOW, ZUPP)
subroutine, public rflu_findprobecells(pRegion)
LOGICAL function, public rflu_decidewriteprobes(global)
subroutine buildfilenameplain(global, dest, ext, fileName)
subroutine, public rflu_openprobefiles(pRegion)
subroutine, public rflu_printprobeinfo(global)
subroutine, public rflu_destroyoctree(global)
**********************************************************************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
LOGICAL function, public rflu_ict_testincell(pRegion, xLoc, yLoc, zLoc, icg)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine, public rflu_createoctree(global, nPoints)
subroutine, public rflu_closeprobefiles(pRegion)