66 INTEGER :: ireg,
i,
j,
k, ijkn
70 zmin,
zmax, versionstring, headerstring
72 INTEGER :: ibn, ien, inoff, ijnoff, regnum, regnumbeg, regnumend
75 INTEGER :: margin, versionwidth, errorflag
76 INTEGER,
PARAMETER :: headerwidth = 53
78 REAL(RFREAL) :: xminbox, xmaxbox, yminbox, ymaxbox, zminbox, zmaxbox
79 REAL(RFREAL),
POINTER :: xyz(:,:)
82 TYPE(t_region
),
POINTER :: regions(:)
94 global%verbLevel = verbose_none
96 global%flowType = flow_steady
97 global%currentTime = -1._rfreal
98 global%currentIter = -1
104 global%nProcAlloc = 1
105 global%myProcid = masterproc
106 global%mpierr = err_none
107 global%error = err_none
109 global%pi = 4._rfreal*atan(1._rfreal)
110 global%rad = global%pi/180._rfreal
115 CALL mpi_init( global%mpierr )
116 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
122 versionwidth = len_trim(versionstring)
123 margin = (headerwidth-versionwidth)/2
124 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
125 headerstring(1:1) =
'*'
126 headerstring(headerwidth:headerwidth) =
'*'
128 WRITE(stdout,
'(/,A)') solver_name//
' *****************************************************'
129 WRITE(stdout,
'(A)') solver_name//
' * *'
130 WRITE(stdout,
'(A)') solver_name//
' * ROCFLO-MP: Block Counting Utility *'
131 WRITE(stdout,
'(A)') solver_name//
' * ================================= *'
132 WRITE(stdout,
'(A)') solver_name//
' * *'
133 WRITE(stdout,
'(A)') solver_name//
' '//trim(headerstring)
134 WRITE(stdout,
'(A)') solver_name//
' * Copyright (c) by the University of Illinois *'
135 WRITE(stdout,
'(A)') solver_name//
' * *'
136 WRITE(stdout,
'(A,/)') solver_name//
' *****************************************************'
140 CALL getarg(1,global%casename)
141 CALL getarg(2,gridfmt)
149 IF (len_trim(global%casename)==0 .OR. &
150 len_trim(gridfmt)==0 .OR. &
151 len_trim(
xmin)==0 .OR. &
152 len_trim(
xmax)==0 .OR. &
153 len_trim(
ymin)==0 .OR. &
154 len_trim(
ymax)==0 .OR. &
155 len_trim(
zmin)==0 .OR. &
156 len_trim(
zmax)==0)
THEN
157 WRITE(stdout,
'(/,A,/,A,/,2(A,/))') &
158 solver_name//
' Usage: rfloblocks <casename> <format> <xmin xmax> <ymin ymax> <zmin zmax>', &
160 solver_name//
' format = 0 - ASCII grid', &
161 solver_name//
' 1 - binary grid'
163 CALL mpi_finalize( global%mpierr )
168 READ(gridfmt ,*) global%gridFormat
169 READ(
xmin ,*) xminbox
170 READ(
xmax ,*) xmaxbox
171 READ(
ymin ,*) yminbox
172 READ(
ymax ,*) ymaxbox
173 READ(
zmin ,*) zminbox
174 READ(
zmax ,*) zmaxbox
176 IF (global%gridFormat <= 0)
THEN
177 global%gridFormat = format_ascii
179 global%gridFormat = format_binary
184 WRITE(stdout,
'(/,A)') solver_name//
' Reading region topology ...'
188 DO ireg=1,global%nRegions
189 regions(ireg)%startLevel = global%startLevel
190 regions(ireg)%currLevel = global%startLevel
195 WRITE(stdout,
'(/,A,/)') solver_name//
' Searching for blocks ...'
200 DO ireg=1,global%nRegions
211 ALLOCATE( regions(ireg)%levels(1)%grid%xyz(3,ibn:ien),stat=errorflag )
212 global%error = errorflag
213 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
221 xyz => regions(ireg)%levels(1)%grid%xyz
227 ijkn = indijk(
i,
j,
k,inoff,ijnoff)
228 IF ((xyz(xcoord,ijkn)>xminbox .AND. xyz(xcoord,ijkn)<xmaxbox) .AND. &
229 (xyz(ycoord,ijkn)>yminbox .AND. xyz(ycoord,ijkn)<ymaxbox) .AND. &
230 (xyz(zcoord,ijkn)>zminbox .AND. xyz(zcoord,ijkn)<zmaxbox))
THEN
237 IF (regnum == regnumend+1)
THEN
240 IF (regnum/=0 .AND. regnumend<0)
THEN
243 ELSE IF (regnum/=0 .AND. regnumend>0)
THEN
244 WRITE(stdout,1000) solver_name,regnumbeg,regnumend
252 DEALLOCATE( regions(ireg)%levels(1)%grid%xyz,stat=errorflag )
253 global%error = errorflag
254 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
258 IF (regnumbeg>0 .AND. regnumend>0)
THEN
259 WRITE(stdout,1000) solver_name,regnumbeg,regnumend
261 WRITE(stdout,1005) solver_name
268 WRITE(stdout,
'(/,A)') solver_name//
' Finished.'
271 CALL mpi_finalize( global%mpierr )
274 1000
FORMAT(
a,
' From block ',i5,
' to ',i5)
275 1005
FORMAT(
a,
' No blocks found.')
278 END SUBROUTINE mpi_main
**********************************************************************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 jpnbeg
**********************************************************************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 kpnbeg
subroutine registerfunction(global, funName, fileName)
**********************************************************************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 jdnbeg
**********************************************************************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 jpnend
**********************************************************************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 idnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdnend
subroutine rflo_readgridregion(iReg, regions)
**********************************************************************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 idnbeg
subroutine buildversionstring(versionString)
**********************************************************************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 ipnbeg
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
subroutine rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
subroutine rflo_readregiontopology(global, regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(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 ipnend
**********************************************************************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 kdnbeg