64 TYPE(t_region
),
POINTER :: regions(:)
67 INTEGER :: ireg,
i,
j,
k,
n
72 CHARACTER(2*CHRLEN+17) :: fname
75 INTEGER ::
status(mpi_status_size)
77 INTEGER :: ilev, iregfile, ipc, jpc, kpc, ndumcells, ioff, ijoff, ijk
79 INTEGER :: ndimc, nrvar, noutsol, globalclass, errorflag
80 INTEGER,
ALLOCATABLE :: ivar(:,:)
82 REAL(RFREAL),
POINTER :: tv(:,:), tcv(:,:), vort(:,:), lens(:)
83 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), solfile(:,:)
87 global => regions(1)%global
90 'TURB_rFLO_WriteSolution.F90' )
96 ALLOCATE( ivar(6,1),stat=errorflag )
97 ALLOCATE( rvar(nrvar,1),stat=errorflag )
98 global%error = errorflag
99 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
103 IF (global%myProcid == masterproc)
THEN
107 IF (global%flowType == flow_unsteady)
THEN
108 IF (global%solutFormat == format_ascii)
THEN
109 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.turba_', &
111 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'unknown', &
113 ELSE IF (global%solutFormat == format_binary)
THEN
114 WRITE(fname,
'(A,1PE11.5)') trim(global%outDir)//trim(global%casename)//
'.turbb_', &
116 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'unknown', &
119 CALL
errorstop( global,err_unknown_format,__line__ )
121 rvar(1,1) = global%currentTime
122 rvar(2,1) = 1._rfreal
127 IF (global%solutFormat == format_ascii)
THEN
128 WRITE(fname,
'(A,I6.6)') trim(global%outDir)//trim(global%casename)//
'.turba_', &
130 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'unknown', &
132 ELSE IF (global%solutFormat == format_binary)
THEN
133 WRITE(fname,
'(A,I6.6)') trim(global%outDir)//trim(global%casename)//
'.turbb_', &
135 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'unknown', &
138 CALL
errorstop( global,err_unknown_format,__line__ )
140 rvar(1,1) = 0._rfreal
141 rvar(2,1) = global%resInit
143 rvar(3,1) = global%esg1Sum
144 rvar(4,1) = global%esg4Sum
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
162 DO ireg=1,global%nRegions
163 IF (regions(ireg)%procid == global%myProcid)
THEN
164 IF (regions(ireg)%turbInput%modelClass == model_les)
THEN
165 globalclass = model_les
170 DO ireg=1,global%nRegions
171 IF (regions(ireg)%procid == global%myProcid)
THEN
172 IF ((regions(ireg)%mixtInput%turbModel == turb_model_sa) .OR. &
173 (regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
174 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa))
THEN
175 globalclass = model_rans
180 DO ireg=1,global%nRegions
184 ilev = regions(ireg)%currLevel
190 ndimc = ijkend - ijkbeg + 1
194 IF (regions(ireg)%procid==global%myProcid .OR. &
195 global%myProcid==masterproc)
THEN
196 noutsol = regions(ireg)%turbInput%nOutField
197 ALLOCATE( solfile(noutsol,ndimc),stat=errorflag )
198 global%error = errorflag
199 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
205 IF (regions(ireg)%procid == global%myProcid)
THEN
206 IF (regions(ireg)%turbInput%modelClass == model_les)
THEN
207 tv => regions(ireg)%levels(ilev)%mixt%tv
213 ijk = indijk(
i,
j,
k,ioff,ijoff)
214 solfile(1,
n) = tv(tv_mixt_muet,ijk)
218 IF (noutsol == 2)
THEN
219 vort => regions(ireg)%levels(ilev)%turb%vort
225 ijk = indijk(
i,
j,
k,ioff,ijoff)
226 solfile(2,
n) =
sqrt( vort(xcoord,ijk)*vort(xcoord,ijk) + &
227 vort(ycoord,ijk)*vort(ycoord,ijk) + &
228 vort(zcoord,ijk)*vort(zcoord,ijk) )
234 IF ((regions(ireg)%mixtInput%turbModel == turb_model_sa) .OR. &
235 (regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
236 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa))
THEN
237 tcv => regions(ireg)%levels(ilev)%turb%cv
243 ijk = indijk(
i,
j,
k,ioff,ijoff)
244 solfile(1,
n) = tcv(cv_sa_nutil,ijk)
248 IF (noutsol == 2)
THEN
249 vort => regions(ireg)%levels(ilev)%turb%vort
255 ijk = indijk(
i,
j,
k,ioff,ijoff)
256 solfile(2,
n) =
sqrt( vort(xcoord,ijk)*vort(xcoord,ijk) + &
257 vort(ycoord,ijk)*vort(ycoord,ijk) + &
258 vort(zcoord,ijk)*vort(zcoord,ijk) )
263 IF (noutsol == 3)
THEN
264 vort => regions(ireg)%levels(ilev)%turb%vort
265 lens => regions(ireg)%levels(ilev)%turb%lens
271 ijk = indijk(
i,
j,
k,ioff,ijoff)
272 solfile(2,
n) =
sqrt( vort(xcoord,ijk)*vort(xcoord,ijk) + &
273 vort(ycoord,ijk)*vort(ycoord,ijk) + &
274 vort(zcoord,ijk)*vort(zcoord,ijk) )
275 solfile(3,
n) = lens(ijk)
285 IF (global%myProcid == masterproc)
THEN
287 ivar(2,1) = regions(ireg)%levels(ilev)%grid%ipc
288 ivar(3,1) = regions(ireg)%levels(ilev)%grid%jpc
289 ivar(4,1) = regions(ireg)%levels(ilev)%grid%kpc
290 ivar(5,1) = regions(ireg)%nDumCells
297 IF (global%myProcid == masterproc)
THEN
299 IF (regions(ireg)%procid /= masterproc)
THEN
300 CALL mpi_recv( solfile,noutsol*ndimc,mpi_rfreal, &
301 regions(ireg)%procid,ireg, &
302 global%mpiComm,
status,global%mpierr )
303 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
310 IF (regions(ireg)%procid == global%myProcid)
THEN
311 CALL mpi_send( solfile,noutsol*ndimc,mpi_rfreal, &
312 masterproc,ireg,global%mpiComm,global%mpierr )
313 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
318 IF (
ALLOCATED(solfile) .eqv. .true.)
THEN
319 DEALLOCATE( solfile,stat=errorflag )
320 global%error = errorflag
321 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
328 IF (global%myProcid == masterproc)
THEN
329 CLOSE(if_solut,iostat=errorflag)
330 global%error = errorflag
331 IF (global%error /= 0) &
332 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)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
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 turb_rflo_writesolution(regions)
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)