65 TYPE(t_region
),
POINTER :: regions(:)
68 INTEGER ::
i,
j,
k, l,
n, ind
71 CHARACTER(2*CHRLEN+17) :: fname
72 CHARACTER(CHRLEN) ::
msg
75 INTEGER ::
status(mpi_status_size)
77 INTEGER :: ilev, iregfile, ipc, jpc, kpc, ndumcells, ndim, ioff, ijoff, ijk
79 INTEGER :: mixtvarid(2,regions(1)%global%mixtnstat)
80 INTEGER :: turbvarid(2,regions(1)%global%turbnstat)
81 INTEGER :: ntavgvar, maxnstat, allnstat, errorflag
82 INTEGER,
ALLOCATABLE :: ivar(:,:), jvar(:,:)
84 REAL(RFREAL),
POINTER :: mixttav(:,:), turbtav(:,:)
85 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), tavfile(:,:)
91 global => regions(1)%global
94 'RFLO_ReadStatRegion.F90' )
98 ALLOCATE( ivar(5,1),stat=errorflag )
99 ALLOCATE( rvar(2,1),stat=errorflag )
100 maxnstat = global%mixtNStat
102 IF (global%turbNStat>0) maxnstat =
max( global%mixtNStat,global%turbNStat )
104 ALLOCATE( jvar(maxnstat+1,1),stat=errorflag )
105 global%error = errorflag
106 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
112 IF (global%solutFormat == format_ascii)
THEN
113 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.stata_', &
115 OPEN(if_stat,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
116 ELSE IF (global%solutFormat == format_binary)
THEN
117 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.statb_', &
119 OPEN(if_stat,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
121 CALL
errorstop( global,err_unknown_format,__line__ )
124 global%error = errorflag
125 IF (global%error /= 0) &
126 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
132 IF (global%currentTime>0._rfreal)
THEN
133 IF (global%currentTime /= rvar(1,1))
THEN
134 WRITE(
msg,1000) rvar(1,1),global%currentTime
135 CALL
errorstop( global,err_time_solution,__line__,
msg//
' File: '//trim(fname) )
138 global%currentTime = rvar(1,1)
140 global%integrTime = rvar(2,1)
144 IF (global%mixtNStat > 0)
THEN
146 global%mixtNStat+1,1,jvar )
148 IF (ntavgvar /= global%mixtNStat)
THEN
149 CALL
errorstop( global,err_stats_restart,__line__ )
152 mixtvarid(1,:) = jvar(2:global%mixtNStat+1,1)
153 mixtvarid(2,:) = mod(mixtvarid(1,:),10)
154 mixtvarid(1,:) = (mixtvarid(1,:)-mixtvarid(2,:))/10
157 DO l=1,global%mixtNStat
158 IF (mixtvarid(ind,l) /= global%mixtStatId(ind,l)) &
159 CALL
errorstop( global,err_stats_restart,__line__ )
167 IF (global%turbNStat > 0)
THEN
169 global%turbNStat+1,1,jvar )
171 IF (ntavgvar /= global%turbNStat)
THEN
172 CALL
errorstop( global,err_stats_restart,__line__ )
175 turbvarid(1,:) = jvar(2:global%turbNStat+1,1)
176 turbvarid(2,:) = mod(turbvarid(1,:),10)
177 turbvarid(1,:) = (turbvarid(1,:)-turbvarid(2,:))/10
180 DO l=1,global%turbNStat
181 IF (turbvarid(ind,l) /= global%turbStatId(ind,l)) &
182 CALL
errorstop( global,err_stats_restart,__line__ )
191 allnstat = global%mixtNStat+global%turbNStat
195 ilev = regions(ireg)%currLevel
201 ndim = ijkend - ijkbeg + 1
210 ndumcells = ivar(5,1)
212 IF (iregfile /= ireg) &
213 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
214 IF ((ipc /= regions(ireg)%levels(ilev)%grid%ipc) .OR. &
215 (jpc /= regions(ireg)%levels(ilev)%grid%jpc) .OR. &
216 (kpc /= regions(ireg)%levels(ilev)%grid%kpc))
THEN
217 WRITE(
msg,1005) ireg,ipc,jpc,kpc
218 CALL
errorstop( global,err_grid_dimensions,__line__,
msg )
220 IF (ndumcells /= regions(ireg)%nDumCells)
THEN
221 WRITE(
msg,1010) ireg,ndumcells,regions(ireg)%nDumCells
227 ALLOCATE( tavfile(allnstat,ndim),stat=errorflag )
228 global%error = errorflag
229 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
232 allnstat,ndim,tavfile )
236 IF (global%mixtNStat > 0) mixttav => regions(ireg)%levels(ilev)%mixt%tav
242 ijk = indijk(
i,
j,
k,ioff,ijoff)
243 DO l=1,global%mixtNStat
244 mixttav(l,ijk) = tavfile(l,
n)
251 IF (global%turbNStat > 0)
THEN
252 IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
253 (regions(ireg)%mixtInput%turbModel /= turb_model_none))
THEN
254 turbtav => regions(ireg)%levels(ilev)%turb%tav
260 ijk = indijk(
i,
j,
k,ioff,ijoff)
261 DO l=1,global%turbNStat
262 turbtav(l,ijk) = tavfile(l+global%mixtNStat,
n)
271 IF (
ALLOCATED(tavfile))
THEN
272 DEALLOCATE( tavfile,stat=errorflag )
273 global%error = errorflag
274 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
279 IF (ireg == global%nRegions)
THEN
280 CLOSE(if_stat,iostat=errorflag)
281 global%error = errorflag
282 IF (global%error /= 0) &
283 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
288 1000
FORMAT(
'Time in file is= ',1pe12.5,
' but it should be= ',e12.5,
'.')
289 1005
FORMAT(
'Region ',i5,
', ipc= ',i6,
', jpc= ',i6,
', kpc= ',i6,
'.')
290 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_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_readstatregion(iReg, regions)
subroutine rflo_readdatafilereal(global, fileId, form, nDim1, nDim2, var)