70 CHARACTER(CHRLEN) :: errorstring,ifilename,sectionstring,rcsidentstring, &
71 timestring1,timestring2
72 INTEGER :: errorflag,icont,ifile,ifl,imass,ipatch,ivars,
j,loopcounter,ncont, &
73 npcls,npclsexpected,nvars,nvarsexpected,precactual,precexpected, &
74 rangeactual,rangeexpected
75 INTEGER,
DIMENSION(:,:),
POINTER :: paiv
76 REAL(RFREAL) :: currenttime
77 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: parv,pcv
78 TYPE(t_grid),
POINTER :: pgrid
80 TYPE(t_patch),
POINTER :: ppatch
81 TYPE(t_plag),
POINTER :: pplag
88 TYPE(t_region
),
POINTER :: pregion
95 '$RCSfile: PLAG_RFLU_ReadSolutionBinary.F90,v $ $Revision: 1.6 $'
97 global => pregion%global
100 'PLAG_RFLU_ReadSolutionBinary.F90')
102 IF ( global%myProcid == masterproc .AND. &
103 global%verbLevel > verbose_none )
THEN
104 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading binary particle file...'
108 pregion%iRegionGlobal,global%currentTime, &
112 OPEN(ifile,file=ifilename,
form=
"UNFORMATTED",
status=
"OLD",iostat=errorflag)
113 global%error = errorflag
114 IF ( global%error /= err_none )
THEN
115 CALL
errorstop(global,err_file_open,__line__,ifilename)
122 IF ( global%myProcid == masterproc .AND. &
123 global%verbLevel > verbose_low )
THEN
124 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
127 READ(ifile) sectionstring
128 IF ( trim(sectionstring) /=
'# ROCFLU particle file' )
THEN
129 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
136 READ(ifile) sectionstring
137 IF ( trim(sectionstring) /=
'# Precision and range' )
THEN
138 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
142 rangeexpected = range(1.0_rfreal)
144 READ(ifile) precactual,rangeactual
145 IF ( precactual < precexpected .OR. rangeactual < rangeexpected )
THEN
146 CALL
errorstop(global,err_prec_range,__line__)
153 READ(ifile) sectionstring
154 IF ( trim(sectionstring) /=
'# Physical time' )
THEN
155 CALL
errorstop(global,err_invalid_marker,__line__,ifilename)
158 READ(ifile) currenttime
161 IF ( global%flowType == flow_unsteady )
THEN
162 IF ( global%currentTime < 0.0_rfreal )
THEN
163 global%currentTime = currenttime
165 WRITE(timestring1,
'(1PE11.5)') global%currentTime
166 WRITE(timestring2,
'(1PE11.5)') currenttime
167 IF ( trim(timestring1) /= trim(timestring2) )
THEN
168 CALL
errorstop(global,err_time_solution,__line__,trim(ifilename))
178 pgrid => pregion%grid
179 pplag => pregion%plag
181 ncont = pregion%plagInput%nCont
184 npclsexpected = pplag%nPcls
186 READ(ifile) sectionstring
187 IF ( trim(sectionstring) /=
'# Dimensions' )
THEN
188 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
191 READ(ifile) npcls,nvars
193 IF ( npcls /= npclsexpected )
THEN
194 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',npcls, &
195 'but expected:',npclsexpected
196 CALL
errorstop(global,err_plag_invalid_npcls,__line__,errorstring)
199 IF ( nvars /= nvarsexpected )
THEN
200 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',nvars, &
201 'but expected:',nvarsexpected
202 CALL
errorstop(global,err_invalid_nvars,__line__)
214 loopcounter = loopcounter + 1
216 READ(ifile) sectionstring
218 SELECT CASE ( trim(sectionstring) )
224 CASE (
'# Particle x-momentum' )
225 IF ( global%myProcid == masterproc .AND. &
226 global%verbLevel > verbose_low )
THEN
227 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle x-momentum...'
230 pcv => pregion%plag%cv
233 READ(ifile) (pcv(cv_plag_xmom,
j),
j=1,pplag%nPcls)
239 CASE (
'# Particle y-momentum' )
240 IF ( global%myProcid == masterproc .AND. &
241 global%verbLevel > verbose_low )
THEN
242 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle y-momentum...'
245 pcv => pregion%plag%cv
248 READ(ifile) (pcv(cv_plag_ymom,
j),
j=1,pplag%nPcls)
254 CASE (
'# Particle z-momentum' )
255 IF ( global%myProcid == masterproc .AND. &
256 global%verbLevel > verbose_low )
THEN
257 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle z-momentum...'
260 pcv => pregion%plag%cv
263 READ(ifile) (pcv(cv_plag_zmom,
j),
j=1,pplag%nPcls)
269 CASE (
'# Particle energy' )
270 IF ( global%myProcid == masterproc .AND. &
271 global%verbLevel > verbose_low )
THEN
272 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle energy...'
275 pcv => pregion%plag%cv
278 READ(ifile) (pcv(cv_plag_ener,
j),
j=1,pplag%nPcls)
284 CASE (
'# Particle x-location' )
285 IF ( global%myProcid == masterproc .AND. &
286 global%verbLevel > verbose_low )
THEN
287 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle x-location...'
290 pcv => pregion%plag%cv
293 READ(ifile) (pcv(cv_plag_xpos,
j),
j=1,pplag%nPcls)
299 CASE (
'# Particle y-location' )
300 IF ( global%myProcid == masterproc .AND. &
301 global%verbLevel > verbose_low )
THEN
302 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle y-location...'
305 pcv => pregion%plag%cv
308 READ(ifile) (pcv(cv_plag_ypos,
j),
j=1,pplag%nPcls)
314 CASE (
'# Particle z-location' )
315 IF ( global%myProcid == masterproc .AND. &
316 global%verbLevel > verbose_low )
THEN
317 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle z-location...'
320 pcv => pregion%plag%cv
323 READ(ifile) (pcv(cv_plag_zpos,
j),
j=1,pplag%nPcls)
329 CASE (
'# Particle vapor energy' )
330 IF ( global%myProcid == masterproc .AND. &
331 global%verbLevel > verbose_low )
THEN
332 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle vapor energy...'
335 pcv => pregion%plag%cv
338 READ(ifile) (pcv(cv_plag_enervapor,
j),
j=1,pplag%nPcls)
344 CASE (
'# Particle mass' )
345 IF ( global%myProcid == masterproc .AND. &
346 global%verbLevel > verbose_low )
THEN
347 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle mass...'
350 pcv => pregion%plag%cv
352 IF ( icont == 0 )
THEN
357 imass = pplag%cvPlagMass(icont)
359 READ(ifile) (pcv(imass,
j),
j=1,pplag%nPcls)
365 CASE (
'# Particle superloading' )
366 IF ( global%myProcid == masterproc .AND. &
367 global%verbLevel > verbose_low )
THEN
368 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle superloading...'
371 parv => pregion%plag%arv
374 READ(ifile) (parv(arv_plag_spload,
j),
j=1,pplag%nPcls)
380 CASE (
'# Particle initial identifier' )
381 IF ( global%myProcid == masterproc .AND. &
382 global%verbLevel > verbose_low )
THEN
383 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle initial identifier...'
386 paiv => pregion%plag%aiv
389 READ(ifile) (paiv(aiv_plag_pidini,
j),
j=1,pplag%nPcls)
395 CASE (
'# Particle initial region' )
396 IF ( global%myProcid == masterproc .AND. &
397 global%verbLevel > verbose_low )
THEN
398 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle initial region...'
401 paiv => pregion%plag%aiv
404 READ(ifile) (paiv(aiv_plag_regini,
j),
j=1,pplag%nPcls)
410 CASE (
'# Particle cell' )
411 IF ( global%myProcid == masterproc .AND. &
412 global%verbLevel > verbose_low )
THEN
413 WRITE(stdout,
'(A,3X,A)') solver_name,
'Particle cell...'
416 paiv => pregion%plag%aiv
419 READ(ifile) (paiv(aiv_plag_icells,
j),
j=1,pplag%nPcls)
425 CASE (
'# Patch data' )
426 IF ( global%myProcid == masterproc .AND. &
427 global%verbLevel > verbose_low )
THEN
428 WRITE(stdout,
'(A,3X,A)') solver_name,
'Patch data...'
431 DO ipatch = 1,pgrid%nPatches
432 ppatch => pregion%patches(ipatch)
434 IF ( (ppatch%bcType >= bc_injection .AND. ppatch%bcType <= bc_injection + bc_range) .OR. &
435 (ppatch%bcType >= bc_inflow .AND. ppatch%bcType <= bc_inflow + bc_range) )
THEN
436 ptileplag => ppatch%tilePlag
438 DO ifl = 1,ppatch%nBFaces
439 READ(ifile) ptileplag%cv(cv_tile_momnrm,ifl), &
440 ptileplag%cv(cv_tile_ener ,ifl)
444 imass = ptileplag%cvTileMass(icont)
445 READ(ifile) (ptileplag%cv(imass,ifl), &
446 ifl=1,ppatch%nBFaces)
449 DO ifl = 1,ppatch%nBFaces
450 READ(ifile) ptileplag%dv(dv_tile_countdown,ifl), &
451 ptileplag%dv(dv_tile_diam ,ifl), &
452 ptileplag%dv(dv_tile_spload ,ifl)
462 IF ( global%myProcid == masterproc .AND. &
463 global%verbLevel > verbose_low )
THEN
464 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
474 IF ( global%verbLevel > verbose_low )
THEN
475 WRITE(stdout,
'(A,3X,A)') solver_name,sectionstring
478 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
486 IF ( loopcounter >= limit_infinite_loop )
THEN
487 CALL
errorstop(global,err_infinite_loop,__line__)
496 IF ( ivars /= nvars )
THEN
497 CALL
errorstop(global,err_invalid_nvars,__line__)
504 CLOSE(ifile,iostat=errorflag)
505 global%error = errorflag
506 IF ( global%error /= err_none )
THEN
507 CALL
errorstop(global,err_file_close,__line__,ifilename)
510 IF ( global%myProcid == masterproc .AND. &
511 global%verbLevel > verbose_none )
THEN
512 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading binary particle file done.'
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine plag_rflu_readsolutionbinary(pRegion)
**********************************************************************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 buildfilenameunsteady(global, dest, ext, id, tm, fileName)