63 TYPE(t_region
),
POINTER :: regions(:)
66 INTEGER :: ireg,
i,
j,
k, l,
n, ind
69 CHARACTER(2*CHRLEN+17) :: fname
70 CHARACTER(CHRLEN) ::
msg
73 INTEGER ::
status(mpi_status_size)
75 INTEGER :: ilev, iregfile, ipc, jpc, kpc, ndumcells, ndim, ioff, ijoff, ijk
77 INTEGER :: mixtvarid(2,regions(1)%global%mixtnstat)
78 INTEGER :: turbvarid(2,regions(1)%global%turbnstat)
79 INTEGER :: ntavgvar, maxnstat, allnstat, errorflag
80 INTEGER,
ALLOCATABLE :: ivar(:,:), jvar(:,:)
82 REAL(RFREAL),
POINTER :: mixttav(:,:), turbtav(:,:)
83 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), tavfile(:,:)
89 global => regions(1)%global
96 ALLOCATE( ivar(5,1),stat=errorflag )
97 ALLOCATE( rvar(2,1),stat=errorflag )
98 maxnstat = global%mixtNStat
100 IF (global%turbNStat>0) maxnstat =
max( global%mixtNStat,global%turbNStat )
102 ALLOCATE( jvar(maxnstat+1,1),stat=errorflag )
103 global%error = errorflag
104 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
108 IF (global%myProcid == masterproc)
THEN
110 IF (global%solutFormat == format_ascii)
THEN
111 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.stata_', &
113 OPEN(if_stat,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
114 ELSE IF (global%solutFormat == format_binary)
THEN
115 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.statb_', &
117 OPEN(if_stat,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
119 CALL
errorstop( global,err_unknown_format,__line__ )
122 global%error = errorflag
123 IF (global%error /= 0) &
124 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
130 IF (global%myProcid == masterproc)
THEN
135 CALL mpi_bcast( rvar,2,mpi_rfreal,masterproc,global%mpiComm,global%mpierr )
136 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
139 IF (global%flowType==flow_unsteady .AND. global%currentTime>0._rfreal)
THEN
140 IF (global%currentTime /= rvar(1,1))
THEN
141 WRITE(
msg,1000) rvar(1,1),global%currentTime
142 CALL
errorstop( global,err_time_solution,__line__,
msg//
' File: '//trim(fname) )
145 global%currentTime = rvar(1,1)
147 global%integrTime = rvar(2,1)
149 IF (global%myProcid == masterproc)
THEN
153 IF (global%mixtNStat > 0)
THEN
155 global%mixtNStat+1,1,jvar )
157 IF (ntavgvar /= global%mixtNStat)
THEN
158 CALL
errorstop( global,err_stats_restart,__line__ )
161 mixtvarid(1,:) = jvar(2:global%mixtNStat+1,1)
162 mixtvarid(2,:) = mod(mixtvarid(1,:),10)
163 mixtvarid(1,:) = (mixtvarid(1,:)-mixtvarid(2,:))/10
166 DO l=1,global%mixtNStat
167 IF (mixtvarid(ind,l) /= global%mixtStatId(ind,l)) &
168 CALL
errorstop( global,err_stats_restart,__line__ )
176 IF (global%turbNStat > 0)
THEN
178 global%turbNStat+1,1,jvar )
180 IF (ntavgvar /= global%turbNStat)
THEN
181 CALL
errorstop( global,err_stats_restart,__line__ )
184 turbvarid(1,:) = jvar(2:global%turbNStat+1,1)
185 turbvarid(2,:) = mod(turbvarid(1,:),10)
186 turbvarid(1,:) = (turbvarid(1,:)-turbvarid(2,:))/10
189 DO l=1,global%turbNStat
190 IF (turbvarid(ind,l) /= global%turbStatId(ind,l)) &
191 CALL
errorstop( global,err_stats_restart,__line__ )
200 allnstat = global%mixtNStat+global%turbNStat
202 DO ireg=1,global%nRegions
206 ilev = regions(ireg)%currLevel
212 ndim = ijkend - ijkbeg + 1
216 IF (global%myProcid == masterproc)
THEN
222 ndumcells = ivar(5,1)
224 IF (iregfile /= ireg) &
225 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
226 IF ((ipc /= regions(ireg)%levels(ilev)%grid%ipc) .OR. &
227 (jpc /= regions(ireg)%levels(ilev)%grid%jpc) .OR. &
228 (kpc /= regions(ireg)%levels(ilev)%grid%kpc))
THEN
229 WRITE(
msg,1005) ireg,ipc,jpc,kpc
230 CALL
errorstop( global,err_grid_dimensions,__line__,
msg )
232 IF (ndumcells /= regions(ireg)%nDumCells)
THEN
233 WRITE(
msg,1010) ireg,ndumcells,regions(ireg)%nDumCells
239 ALLOCATE( tavfile(allnstat,ndim),stat=errorflag )
240 global%error = errorflag
241 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
244 allnstat,ndim,tavfile )
246 IF (regions(ireg)%procid /= masterproc)
THEN
247 CALL mpi_send( tavfile,allnstat*ndim,mpi_rfreal, &
248 regions(ireg)%procid,ireg, &
249 global%mpiComm,global%mpierr )
250 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
255 IF (regions(ireg)%procid == global%myProcid)
THEN
256 ALLOCATE( tavfile(allnstat,ndim),stat=errorflag )
257 global%error = errorflag
258 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
260 CALL mpi_recv( tavfile,allnstat*ndim,mpi_rfreal,masterproc, &
261 ireg,global%mpiComm,
status,global%mpierr )
262 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
270 IF (regions(ireg)%procid == global%myProcid)
THEN
271 IF (global%mixtNStat > 0) mixttav => regions(ireg)%levels(ilev)%mixt%tav
277 ijk = indijk(
i,
j,
k,ioff,ijoff)
278 DO l=1,global%mixtNStat
279 mixttav(l,ijk) = tavfile(l,
n)
285 IF (global%turbNStat > 0)
THEN
286 IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
287 (regions(ireg)%mixtInput%turbModel /= turb_model_none))
THEN
288 turbtav => regions(ireg)%levels(ilev)%turb%tav
294 ijk = indijk(
i,
j,
k,ioff,ijoff)
295 DO l=1,global%turbNStat
296 turbtav(l,ijk) = tavfile(l+global%mixtNStat,
n)
306 IF (
ALLOCATED(tavfile))
THEN
307 DEALLOCATE( tavfile,stat=errorflag )
308 global%error = errorflag
309 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
316 IF (global%myProcid == masterproc)
THEN
317 CLOSE(if_stat,iostat=errorflag)
318 global%error = errorflag
319 IF (global%error /= 0) &
320 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
325 1000
FORMAT(
'Time in file is= ',1pe12.5,
' but it should be= ',e12.5,
'.')
326 1005
FORMAT(
'Region ',i5,
', ipc= ',i6,
', jpc= ',i6,
', kpc= ',i6,
'.')
327 1010
FORMAT(
'Region ',i5,
', # dummy cells=',i2,
' but should be= ',i1)
**********************************************************************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 idcend
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine rflo_readdatafileint(global, fileId, form, nDim1, nDim2, ivar)
subroutine rflo_readstat(regions)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************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 idcbeg
**********************************************************************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
**********************************************************************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 jdcend
**********************************************************************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 jdcbeg
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine rflo_readdatafilereal(global, fileId, form, nDim1, nDim2, var)