73 CHARACTER(CHRLEN),
PRIVATE :: RCSIdentString = &
74 '$RCSfile: PLAG_ModDimensions.F90,v $ $Revision: 1.7 $'
113 TYPE(t_region
),
POINTER :: regions(:)
119 INTEGER :: errorflag,ireg,iregglobal,npclsglobal,npclslocal
122 TYPE(t_region
),
POINTER :: pregion
123 TYPE(t_plag),
POINTER :: pplag
129 global => regions(0)%global
132 'PLAG_ModDimensions.F90')
140 DO ireg = 0,global%nRegionsLocal
141 pregion => regions(ireg)
143 pregion%plag%nPclsGlobal = 0
152 DO ireg = 1,global%nRegionsLocal
153 pregion => regions(ireg)
155 npclslocal = npclslocal + pregion%plag%nPcls
167 CALL mpi_allreduce(npclslocal,npclsglobal,1,mpi_integer,mpi_sum, &
168 global%mpiComm,errorflag )
169 global%error = errorflag
170 IF ( global%error /= err_none )
THEN
171 CALL
errorstop(global,err_mpi_trouble,__line__)
179 DO ireg = 0,global%nRegionsLocal
180 pregion => regions(ireg)
182 pregion%plag%nPclsGlobal = npclsglobal
185 IF ( global%myProcid == masterproc )
THEN
186 regions(0)%plag%nPcls = regions(0)%plag%nPclsGlobal
188 regions(0)%plag%nPcls = crazy_value_int
233 TYPE(t_region
),
POINTER :: pregion
245 global => pregion%global
248 'PLAG_ModDimensions.F90')
254 IF ( global%verbLevel > verbose_none )
THEN
255 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing number of particles...'
256 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
257 pregion%iRegionGlobal
258 IF ( global%flowType == flow_unsteady )
THEN
259 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
263 WRITE(stdout,
'(A,3X,A,9X,I8)') solver_name,
'Number of particles:', &
265 WRITE(stdout,
'(A,3X,A,1X,I8)') solver_name,
'Maximum number of '// &
266 'particles:',pregion%plag%nPclsMax
268 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing number of particles done.'
313 TYPE(t_region
),
POINTER :: pregion
325 global => pregion%global
328 'PLAG_ModDimensions.F90')
334 IF ( global%verbLevel > verbose_none )
THEN
335 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing total number of '// &
337 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
338 pregion%iRegionGlobal
339 IF ( global%flowType == flow_unsteady )
THEN
340 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
344 WRITE(stdout,
'(A,3X,A,1X,I8)') solver_name,
'Number of particles:', &
345 pregion%plag%nPclsGlobal
347 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing total number of '// &
397 TYPE(t_region
),
POINTER :: pregion
403 CHARACTER(CHRLEN) :: errorstring,ifilename,rcsidentstring,sectionstring, &
404 timestring1,timestring2
405 INTEGER :: errorflag,dummy,ipatch,ifile,loopcounter,ncont,npclsmax
406 REAL(RFREAL) :: currenttime
407 TYPE(t_grid),
POINTER :: pgrid
414 global => pregion%global
417 'PLAG_ModDimensions.F90')
419 IF ( global%myProcid == masterproc .AND. &
420 global%verbLevel > verbose_none )
THEN
421 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading particle dimensions...'
430 IF ( global%flowType == flow_unsteady )
THEN
432 currenttime = global%currentTime
434 IF ( global%timeStamp > 0.0_rfreal )
THEN
435 global%warnCounter = global%warnCounter + 1
437 IF ( global%myProcid == masterproc .AND. &
438 global%verbLevel > verbose_none )
THEN
439 WRITE(stdout,
'(A,3X,A,1X,A)') solver_name,
'*** WARNING ***', &
440 'Hard-code - read file from time zero.'
444 currenttime = 0.0_rfreal
448 IF ( pregion%iRegionGlobal == 0 )
THEN
449 currenttime = 0.0_rfreal
454 pregion%iRegionGlobal,currenttime, &
457 IF ( global%myProcid == masterproc .AND. &
458 global%verbLevel > verbose_none )
THEN
459 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
460 pregion%iRegionGlobal
461 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
466 pregion%iRegionGlobal,ifilename)
468 IF ( global%myProcid == masterproc .AND. &
469 global%verbLevel > verbose_none )
THEN
470 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
471 pregion%iRegionGlobal
479 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD", &
481 global%error = errorflag
482 IF ( global%error /= err_none )
THEN
483 CALL
errorstop(global,err_file_open,__line__,ifilename)
490 IF ( global%myProcid == masterproc .AND. &
491 global%verbLevel > verbose_low )
THEN
492 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
495 READ(ifile,
'(A)') sectionstring
496 IF ( trim(sectionstring) /=
'# ROCPART dimensions file' )
THEN
497 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
504 pgrid => pregion%grid
509 loopcounter = loopcounter + 1
511 READ(ifile,
'(A)') sectionstring
513 SELECT CASE ( trim(sectionstring) )
519 CASE (
'# Actual number of particles' )
520 IF ( global%myProcid == masterproc .AND. &
521 global%verbLevel > verbose_low )
THEN
522 WRITE(stdout,
'(A,3X,A)') solver_name,
'Actual number of particles...'
525 READ(ifile,
'(I8)') pregion%plag%nPcls
531 CASE (
'# Maximum number of particles' )
532 IF ( global%myProcid == masterproc .AND. &
533 global%verbLevel > verbose_low )
THEN
534 WRITE(stdout,
'(A,3X,A)') solver_name,
'Maximum number of particles...'
537 READ(ifile,
'(I8)') pregion%plag%nPclsMax
543 CASE (
'# Number of constituents' )
544 IF ( global%myProcid == masterproc .AND. &
545 global%verbLevel > verbose_low )
THEN
546 WRITE(stdout,
'(A,3X,A)') solver_name,
'Number of constituents...'
549 READ(ifile,
'(I8)') ncont
551 IF ( ncont /= pregion%plagInput%nCont )
THEN
552 WRITE(errorstring,
'(A,1X,I2,1X,A,1X,I2)')
'Specified:',ncont, &
553 'but expected:',pregion%plagInput%nCont
554 CALL
errorstop(global,err_plag_ncont_invalid,__line__)
561 CASE (
'# Next particle identifier' )
562 IF ( global%myProcid == masterproc .AND. &
563 global%verbLevel > verbose_low )
THEN
564 WRITE(stdout,
'(A,3X,A)') solver_name,
'Next particle identifier...'
567 READ(ifile,
'(I8)') pregion%plag%nextIdNumber
574 IF ( global%myProcid == masterproc .AND. &
575 global%verbLevel > verbose_low )
THEN
576 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
586 IF ( global%verbLevel > verbose_low )
THEN
587 WRITE(stdout,
'(A,3X,A)') solver_name,sectionstring
590 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
598 IF ( loopcounter >= limit_infinite_loop )
THEN
599 CALL
errorstop(global,err_infinite_loop,__line__)
608 CLOSE(ifile,iostat=errorflag)
609 global%error = errorflag
610 IF ( global%myProcid == masterproc .AND. &
611 global%error /= err_none )
THEN
612 CALL
errorstop(global,err_file_close,__line__,ifilename)
619 IF ( global%myProcid == masterproc .AND. &
620 global%verbLevel > verbose_none )
THEN
621 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading particle dimensions done.'
662 INTEGER,
INTENT(IN) :: npcls
663 TYPE(t_region
),
POINTER :: pregion
675 global => pregion%global
678 'PLAG_ModDimensions.F90')
684 pregion%plag%nPcls = npcls
728 TYPE(t_region
),
POINTER :: pregion
734 INTEGER :: npcls,npclsmax
735 REAL(RFREAL),
PARAMETER :: plag_realloc_fact = 1.20_rfreal
742 global => pregion%global
745 'PLAG_ModDimensions.F90')
751 npcls = pregion%plag%nPcls
752 npclsmax = pregion%plag%nPclsMax
759 npclsmax = nint(plag_realloc_fact*
REAL(npcls,kind=rfreal))
765 pregion%plag%nPclsMax =
max(npclsmax,npcls_tot_min)
810 TYPE(t_region
),
POINTER :: pregion
816 CHARACTER(CHRLEN) :: ifilename,rcsidentstring,sectionstring, &
817 timestring1,timestring2
818 INTEGER :: errorflag,dummy,ifile
819 REAL(RFREAL) :: currenttime
820 TYPE(t_grid),
POINTER :: pgrid
827 global => pregion%global
830 'PLAG_ModDimensions.F90')
832 IF ( global%myProcid == masterproc .AND. &
833 global%verbLevel > verbose_none )
THEN
834 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing particle dimensions...'
843 IF ( global%flowType == flow_unsteady )
THEN
845 currenttime = global%currentTime
847 IF ( global%timeStamp > 0.0_rfreal )
THEN
848 global%warnCounter = global%warnCounter + 1
850 IF ( global%myProcid == masterproc .AND. &
851 global%verbLevel > verbose_none )
THEN
852 WRITE(stdout,
'(A,3X,A,1X,A)') solver_name,
'*** WARNING ***', &
853 'Hard-code - read file from time zero.'
857 currenttime = 0.0_rfreal
860 pregion%iRegionGlobal,currenttime, &
863 IF ( global%myProcid == masterproc .AND. &
864 global%verbLevel > verbose_none )
THEN
865 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
866 pregion%iRegionGlobal
867 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
872 pregion%iRegionGlobal,ifilename)
874 IF ( global%myProcid == masterproc .AND. &
875 global%verbLevel > verbose_none )
THEN
876 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
877 pregion%iRegionGlobal
885 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"UNKNOWN", &
887 global%error = errorflag
888 IF ( global%error /= err_none )
THEN
889 CALL
errorstop(global,err_file_open,__line__,ifilename)
896 IF ( global%myProcid == masterproc .AND. &
897 global%verbLevel > verbose_low )
THEN
898 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
901 sectionstring =
'# ROCPART dimensions file'
902 WRITE(ifile,
'(A)') trim(sectionstring)
908 sectionstring =
'# Actual number of particles'
909 WRITE(ifile,
'(A)') trim(sectionstring)
910 WRITE(ifile,
'(I8)') pregion%plag%nPcls
912 sectionstring =
'# Maximum number of particles'
913 WRITE(ifile,
'(A)') trim(sectionstring)
914 WRITE(ifile,
'(I8)') pregion%plag%nPclsMax
916 sectionstring =
'# Number of constituents'
917 WRITE(ifile,
'(A)') trim(sectionstring)
918 WRITE(ifile,
'(I8)') pregion%plagInput%nCont
920 sectionstring =
'# Next particle identifier'
921 WRITE(ifile,
'(A)') trim(sectionstring)
922 WRITE(ifile,
'(I8)') pregion%plag%nextIdNumber
928 IF ( global%myProcid == masterproc .AND. &
929 global%verbLevel > verbose_low )
THEN
930 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
933 sectionstring =
'# End'
934 WRITE(ifile,
'(A)') trim(sectionstring)
940 CLOSE(ifile,iostat=errorflag)
941 global%error = errorflag
942 IF ( global%myProcid == masterproc .AND. &
943 global%error /= err_none )
THEN
944 CALL
errorstop(global,err_file_close,__line__,ifilename)
951 IF ( global%myProcid == masterproc .AND. &
952 global%verbLevel > verbose_none )
THEN
953 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing dimensions done.'
subroutine, public plag_setdimensions(pRegion, nPcls)
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
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, public plag_rflu_readdimensions(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, public plag_setmaxdimensions(pRegion)
subroutine, public plag_printnpclsglobal(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public plag_printdimensions(pRegion)
subroutine, public plag_rflu_writedimensions(pRegion)
subroutine deregisterfunction(global)
subroutine, public plag_calcnpclsglobal(regions)
subroutine buildfilenameunsteady(global, dest, ext, id, tm, fileName)