64 TYPE(t_region
),
POINTER :: regions(:)
67 INTEGER :: ireg,
i,
j,
k,
n
70 CHARACTER(2*CHRLEN+17) :: fname
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
92 'RFLO_WriteGrid.F90' )
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%currentTime>0._rfreal)
THEN
114 IF (global%gridFormat == format_ascii)
THEN
115 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.grda_', &
117 OPEN(if_grid,file=fname,
form=
'formatted',
status=
'unknown', &
119 ELSE IF (global%gridFormat == format_binary)
THEN
120 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.grdb_', &
122 OPEN(if_grid,file=fname,
form=
'unformatted',
status=
'unknown', &
125 CALL
errorstop( global,err_unknown_format,__line__ )
127 rvar(1,1) = global%currentTime
132 IF (global%gridFormat == format_ascii)
THEN
133 WRITE(fname,
'(A)') trim(global%outDir)//trim(global%casename)//
'.grda'
134 OPEN(if_grid,file=fname,
form=
'formatted',
status=
'unknown', &
136 ELSE IF (global%gridFormat == format_binary)
THEN
137 WRITE(fname,
'(A)') trim(global%outDir)//trim(global%casename)//
'.grdb'
138 OPEN(if_grid,file=fname,
form=
'unformatted',
status=
'unknown', &
141 CALL
errorstop( global,err_unknown_format,__line__ )
143 rvar(1,1) = 0._rfreal
146 global%error = errorflag
147 IF (global%error /= 0) &
148 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
154 IF (global%myProcid == masterproc)
THEN
160 DO ireg=1,global%nRegions
164 IF (regions(ireg)%procid==global%myProcid .OR. &
165 global%myProcid==masterproc)
THEN
166 ndim = (regions(ireg)%levels(1)%grid%ipc+1)* &
167 (regions(ireg)%levels(1)%grid%jpc+1)* &
168 (regions(ireg)%levels(1)%grid%kpc+1)
169 ALLOCATE( xyzfile(3,ndim),stat=errorflag )
170 global%error = errorflag
171 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
176 IF (regions(ireg)%procid == global%myProcid)
THEN
180 xyz => regions(ireg)%levels(1)%grid%xyz
187 ijkn = indijk(
i,
j,
k,inoff,ijnoff)
188 xyzfile(1,
n) = xyz(xcoord,ijkn)
189 xyzfile(2,
n) = xyz(ycoord,ijkn)
190 xyzfile(3,
n) = xyz(zcoord,ijkn)
198 IF (global%myProcid == masterproc)
THEN
200 ivar(2,1) = regions(ireg)%levels(1)%grid%ipc
201 ivar(3,1) = regions(ireg)%levels(1)%grid%jpc
202 ivar(4,1) = regions(ireg)%levels(1)%grid%kpc
208 IF (global%myProcid == masterproc)
THEN
210 IF (regions(ireg)%procid /= masterproc)
THEN
211 CALL mpi_recv( xyzfile,3*ndim,mpi_rfreal,regions(ireg)%procid,ireg, &
212 global%mpiComm,
status,global%mpierr )
213 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
221 IF (regions(ireg)%procid == global%myProcid)
THEN
222 CALL mpi_send( xyzfile,3*ndim,mpi_rfreal,masterproc,ireg, &
223 global%mpiComm,global%mpierr )
224 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
229 IF (
ALLOCATED(xyzfile))
THEN
230 DEALLOCATE( xyzfile,stat=errorflag )
231 global%error = errorflag
232 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
239 IF (global%myProcid == masterproc)
THEN
240 CLOSE(if_grid,iostat=errorflag)
241 global%error = errorflag
242 IF (global%error /= 0) &
243 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
**********************************************************************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
subroutine rflo_writedatafileint(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 kpnbeg
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 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_writegrid(regions)
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflo_writedatafilereal(global, fileId, form, nDim1, nDim2, var)
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