64 TYPE(t_region
),
POINTER :: regions(:)
67 INTEGER ::
i, icont, ipatch, ireg
70 CHARACTER(CHRLEN+17) :: fname
71 CHARACTER(CHRLEN) :: rcsidentstring,
msg, timestring
74 INTEGER ::
status(mpi_status_size)
76 INTEGER,
PARAMETER :: one = 1
77 INTEGER :: bctype, errorflag, ilev, iregfile,
n, n1, n2, naiv, narv, &
78 ncont, ncv, ncvtile, ndimplag, ndimtile, ndvtile,ntiles, &
80 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) :: aivfile, ivar
81 INTEGER,
POINTER,
DIMENSION(:) :: pcvplagmass, pcvtilemass
82 INTEGER,
POINTER,
DIMENSION(:,:) :: paiv
84 REAL(RFREAL),
ALLOCATABLE,
DIMENSION(:,:) :: arvfile, cvfile, dvfile, rvar
85 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: parv, pcv, pcvtile, pdvtile
86 REAL(RFREAL) :: timediff
88 TYPE(t_patch),
POINTER :: ppatch
89 TYPE(t_plag),
POINTER :: pplag
95 rcsidentstring =
'$RCSfile: PLAG_ReadSolution.F90,v $ $Revision: 1.7 $'
97 global => regions(1)%global
100 'PLAG_ReadSolution.F90' )
102 IF (.NOT. global%plagUsed) goto 999
104 IF ( global%myProcid == masterproc .AND. &
105 global%verbLevel > verbose_none )
THEN
106 WRITE(stdout,
'(A,3X,A)') solver_name,
'Reading PLAG solution file...'
111 ALLOCATE( ivar(3,1),stat=errorflag )
112 global%error = errorflag
113 IF (global%error /= err_none)
THEN
114 CALL
errorstop( global,err_allocate,__line__,
'ivar' )
117 ALLOCATE( rvar(1,1),stat=errorflag )
118 global%error = errorflag
119 IF (global%error /= err_none)
THEN
120 CALL
errorstop( global,err_allocate,__line__,
'rvar' )
125 IF (global%flowType == flow_unsteady)
THEN
126 WRITE(timestring,
'(1PE11.5)') global%timeStamp
128 WRITE(timestring,
'(1PE11.5)') 0._rfreal
133 IF (global%myProcid == masterproc)
THEN
135 IF (global%solutFormat == format_ascii)
THEN
136 IF( global%currentTime == 0.0_rfreal)
THEN
137 WRITE(fname,
'(A,1PE11.5)') &
138 trim(global%inDir)//trim(global%casename)//
'.plag_sola_',global%timeStamp
139 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
141 WRITE(fname,
'(A,1PE11.5)') &
142 trim(global%outDir)//trim(global%casename)//
'.plag_sola_',global%timeStamp
143 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
145 ELSE IF (global%solutFormat == format_binary)
THEN
146 WRITE(fname,
'(A,1PE11.5)') &
147 trim(global%inDir)//trim(global%casename)//
'.plag_solb_', global%timeStamp
148 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
151 global%error = errorflag
152 IF (global%error /= err_none)
THEN
153 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
160 IF (global%myProcid == masterproc)
THEN
165 CALL mpi_bcast( rvar,1,mpi_rfreal,masterproc,global%mpiComm,global%mpierr )
166 IF (global%mpierr /= err_none)
THEN
167 CALL
errorstop( global,err_mpi_trouble,__line__ )
171 IF (global%currentTime>0._rfreal)
THEN
172 timediff = abs(global%currentTime - rvar(1,1))
173 IF (timediff.gt.1.0e-12)
THEN
174 WRITE(
msg,1000) rvar(1,1),global%currentTime
175 CALL
errorstop( global,err_time_solution, __line__,
msg//
' File: '//trim(fname) )
181 DO ireg=1,global%nRegions
185 ilev = regions(ireg)%currLevel
187 ncont = regions(ireg)%plagInput%nCont
190 ncv = cv_plag_last+ncont
192 pplag => regions(ireg)%levels(ilev)%plag
196 pcvplagmass => pplag%cvPlagMass
200 IF (global%myProcid == masterproc)
THEN
204 nextidnumber = ivar(3,1)
206 IF (iregfile /= ireg) &
207 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
213 CALL mpi_bcast( ndimplag,1,mpi_integer,masterproc,global%mpiComm,global%mpierr )
214 IF (global%mpierr /= err_none)
THEN
215 CALL
errorstop( global,err_mpi_trouble,__line__ )
222 CALL mpi_bcast( nextidnumber,1,mpi_integer,masterproc,global%mpiComm,global%mpierr )
223 IF (global%mpierr /= err_none)
THEN
224 CALL
errorstop( global,err_mpi_trouble,__line__ )
230 SELECT CASE (ndimplag)
235 IF (global%myProcid == masterproc)
THEN
237 ALLOCATE( aivfile(naiv,ndimplag),stat=errorflag )
238 global%error = errorflag
239 IF (global%error /= err_none)
THEN
240 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
244 naiv,ndimplag,aivfile )
247 IF (regions(ireg)%procid /= masterproc)
THEN
248 CALL mpi_send( aivfile,naiv*ndimplag,mpi_integer, &
249 regions(ireg)%procid,ireg, &
250 global%mpiComm,global%mpierr )
251 IF (global%mpierr /= err_none )
THEN
252 CALL
errorstop( global,err_mpi_trouble,__line__ )
260 IF (regions(ireg)%procid == global%myProcid)
THEN
261 ALLOCATE( aivfile(naiv,ndimplag),stat=errorflag )
262 global%error = errorflag
263 IF (global%error /= err_none)
THEN
264 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
268 CALL mpi_recv( aivfile,naiv*ndimplag,mpi_integer,masterproc,ireg, &
269 global%mpiComm,
status,global%mpierr )
270 IF (global%mpierr /= err_none)
THEN
271 CALL
errorstop( global,err_mpi_trouble,__line__ )
280 IF (regions(ireg)%procid == global%myProcid)
THEN
283 pplag%nPcls = ndimplag
284 pplag%nextIdNumber = nextidnumber
289 paiv(aiv_plag_pidini,
i) = aivfile(1,
n)
290 paiv(aiv_plag_regini,
i) = aivfile(2,
n)
291 paiv(aiv_plag_regcrt,
i) = aivfile(3,
n)
292 paiv(aiv_plag_icells,
i) = aivfile(4,
n)
293 paiv(aiv_plag_indexi,
i) = aivfile(5,
n)
294 paiv(aiv_plag_indexj,
i) = aivfile(6,
n)
295 paiv(aiv_plag_indexk,
i) = aivfile(7,
n)
296 paiv(aiv_plag_burnstat,
i) = aivfile(8,
n)
297 paiv(aiv_plag_status,
i) = aivfile(9,
n)
301 IF (
ALLOCATED(aivfile))
THEN
302 DEALLOCATE( aivfile,stat=errorflag )
303 global%error = errorflag
304 IF (global%error /= err_none)
THEN
305 CALL
errorstop( global,err_deallocate,__line__,
'aivFile' )
311 IF (global%myProcid == masterproc)
THEN
312 ALLOCATE( arvfile(narv,ndimplag),stat=errorflag )
313 global%error = errorflag
314 IF (global%error /= err_none)
THEN
315 CALL
errorstop( global,err_allocate,__line__,
'aivFile' )
318 narv,ndimplag,arvfile )
321 IF (regions(ireg)%procid /= masterproc)
THEN
322 CALL mpi_send( arvfile,narv*ndimplag,mpi_rfreal, &
323 regions(ireg)%procid,ireg, &
324 global%mpiComm,global%mpierr )
325 IF (global%mpierr /= err_none )
THEN
326 CALL
errorstop( global,err_mpi_trouble,__line__ )
334 IF (regions(ireg)%procid == global%myProcid)
THEN
335 ALLOCATE( arvfile(narv,ndimplag),stat=errorflag )
336 global%error = errorflag
337 IF (global%error /= err_none)
THEN
338 CALL
errorstop( global,err_allocate,__line__,
'arvFile' )
342 CALL mpi_recv( arvfile,narv*ndimplag,mpi_rfreal,masterproc,ireg, &
343 global%mpiComm,
status,global%mpierr )
344 IF (global%mpierr /= err_none)
THEN
345 CALL
errorstop( global,err_mpi_trouble,__line__ )
354 IF (regions(ireg)%procid == global%myProcid)
THEN
358 parv(arv_plag_spload,
i) = arvfile(1,
n)
359 parv(arv_plag_distot,
i) = arvfile(2,
n)
363 IF (
ALLOCATED(arvfile))
THEN
364 DEALLOCATE( arvfile,stat=errorflag )
365 global%error = errorflag
366 IF (global%error /= err_none)
THEN
367 CALL
errorstop( global,err_deallocate,__line__,
'arvFile' )
373 IF (global%myProcid == masterproc)
THEN
374 ALLOCATE( cvfile(ncv,ndimplag),stat=errorflag )
375 global%error = errorflag
376 IF (global%error /= err_none)
THEN
377 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
381 ncv,ndimplag,cvfile )
384 IF (regions(ireg)%procid /= masterproc)
THEN
385 CALL mpi_send( cvfile,ncv*ndimplag,mpi_rfreal, &
386 regions(ireg)%procid,ireg, &
387 global%mpiComm,global%mpierr )
388 IF (global%mpierr /= err_none )
THEN
389 CALL
errorstop( global,err_mpi_trouble,__line__ )
397 IF (regions(ireg)%procid == global%myProcid)
THEN
398 ALLOCATE( cvfile(ncv,ndimplag),stat=errorflag )
399 global%error = errorflag
400 IF (global%error /= err_none)
THEN
401 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
405 CALL mpi_recv( cvfile,ncv*ndimplag,mpi_rfreal,masterproc,ireg, &
406 global%mpiComm,
status,global%mpierr )
407 IF (global%mpierr /= err_none)
THEN
408 CALL
errorstop( global,err_mpi_trouble,__line__ )
417 IF (regions(ireg)%procid == global%myProcid)
THEN
421 pcv(cv_plag_xmom,
i) = cvfile(1,
n)
422 pcv(cv_plag_ymom,
i) = cvfile(2,
n)
423 pcv(cv_plag_zmom,
i) = cvfile(3,
n)
424 pcv(cv_plag_ener,
i) = cvfile(4,
n)
425 pcv(cv_plag_xpos,
i) = cvfile(5,
n)
426 pcv(cv_plag_ypos,
i) = cvfile(6,
n)
427 pcv(cv_plag_zpos,
i) = cvfile(7,
n)
428 pcv(cv_plag_enervapor,
i) = cvfile(8,
n)
430 pcv(pcvplagmass(icont),
i) = cvfile(cv_plag_last+icont,
n)
435 IF (
ALLOCATED(cvfile))
THEN
436 DEALLOCATE( cvfile,stat=errorflag )
437 global%error = errorflag
438 IF (global%error /= err_none)
THEN
439 CALL
errorstop( global,err_deallocate,__line__,
'cvFile' )
448 DO ireg=1,global%nRegions
452 ilev = regions(ireg)%currLevel
453 ncont = regions(ireg)%plagInput%nCont
454 ncvtile = cv_tile_last+ncont
457 DO ipatch=1,regions(ireg)%nPatches
461 ppatch => regions(ireg)%levels(ilev)%patches(ipatch)
462 bctype = ppatch%bcType
464 IF ( bctype>=bc_injection .AND. bctype<=bc_injection+bc_range )
THEN
468 n1 = abs(ppatch%l1end -ppatch%l1beg ) + 1
469 n2 = abs(ppatch%l2end -ppatch%l2beg ) + 1
474 ptileplag => ppatch%tilePlag
475 pcvtile => ptileplag%cv
476 pcvtilemass => ptileplag%cvTileMass
477 pdvtile => ptileplag%dv
481 IF (global%myProcid == masterproc)
THEN
487 IF (iregfile /= ireg) &
488 CALL
errorstop( global,err_region_number,__line__, &
489 'File: '//trim(fname) )
491 IF (ndimtile > ntiles) &
492 CALL
errorstop( global,err_plag_tilesize,__line__, &
493 'File: '//trim(fname) )
499 CALL mpi_bcast( ndimtile,1,mpi_integer,masterproc,global%mpiComm,global%mpierr )
500 IF (global%mpierr /= err_none)
THEN
501 CALL
errorstop( global,err_mpi_trouble,__line__ )
507 SELECT CASE (ndimtile)
512 IF (global%myProcid == masterproc)
THEN
513 ALLOCATE( cvfile(ncvtile,ndimtile),stat=errorflag )
514 global%error = errorflag
515 IF (global%error /= err_none)
THEN
516 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
520 ncvtile,ndimtile,cvfile )
523 IF (regions(ireg)%procid /= masterproc)
THEN
524 CALL mpi_send( cvfile,ncvtile*ndimtile,mpi_rfreal, &
525 regions(ireg)%procid,ireg, &
526 global%mpiComm,global%mpierr )
527 IF (global%mpierr /= err_none )
THEN
528 CALL
errorstop( global,err_mpi_trouble,__line__ )
536 IF (regions(ireg)%procid == global%myProcid)
THEN
537 ALLOCATE( cvfile(ncvtile,ndimtile),stat=errorflag )
538 global%error = errorflag
539 IF (global%error /= err_none)
THEN
540 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
544 CALL mpi_recv( cvfile,ncvtile*ndimtile,mpi_rfreal,&
546 global%mpiComm,
status,global%mpierr )
547 IF (global%mpierr /= err_none)
THEN
548 CALL
errorstop( global,err_mpi_trouble,__line__ )
557 IF (regions(ireg)%procid == global%myProcid)
THEN
561 pcvtile(cv_tile_momnrm,
i) = cvfile(1,
n)
562 pcvtile(cv_tile_ener,
i) = cvfile(2,
n)
564 pcvtile(pcvtilemass(icont),
i) = cvfile(2+icont,
n)
569 IF (
ALLOCATED(cvfile))
THEN
570 DEALLOCATE( cvfile,stat=errorflag )
571 global%error = errorflag
572 IF (global%error /= err_none)
THEN
573 CALL
errorstop( global,err_deallocate,__line__,
'cvFile' )
579 IF (global%myProcid == masterproc)
THEN
580 ALLOCATE( dvfile(ndvtile,ndimtile),stat=errorflag )
581 global%error = errorflag
582 IF (global%error /= err_none)
THEN
583 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
587 ndvtile,ndimtile,dvfile )
590 IF (regions(ireg)%procid /= masterproc)
THEN
591 CALL mpi_send( dvfile,ndvtile*ndimtile,mpi_rfreal, &
592 regions(ireg)%procid,ireg, &
593 global%mpiComm,global%mpierr )
594 IF (global%mpierr /= err_none )
THEN
595 CALL
errorstop( global,err_mpi_trouble,__line__ )
603 IF (regions(ireg)%procid == global%myProcid)
THEN
604 ALLOCATE( dvfile(ndvtile,ndimtile),stat=errorflag )
605 global%error = errorflag
606 IF (global%error /= err_none)
THEN
607 CALL
errorstop( global,err_allocate,__line__,
'cvFile' )
611 CALL mpi_recv( dvfile,ndvtile*ndimtile,mpi_rfreal,&
613 global%mpiComm,
status,global%mpierr )
614 IF (global%mpierr /= err_none)
THEN
615 CALL
errorstop( global,err_mpi_trouble,__line__ )
624 IF (regions(ireg)%procid == global%myProcid)
THEN
628 pdvtile(dv_tile_countdown,
i) = dvfile(1,
n)
629 pdvtile(dv_tile_diam ,
i) = dvfile(2,
n)
630 pdvtile(dv_tile_spload ,
i) = dvfile(3,
n)
634 IF (
ALLOCATED(dvfile))
THEN
635 DEALLOCATE( dvfile,stat=errorflag )
636 global%error = errorflag
637 IF (global%error /= err_none)
THEN
638 CALL
errorstop( global,err_deallocate,__line__,
'dvFile' )
651 CALL mpi_barrier( global%mpiComm,global%mpierr )
652 IF (global%mpierr /= err_none )
THEN
653 CALL
errorstop( global,err_mpi_trouble,__line__ )
659 DEALLOCATE( ivar,stat=errorflag )
660 global%error = errorflag
661 IF (global%error /= err_none)
THEN
662 CALL
errorstop( global,err_deallocate,__line__,
'ivar' )
665 DEALLOCATE( rvar,stat=errorflag )
666 global%error = errorflag
667 IF (global%error /= err_none)
THEN
668 CALL
errorstop( global,err_deallocate,__line__,
'rvar' )
673 IF (global%myProcid == masterproc)
THEN
674 CLOSE(if_solut,iostat=errorflag)
675 global%error = errorflag
676 IF (global%error /= err_none) &
677 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
680 IF ( global%myProcid == masterproc .AND. &
681 global%verbLevel > verbose_none )
THEN
682 WRITE(stdout,
'(A,3X,A)') solver_name,
'Reading PLAG solution file done...'
688 1000
FORMAT(
'Time in file is= ',1pe12.5,
' but it should be= ',e12.5,
'.')
subroutine plag_readsolution(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)