63 TYPE(t_region
),
POINTER :: regions(:)
66 INTEGER ::
i, icont, ireg
69 CHARACTER(CHRLEN+17) :: fname
70 CHARACTER(CHRLEN) :: rcsidentstring,
msg, timestring
73 INTEGER ::
status(mpi_status_size)
75 INTEGER,
PARAMETER :: one = 1
76 INTEGER :: bctype, errorflag, ilev, iregfile,
n, n1, n2, naiv, narv, &
77 ncont, ncv, ncvtile, ndimplag, ndimplagmax
78 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) :: aivfile, ivar
79 INTEGER,
POINTER,
DIMENSION(:) :: pcvplagmass
80 INTEGER,
POINTER,
DIMENSION(:,:) :: paiv
82 REAL(RFREAL),
ALLOCATABLE,
DIMENSION(:,:) :: arvfile, cvfile, dvfile, rvar
83 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: parv, pcv
85 TYPE(t_patch),
POINTER :: ppatch
86 TYPE(t_plag),
POINTER :: pplag
91 rcsidentstring =
'$RCSfile: PLAG_ReadSolutionFilePost.F90,v $ $Revision: 1.4 $'
93 global => regions(1)%global
96 'PLAG_ReadSolutionFilePost.F90' )
98 IF (.NOT. global%plagUsed) goto 999
100 IF ( global%myProcid == masterproc .AND. &
101 global%verbLevel > verbose_none )
THEN
102 WRITE(stdout,
'(A,3X,A)') solver_name,
'Reading PLAG solution file...'
107 ALLOCATE( ivar(3,1),stat=errorflag )
108 global%error = errorflag
109 IF (global%error /= err_none)
THEN
110 CALL
errorstop( global,err_allocate,__line__,
'ivar' )
113 ALLOCATE( rvar(1,1),stat=errorflag )
114 global%error = errorflag
115 IF (global%error /= err_none)
THEN
116 CALL
errorstop( global,err_allocate,__line__,
'rvar' )
121 IF (global%flowType == flow_unsteady)
THEN
122 WRITE(timestring,
'(1PE11.5)') global%timeStamp
124 WRITE(timestring,
'(1PE11.5)') 0._rfreal
129 IF (global%myProcid == masterproc)
THEN
131 IF (global%solutFormat == format_ascii)
THEN
132 WRITE(fname,
'(A,1PE11.5)') &
133 trim(global%inDir)//trim(global%casename)//
'.plag_sola_',global%timeStamp
134 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
135 ELSE IF (global%solutFormat == format_binary)
THEN
136 WRITE(fname,
'(A,1PE11.5)') &
137 trim(global%inDir)//trim(global%casename)//
'.plag_solb_', global%timeStamp
138 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
141 global%error = errorflag
142 IF (global%error /= err_none)
THEN
143 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
150 IF (global%myProcid == masterproc)
THEN
155 IF ( global%nProcAlloc > 1 )
THEN
156 CALL mpi_bcast( rvar,1,mpi_rfreal,masterproc,global%mpiComm,global%mpierr )
157 IF (global%mpierr /= err_none)
THEN
158 CALL
errorstop( global,err_mpi_trouble,__line__ )
163 IF (global%currentTime>0._rfreal)
THEN
165 IF (abs(global%currentTime-rvar(1,1))/global%currentTime > 1.0e-03_rfreal)
THEN
166 WRITE(
msg,1000) rvar(1,1),global%currentTime
167 CALL
errorstop( global,err_time_solution, __line__,
msg//
' File: '//trim(fname) )
173 DO ireg=1,global%nRegions
177 ilev = regions(ireg)%currLevel
179 ncont = regions(ireg)%plagInput%nCont
182 ncv = cv_plag_last+ncont
186 IF (global%myProcid == masterproc)
THEN
191 IF (iregfile /= ireg) &
192 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
198 IF ( global%nProcAlloc > 1 )
THEN
199 CALL mpi_bcast( ndimplag,1,mpi_integer,masterproc,global%mpiComm,global%mpierr )
200 IF (global%mpierr /= err_none)
THEN
201 CALL
errorstop( global,err_mpi_trouble,__line__ )
206 regions(ireg)%levels(ilev)%plag%nPcls = ndimplag
208 ndimplagmax = regions(ireg)%plagInput%nPclsMax
210 print*,
'PLAG_readSolutionFilePost: iReg, nPcls,nPclsMax = ',ireg,ndimplag,ndimplagmax
212 IF( ndimplag > ndimplagmax)
THEN
213 WRITE(*,*)
'Increase Array size to fit Solution File'
219 SELECT CASE (ndimplag)
224 IF (global%myProcid == masterproc)
THEN
226 ALLOCATE( aivfile(naiv,ndimplag),stat=errorflag )
227 global%error = errorflag
228 IF (global%error /= err_none)
THEN
229 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
233 naiv,ndimplag,aivfile )
236 IF (regions(ireg)%procid /= masterproc)
THEN
237 CALL mpi_send( aivfile,naiv*ndimplag,mpi_integer, &
238 regions(ireg)%procid,ireg, &
239 global%mpiComm,global%mpierr )
240 IF (global%mpierr /= err_none )
THEN
241 CALL
errorstop( global,err_mpi_trouble,__line__ )
249 IF (regions(ireg)%procid == global%myProcid)
THEN
250 ALLOCATE( aivfile(naiv,ndimplag),stat=errorflag )
251 global%error = errorflag
252 IF (global%error /= err_none)
THEN
253 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
257 CALL mpi_recv( aivfile,naiv*ndimplag,mpi_integer,masterproc,ireg, &
258 global%mpiComm,
status,global%mpierr )
259 IF (global%mpierr /= err_none)
THEN
260 CALL
errorstop( global,err_mpi_trouble,__line__ )
269 IF (regions(ireg)%procid == global%myProcid)
THEN
270 pplag => regions(ireg)%levels(ilev)%plag
274 pplag%nPcls = ndimplag
279 paiv(aiv_plag_pidini,
i) = aivfile(1,
n)
280 paiv(aiv_plag_regini,
i) = aivfile(2,
n)
281 paiv(aiv_plag_regcrt,
i) = aivfile(3,
n)
282 paiv(aiv_plag_icells,
i) = aivfile(4,
n)
283 paiv(aiv_plag_indexi,
i) = aivfile(5,
n)
284 paiv(aiv_plag_indexj,
i) = aivfile(6,
n)
285 paiv(aiv_plag_indexk,
i) = aivfile(7,
n)
286 paiv(aiv_plag_burnstat,
i) = aivfile(8,
n)
290 IF (
ALLOCATED(aivfile))
THEN
291 DEALLOCATE( aivfile,stat=errorflag )
292 global%error = errorflag
293 IF (global%error /= err_none)
THEN
294 CALL
errorstop( global,err_deallocate,__line__,
'aivFile' )
300 IF (global%myProcid == masterproc)
THEN
301 ALLOCATE( arvfile(narv,ndimplag),stat=errorflag )
302 global%error = errorflag
303 IF (global%error /= err_none)
THEN
304 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
307 narv,ndimplag,arvfile )
310 IF (regions(ireg)%procid /= masterproc)
THEN
311 CALL mpi_send( arvfile,narv*ndimplag,mpi_rfreal, &
312 regions(ireg)%procid,ireg, &
313 global%mpiComm,global%mpierr )
314 IF (global%mpierr /= err_none )
THEN
315 CALL
errorstop( global,err_mpi_trouble,__line__ )
323 IF (regions(ireg)%procid == global%myProcid)
THEN
324 ALLOCATE( arvfile(narv,ndimplag),stat=errorflag )
325 global%error = errorflag
326 IF (global%error /= err_none)
THEN
327 CALL
errorstop( global,err_allocate,__line__,
'arvFile' )
331 CALL mpi_recv( arvfile,narv*ndimplag,mpi_rfreal,masterproc,ireg, &
332 global%mpiComm,
status,global%mpierr )
333 IF (global%mpierr /= err_none)
THEN
334 CALL
errorstop( global,err_mpi_trouble,__line__ )
343 IF (regions(ireg)%procid == global%myProcid)
THEN
344 pplag => regions(ireg)%levels(ilev)%plag
349 parv(arv_plag_spload,
i) = arvfile(1,
n)
353 IF (
ALLOCATED(arvfile))
THEN
354 DEALLOCATE( arvfile,stat=errorflag )
355 global%error = errorflag
356 IF (global%error /= err_none)
THEN
357 CALL
errorstop( global,err_deallocate,__line__,
'arvFile' )
363 IF (global%myProcid == masterproc)
THEN
364 ALLOCATE( cvfile(ncv,ndimplag),stat=errorflag )
365 global%error = errorflag
366 IF (global%error /= err_none)
THEN
367 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
371 ncv,ndimplag,cvfile )
374 IF (regions(ireg)%procid /= masterproc)
THEN
375 CALL mpi_send( cvfile,ncv*ndimplag,mpi_rfreal, &
376 regions(ireg)%procid,ireg, &
377 global%mpiComm,global%mpierr )
378 IF (global%mpierr /= err_none )
THEN
379 CALL
errorstop( global,err_mpi_trouble,__line__ )
387 IF (regions(ireg)%procid == global%myProcid)
THEN
388 ALLOCATE( cvfile(ncv,ndimplag),stat=errorflag )
389 global%error = errorflag
390 IF (global%error /= err_none)
THEN
391 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
395 CALL mpi_recv( cvfile,ncv*ndimplag,mpi_rfreal,masterproc,ireg, &
396 global%mpiComm,
status,global%mpierr )
397 IF (global%mpierr /= err_none)
THEN
398 CALL
errorstop( global,err_mpi_trouble,__line__ )
407 IF (regions(ireg)%procid == global%myProcid)
THEN
408 pplag => regions(ireg)%levels(ilev)%plag
410 pcvplagmass => pplag%cvPlagMass
411 ncont = regions(ireg)%plagInput%nCont
415 pcv(cv_plag_xmom,
i) = cvfile(1,
n)
416 pcv(cv_plag_ymom,
i) = cvfile(2,
n)
417 pcv(cv_plag_zmom,
i) = cvfile(3,
n)
418 pcv(cv_plag_ener,
i) = cvfile(4,
n)
419 pcv(cv_plag_xpos,
i) = cvfile(5,
n)
420 pcv(cv_plag_ypos,
i) = cvfile(6,
n)
421 pcv(cv_plag_zpos,
i) = cvfile(7,
n)
422 pcv(cv_plag_enervapor,
i) = cvfile(8,
n)
424 pcv(pcvplagmass(icont),
i) = cvfile(cv_plag_last+icont,
n)
429 IF (
ALLOCATED(cvfile))
THEN
430 DEALLOCATE( cvfile,stat=errorflag )
431 global%error = errorflag
432 IF (global%error /= err_none)
THEN
433 CALL
errorstop( global,err_deallocate,__line__,
'cvFile' )
442 DEALLOCATE( ivar,stat=errorflag )
443 global%error = errorflag
444 IF (global%error /= err_none)
THEN
445 CALL
errorstop( global,err_deallocate,__line__,
'ivar' )
448 DEALLOCATE( rvar,stat=errorflag )
449 global%error = errorflag
450 IF (global%error /= err_none)
THEN
451 CALL
errorstop( global,err_deallocate,__line__,
'rvar' )
456 IF (global%myProcid == masterproc)
THEN
457 CLOSE(if_solut,iostat=errorflag)
458 global%error = errorflag
459 IF (global%error /= err_none) &
460 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
466 1000
FORMAT(
'Time in file is= ',1pe12.5,
' but it should be= ',e12.5,
'.')
subroutine plag_readsolutionfilepost(regions)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine rflo_readdatafileint(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 form
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine rflo_readdatafilereal(global, fileId, form, nDim1, nDim2, var)