63 TYPE(t_region
),
POINTER :: regions(:)
66 INTEGER :: ireg,
i,
j,
k,
n
69 CHARACTER(2*CHRLEN+17) :: fname
70 CHARACTER(CHRLEN) ::
msg
73 INTEGER ::
status(mpi_status_size)
75 INTEGER :: iregfile, ipc, jpc, kpc, ndim
77 INTEGER :: inoff, ijnoff, ijkn, errorflag
78 INTEGER,
ALLOCATABLE :: ivar(:,:)
82 REAL(RFREAL),
POINTER :: xyz(:,:)
83 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), xyzfile(:,:)
89 global => regions(1)%global
96 ALLOCATE( ivar(4,1),stat=errorflag )
97 ALLOCATE( rvar(1,1),stat=errorflag )
98 global%error = errorflag
99 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
103 IF (global%myProcid == masterproc)
THEN
106 DO ireg=1,global%nRegions
107 IF (regions(ireg)%mixtInput%moveGrid) movegrid = .true.
112 IF (global%flowType==flow_unsteady .AND. &
113 movegrid .AND. global%timeStamp>0._rfreal)
THEN
115 IF (global%gridFormat == format_ascii)
THEN
116 WRITE(fname,
'(A)') trim(global%inDir)//trim(global%casename)//
'.grda'
117 OPEN(if_grid,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
118 ELSE IF (global%gridFormat == format_binary)
THEN
119 WRITE(fname,
'(A)') trim(global%inDir)//trim(global%casename)//
'.grdb'
120 OPEN(if_grid,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
122 CALL
errorstop( global,err_unknown_format,__line__ )
125 IF (global%gridFormat == format_ascii)
THEN
126 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.grda_', &
128 OPEN(if_grid,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
129 ELSE IF (global%gridFormat == format_binary)
THEN
130 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.grdb_', &
132 OPEN(if_grid,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
134 CALL
errorstop( global,err_unknown_format,__line__ )
141 IF (global%gridFormat == format_ascii)
THEN
142 WRITE(fname,
'(A)') trim(global%inDir)//trim(global%casename)//
'.grda'
143 OPEN(if_grid,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
144 ELSE IF (global%gridFormat == format_binary)
THEN
145 WRITE(fname,
'(A)') trim(global%inDir)//trim(global%casename)//
'.grdb'
146 OPEN(if_grid,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
148 CALL
errorstop( global,err_unknown_format,__line__ )
152 global%error = errorflag
153 IF (global%error /= 0) &
154 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
160 IF (global%myProcid == masterproc)
THEN
163 global%currentTime = rvar(1,1)
168 CALL mpi_bcast( global%currentTime,1,mpi_rfreal,masterproc, &
169 global%mpiComm,global%mpierr )
170 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
175 DO ireg=1,global%nRegions
179 IF (global%myProcid == masterproc)
THEN
186 IF (iregfile /= ireg) &
187 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
188 IF ((ipc /= regions(ireg)%levels(1)%grid%ipc) .OR. &
189 (jpc /= regions(ireg)%levels(1)%grid%jpc) .OR. &
190 (kpc /= regions(ireg)%levels(1)%grid%kpc))
THEN
191 WRITE(
msg,1000) ireg,ipc,jpc,kpc
192 CALL
errorstop( global,err_grid_dimensions,__line__,
msg )
198 IF (global%myProcid == masterproc)
THEN
200 ndim = (ipc+1)*(jpc+1)*(kpc+1)
201 ALLOCATE( xyzfile(3,ndim),stat=errorflag )
202 global%error = errorflag
203 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
208 IF (regions(ireg)%procid /= masterproc)
THEN
209 CALL mpi_send( xyzfile,3*ndim,mpi_rfreal,regions(ireg)%procid,ireg, &
210 global%mpiComm,global%mpierr )
211 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
217 IF (regions(ireg)%procid == global%myProcid)
THEN
218 ndim = (regions(ireg)%levels(1)%grid%ipc+1)* &
219 (regions(ireg)%levels(1)%grid%jpc+1)* &
220 (regions(ireg)%levels(1)%grid%kpc+1)
221 ALLOCATE( xyzfile(3,ndim),stat=errorflag )
222 global%error = errorflag
223 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
225 CALL mpi_recv( xyzfile,3*ndim,mpi_rfreal,masterproc,ireg, &
226 global%mpiComm,
status,global%mpierr )
227 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
235 IF (regions(ireg)%procid == global%myProcid)
THEN
239 xyz => regions(ireg)%levels(1)%grid%xyz
246 ijkn = indijk(
i,
j,
k,inoff,ijnoff)
247 xyz(xcoord,ijkn) = xyzfile(1,
n)
248 xyz(ycoord,ijkn) = xyzfile(2,
n)
249 xyz(zcoord,ijkn) = xyzfile(3,
n)
255 IF (
ALLOCATED(xyzfile))
THEN
256 DEALLOCATE( xyzfile,stat=errorflag )
257 global%error = errorflag
258 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
265 IF (global%myProcid == masterproc)
THEN
266 CLOSE(if_grid,iostat=errorflag)
267 global%error = errorflag
268 IF (global%error /= 0) &
269 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
274 1000
FORMAT(
'Region ',i5,
', ipc= ',i6,
', jpc= ',i6,
', kpc= ',i6,
'.')
**********************************************************************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)
int status() const
Obtain the status of the attribute.
subroutine rflo_readdatafileint(global, fileId, form, nDim1, nDim2, ivar)
**********************************************************************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
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 ipnbeg
**********************************************************************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 rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
subroutine rflo_readgrid(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
subroutine rflo_readdatafilereal(global, fileId, form, nDim1, nDim2, var)