67 TYPE(t_region
),
POINTER :: regions(:)
70 INTEGER :: ireg,
i,
j,
k, l,
n
73 CHARACTER(2*CHRLEN+17) :: fname
76 INTEGER ::
status(mpi_status_size)
78 INTEGER :: ilev, iregfile, ipc, jpc, kpc, ndumcells, ndim, ioff, ijoff, ijk
80 INTEGER :: maxnstat, allnstat, errorflag
81 INTEGER :: mixtstatid(regions(1)%global%mixtnstat)
82 INTEGER :: turbstatid(regions(1)%global%turbnstat)
83 INTEGER,
ALLOCATABLE :: ivar(:,:), jvar(:,:)
85 REAL(RFREAL),
POINTER :: mixttav(:,:), turbtav(:,:)
86 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), tavfile(:,:)
93 global => regions(1)%global
96 'RFLO_WriteStat.F90' )
100 ALLOCATE( ivar(5,1),stat=errorflag )
101 ALLOCATE( rvar(2,1),stat=errorflag )
102 maxnstat =
max( global%mixtNStat,global%turbNStat )
103 ALLOCATE( jvar(maxnstat+1,1),stat=errorflag )
104 global%error = errorflag
105 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
109 IF (global%myProcid == masterproc)
THEN
111 IF (global%solutFormat == format_ascii)
THEN
112 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.stata_', &
114 OPEN(if_stat,file=fname,
form=
'formatted',
status=
'unknown', &
116 ELSE IF (global%solutFormat == format_binary)
THEN
117 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.statb_', &
119 OPEN(if_stat,file=fname,
form=
'unformatted',
status=
'unknown', &
122 CALL
errorstop( global,err_unknown_format,__line__ )
124 rvar(1,1) = global%currentTime
125 rvar(2,1) = global%integrTime
127 global%error = errorflag
128 IF (global%error /= 0) &
129 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
137 IF (global%mixtNStat > 0)
THEN
138 jvar(1,1) = global%mixtNStat
139 mixtstatid(:)= global%mixtStatId(1,:)*10 + global%mixtStatId(2,:)
140 jvar(2:global%mixtNStat+1,1) = mixtstatid(1:global%mixtNStat)
142 global%mixtNStat+1,1,jvar )
148 IF (global%turbNStat > 0)
THEN
149 jvar(1,1) = global%turbNStat
150 turbstatid(:)= global%turbStatId(1,:)*10 + global%turbStatId(2,:)
151 jvar(2:global%turbNStat+1,1) = turbstatid(1:global%turbNStat)
153 global%turbNStat+1,1,jvar )
160 allnstat = global%mixtNStat+global%turbNStat
162 DO ireg=1,global%nRegions
166 ilev = regions(ireg)%currLevel
172 ndim = ijkend - ijkbeg + 1
176 IF (regions(ireg)%procid==global%myProcid .OR. &
177 global%myProcid==masterproc)
THEN
178 ALLOCATE( tavfile(allnstat,ndim),stat=errorflag )
179 global%error = errorflag
180 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
187 IF (regions(ireg)%procid == global%myProcid)
THEN
188 IF (global%mixtNStat > 0) mixttav => regions(ireg)%levels(ilev)%mixt%tav
190 IF (global%turbNStat > 0)
THEN
191 IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
192 (regions(ireg)%mixtInput%turbModel /= turb_model_none))
THEN
193 turbtav => regions(ireg)%levels(ilev)%turb%tav
195 ALLOCATE( turbtav(global%turbNStat,ndim) )
206 ijk = indijk(
i,
j,
k,ioff,ijoff)
207 DO l=1,global%mixtNStat
208 tavfile(l,
n) = mixttav(l,ijk)
211 DO l=1,global%turbNStat
212 tavfile(global%mixtNStat+l,
n) = turbtav(l,ijk)
220 IF (zeroturb)
DEALLOCATE( turbtav )
224 IF (global%myProcid == masterproc)
THEN
226 ivar(2,1) = regions(ireg)%levels(ilev)%grid%ipc
227 ivar(3,1) = regions(ireg)%levels(ilev)%grid%jpc
228 ivar(4,1) = regions(ireg)%levels(ilev)%grid%kpc
229 ivar(5,1) = regions(ireg)%nDumCells
235 IF (global%myProcid == masterproc)
THEN
237 IF (regions(ireg)%procid /= masterproc)
THEN
238 CALL mpi_recv( tavfile,allnstat*ndim,mpi_rfreal, &
239 regions(ireg)%procid,ireg, &
240 global%mpiComm,
status,global%mpierr )
241 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
245 allnstat,ndim,tavfile )
249 IF (regions(ireg)%procid == global%myProcid)
THEN
250 CALL mpi_send( tavfile,allnstat*ndim,mpi_rfreal,masterproc, &
251 ireg,global%mpiComm,global%mpierr )
252 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
257 IF (
ALLOCATED(tavfile))
THEN
258 DEALLOCATE( tavfile,stat=errorflag )
259 global%error = errorflag
260 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
267 IF (global%myProcid == masterproc)
THEN
268 CLOSE(if_stat,iostat=errorflag)
269 global%error = errorflag
270 IF (global%error /= 0) &
271 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 idcend
subroutine rflo_writedatafileint(global, fileId, form, nDim1, nDim2, ivar)
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_writestat(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 rflo_writedatafilereal(global, fileId, form, nDim1, nDim2, var)
subroutine deregisterfunction(global)