72 CHARACTER(CHRLEN) :: RCSIdentString = &
73 '$RCSfile: RFLU_ModColoring.F90,v $ $Revision: 1.7 $'
118 TYPE(t_region
),
POINTER :: pregion,pregionserial
125 TYPE(t_grid),
POINTER :: pgrid
131 global => pregion%global
134 'RFLU_ModColoring.F90')
136 pgrid => pregion%grid
191 TYPE(t_region
),
POINTER :: pregion
197 LOGICAL :: neednewcolor
198 INTEGER :: cntr,errorflag,icg,icg2,icl,iloc,isoc,ncellmembsmin,nsocmax, &
199 offs,rssize,rssizemax
200 INTEGER,
DIMENSION(:),
ALLOCATABLE :: cellmembstemp,
rs
202 TYPE(t_grid),
POINTER :: pgrid
209 global => pregion%global
212 'RFLU_ModColoring.F90')
214 IF ( global%myProcid == masterproc .AND. &
215 global%verbLevel > verbose_none )
THEN
216 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building coloring...'
219 pgrid => pregion%grid
230 pgrid%nSocMax = nsocmax
236 ALLOCATE(
rs(rssizemax),stat=errorflag)
237 global%error = errorflag
238 IF ( global%error /= err_none )
THEN
239 CALL
errorstop(global,err_allocate,__line__,
'rs')
242 ALLOCATE(pgrid%soc(pgrid%nSocMax),stat=errorflag)
243 global%error = errorflag
244 IF ( global%error /= err_none )
THEN
245 CALL
errorstop(global,err_allocate,__line__,
'pGrid%soc')
249 ALLOCATE(pgrid%soc(isoc)%cellMembs(ncellmembsmin),stat=errorflag)
250 IF ( global%error /= err_none )
THEN
251 CALL
errorstop(global,err_allocate,__line__,
'pGrid%soc%cellMembs')
259 DO icg = 1,pgrid%nCells
265 SELECT CASE ( pregion%mixtInput%spaceOrder )
274 CALL
errorstop(global,err_reached_default,__line__)
281 neednewcolor = .true.
283 colorloop:
DO isoc = 1,pgrid%nSoc
291 neednewcolor = .false.
293 rsloop:
DO icl = 1,rssize
296 IF ( pgrid%soc(isoc)%nCellMembs > 0 )
THEN
298 pgrid%soc(isoc)%nCellMembs,icg2,iloc)
300 iloc = element_not_found
303 IF ( iloc == element_not_found )
THEN
306 IF ( isoc /= pgrid%nSoc )
THEN
309 neednewcolor = .true.
320 IF ( (neednewcolor .EQV. .false.) .AND. (cntr == rssize) )
THEN
321 offs = pgrid%soc(isoc)%nCellMembs
325 IF ( (pgrid%soc(isoc)%nCellMembs + rssize) >
SIZE(pgrid%soc(isoc)%cellMembs,1) )
THEN
326 ALLOCATE(cellmembstemp(pgrid%soc(isoc)%nCellMembs),stat=errorflag)
327 global%error = errorflag
328 IF ( global%error /= err_none )
THEN
329 CALL
errorstop(global,err_allocate,__line__,
'cellMembsTemp')
332 DO icl = 1,pgrid%soc(isoc)%nCellMembs
333 cellmembstemp(icl) = pgrid%soc(isoc)%cellMembs(icl)
336 DEALLOCATE(pgrid%soc(isoc)%cellMembs,stat=errorflag)
337 global%error = errorflag
338 IF ( global%error /= err_none )
THEN
339 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%soc%cellMembs')
342 ncellmembsmin = 2*(pgrid%soc(isoc)%nCellMembs + rssize)
344 ALLOCATE(pgrid%soc(isoc)%cellMembs(ncellmembsmin),stat=errorflag)
345 global%error = errorflag
346 IF ( global%error /= err_none )
THEN
347 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%soc%cellMembs')
350 DO icl = 1,pgrid%soc(isoc)%nCellMembs
351 pgrid%soc(isoc)%cellMembs(icl) = cellmembstemp(icl)
354 DEALLOCATE(cellmembstemp,stat=errorflag)
355 global%error = errorflag
356 IF ( global%error /= err_none )
THEN
357 CALL
errorstop(global,err_deallocate,__line__,
'cellMembsTemp')
363 pgrid%col(icg) = isoc
366 pgrid%soc(isoc)%cellMembs(offs+icl) =
rs(icl)
369 pgrid%soc(isoc)%nCellMembs = pgrid%soc(isoc)%nCellMembs + rssize
371 CALL
quicksortinteger(pgrid%soc(isoc)%cellMembs(1:pgrid%soc(isoc)%nCellMembs), &
372 pgrid%soc(isoc)%nCellMembs)
382 IF ( neednewcolor .EQV. .true. )
THEN
383 IF ( pgrid%nSoc < pgrid%nSocMax )
THEN
384 pgrid%nSoc = pgrid%nSoc + 1
387 WRITE(*,*)
'ERROR! About to exceed dimensions of soc!'
392 pgrid%col(icg) = pgrid%nSoc
394 IF ( rssize >
SIZE(pgrid%soc(pgrid%nSoc)%cellMembs,1) )
THEN
395 DEALLOCATE(pgrid%soc(pgrid%nSoc)%cellMembs,stat=errorflag)
396 global%error = errorflag
397 IF ( global%error /= err_none )
THEN
398 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%soc%cellMembs')
401 ALLOCATE(pgrid%soc(pgrid%nSoc)%cellMembs(2*rssize),stat=errorflag)
402 global%error = errorflag
403 IF ( global%error /= err_none )
THEN
404 CALL
errorstop(global,err_allocate,__line__,
'pGrid%soc%cellMembs')
409 pgrid%soc(pgrid%nSoc)%cellMembs(icl) =
rs(icl)
412 pgrid%soc(pgrid%nSoc)%nCellMembs = rssize
414 CALL
quicksortinteger(pgrid%soc(pgrid%nSoc)%cellMembs(1:pgrid%soc(pgrid%nSoc)%nCellMembs), &
415 pgrid%soc(pgrid%nSoc)%nCellMembs)
419 IF ( global%myProcid == masterproc .AND. &
420 global%verbLevel > verbose_none )
THEN
421 WRITE(stdout,
'(A,3X,A,1X,I6)') solver_name,
'Number of colors:',pgrid%nSoc
428 DEALLOCATE(
rs,stat=errorflag)
429 global%error = errorflag
430 IF ( global%error /= err_none )
THEN
431 CALL
errorstop(global,err_deallocate,__line__,
'rs')
434 DO isoc = 1,pgrid%nSocMax
435 DEALLOCATE(pgrid%soc(isoc)%cellMembs,stat=errorflag)
436 IF ( global%error /= err_none )
THEN
437 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%soc%cellMembs')
441 DEALLOCATE(pgrid%soc,stat=errorflag)
442 global%error = errorflag
443 IF ( global%error /= err_none )
THEN
444 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%soc')
454 IF ( global%myProcid == masterproc .AND. &
455 global%verbLevel > verbose_none )
THEN
456 WRITE(stdout,
'(A,1X,A)') solver_name,
'Building coloring done.'
495 TYPE(t_region
),
POINTER :: pregion
503 TYPE(t_grid),
POINTER :: pgrid
509 global => pregion%global
512 'RFLU_ModColoring.F90')
514 pgrid => pregion%grid
520 ALLOCATE(pgrid%col(pgrid%nCellsTot),stat=errorflag)
521 global%error = errorflag
522 IF ( global%error /= err_none )
THEN
523 CALL
errorstop(global,err_allocate,__line__,
'pGrid%col')
568 TYPE(t_region
),
POINTER :: pregion
576 TYPE(t_grid),
POINTER :: pgrid
582 global => pregion%global
585 'RFLU_ModColoring.F90')
587 pgrid => pregion%grid
593 DEALLOCATE(pgrid%col,stat=errorflag)
594 global%error = errorflag
595 IF ( global%error /= err_none )
THEN
596 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%col')
643 TYPE(t_region
),
POINTER :: pregion
649 INTEGER :: errorflag,icg,ifile,loopcounter,ncellstot
650 CHARACTER(CHRLEN) :: ifilename,sectionstring
651 TYPE(t_grid),
POINTER :: pgrid
658 global => pregion%global
661 'RFLU_ModColoring.F90')
663 IF ( global%myProcid == masterproc .AND. &
664 global%verbLevel > verbose_none )
THEN
665 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading coloring...'
668 IF ( global%myProcid == masterproc .AND. &
669 global%verbLevel > verbose_none )
THEN
670 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
671 pregion%iRegionGlobal
681 pregion%iRegionGlobal,ifilename)
683 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD",iostat=errorflag)
684 global%error = errorflag
685 IF ( global%error /= err_none )
THEN
686 CALL
errorstop(global,err_file_open,__line__,ifilename)
693 IF ( global%myProcid == masterproc .AND. &
694 global%verbLevel > verbose_low )
THEN
695 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
698 READ(ifile,
'(A)') sectionstring
699 IF ( trim(sectionstring) /=
'# ROCFLU coloring file' )
THEN
700 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
707 pgrid => pregion%grid
709 READ(ifile,
'(A)') sectionstring
710 IF ( trim(sectionstring) /=
'# Dimensions' )
THEN
711 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
714 READ(ifile,
'(I8)') ncellstot
720 IF ( ncellstot /= pgrid%nCellsTot )
THEN
721 CALL
errorstop(global,err_dimens_invalid,__line__)
731 loopcounter = loopcounter + 1
733 READ(ifile,
'(A)') sectionstring
735 SELECT CASE ( trim(sectionstring) )
741 CASE (
'# Coloring' )
742 IF ( global%myProcid == masterproc .AND. &
743 global%verbLevel > verbose_low )
THEN
744 WRITE(stdout,
'(A,3X,A)') solver_name,
'Coloring...'
747 READ(ifile,
'(10(I8))') (pgrid%col(icg),icg=1,pgrid%nCellsTot)
754 IF ( global%myProcid == masterproc .AND. &
755 global%verbLevel > verbose_low )
THEN
756 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
766 IF ( global%myProcid == masterproc .AND. &
767 global%verbLevel > verbose_low )
THEN
768 WRITE(stdout,
'(3X,A)') sectionstring
771 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
778 IF ( loopcounter >= limit_infinite_loop )
THEN
779 CALL
errorstop(global,err_infinite_loop,__line__)
787 CLOSE(ifile,iostat=errorflag)
788 global%error = errorflag
789 IF ( global%error /= err_none )
THEN
790 CALL
errorstop(global,err_file_close,__line__,ifilename)
797 IF ( global%myProcid == masterproc .AND. &
798 global%verbLevel > verbose_none )
THEN
799 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading coloring done.'
847 INTEGER,
INTENT(IN) :: nvertpercell
848 INTEGER,
INTENT(INOUT) :: ncellsmax
849 INTEGER,
DIMENSION(:),
POINTER :: x2cg
850 INTEGER,
DIMENSION(:,:),
POINTER :: x2v
857 INTEGER :: errorflag,icl,ivl,ncellsmaxold
858 INTEGER,
DIMENSION(:),
ALLOCATABLE:: x2cgtemp
859 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: x2vtemp
866 'RFLU_ModColoring.F90')
872 ncellsmaxold = ncellsmax
873 ncellsmax = 2*ncellsmax
883 ALLOCATE(x2vtemp(nvertpercell,ncellsmaxold),stat=errorflag)
884 global%error = errorflag
885 IF ( global%error /= err_none )
THEN
886 CALL
errorstop(global,err_allocate,__line__,
'x2vTemp')
889 DO icl = 1,ncellsmaxold
890 DO ivl = 1,nvertpercell
891 x2vtemp(ivl,icl) = x2v(ivl,icl)
895 DEALLOCATE(x2v,stat=errorflag)
896 global%error = errorflag
897 IF ( global%error /= err_none )
THEN
898 CALL
errorstop(global,err_deallocate,__line__,
'x2v')
901 ALLOCATE(x2v(nvertpercell,ncellsmax),stat=errorflag)
902 global%error = errorflag
903 IF ( global%error /= err_none )
THEN
904 CALL
errorstop(global,err_allocate,__line__,
'x2v')
907 DO icl = 1,ncellsmaxold
908 DO ivl = 1,nvertpercell
909 x2v(ivl,icl) = x2vtemp(ivl,icl)
913 DEALLOCATE(x2vtemp,stat=errorflag)
914 global%error = errorflag
915 IF ( global%error /= err_none )
THEN
916 CALL
errorstop(global,err_deallocate,__line__,
'x2vTemp')
923 ALLOCATE(x2cgtemp(ncellsmaxold),stat=errorflag)
924 global%error = errorflag
925 IF ( global%error /= err_none )
THEN
926 CALL
errorstop(global,err_allocate,__line__,
'x2cgTemp')
929 DO icl = 1,ncellsmaxold
930 x2cgtemp(icl) = x2cg(icl)
933 DEALLOCATE(x2cg,stat=errorflag)
934 global%error = errorflag
935 IF ( global%error /= err_none )
THEN
936 CALL
errorstop(global,err_deallocate,__line__,
'x2cg')
939 ALLOCATE(x2cg(ncellsmax),stat=errorflag)
940 global%error = errorflag
941 IF ( global%error /= err_none )
THEN
942 CALL
errorstop(global,err_allocate,__line__,
'x2cg')
945 DO icl = 1,ncellsmaxold
946 x2cg(icl) = x2cgtemp(icl)
949 DEALLOCATE(x2cgtemp,stat=errorflag)
950 global%error = errorflag
951 IF ( global%error /= err_none )
THEN
952 CALL
errorstop(global,err_deallocate,__line__,
'x2cgTemp')
999 TYPE(t_region
),
POINTER :: pregion
1005 INTEGER :: errorflag,icg,ifile
1006 CHARACTER(CHRLEN) :: ifilename,sectionstring
1007 TYPE(t_grid),
POINTER :: pgrid
1014 global => pregion%global
1017 'RFLU_ModColoring.F90')
1019 IF ( global%myProcid == masterproc .AND. &
1020 global%verbLevel > verbose_none )
THEN
1021 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing coloring...'
1024 IF ( global%myProcid == masterproc .AND. &
1025 global%verbLevel > verbose_none )
THEN
1026 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1027 pregion%iRegionGlobal
1037 pregion%iRegionGlobal,ifilename)
1039 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"UNKNOWN", &
1041 global%error = errorflag
1042 IF ( global%error /= err_none )
THEN
1043 CALL
errorstop(global,err_file_open,__line__,ifilename)
1050 IF ( global%myProcid == masterproc .AND. &
1051 global%verbLevel > verbose_low )
THEN
1052 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
1055 sectionstring =
'# ROCFLU coloring file'
1056 WRITE(ifile,
'(A)') trim(sectionstring)
1062 pgrid => pregion%grid
1064 IF ( global%myProcid == masterproc .AND. &
1065 global%verbLevel > verbose_low )
THEN
1066 WRITE(stdout,
'(A,3X,A)') solver_name,
'Dimensions...'
1069 sectionstring =
'# Dimensions'
1070 WRITE(ifile,
'(A)') trim(sectionstring)
1071 WRITE(ifile,
'(I8)') pgrid%nCellsTot
1077 IF ( global%myProcid == masterproc .AND. &
1078 global%verbLevel > verbose_low )
THEN
1079 WRITE(stdout,
'(A,3X,A)') solver_name,
'Cells...'
1082 sectionstring =
'# Coloring'
1083 WRITE(ifile,
'(A)') trim(sectionstring)
1084 WRITE(ifile,
'(10(I8))') (pgrid%col(icg),icg=1,pgrid%nCellsTot)
1090 IF ( global%myProcid == masterproc .AND. &
1091 global%verbLevel > verbose_low )
THEN
1092 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
1095 sectionstring =
'# End'
1096 WRITE(ifile,
'(A)') trim(sectionstring)
1102 CLOSE(ifile,iostat=errorflag)
1103 global%error = errorflag
1104 IF ( global%error /= err_none )
THEN
1105 CALL
errorstop(global,err_file_close,__line__,ifilename)
1112 IF ( global%myProcid == masterproc .AND. &
1113 global%verbLevel > verbose_none )
THEN
1114 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing coloring done.'
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
subroutine rflu_col_buildcolorings(pRegion)
subroutine rs(nm, n, a, w, matz, z, fv1, fv2, ierr)
subroutine rflu_col_recreatecelllist(global, nVertPerCell, nCellsMax, x2v, x2cg)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine, public rflu_col_createcoloring(pRegion)
subroutine, public rflu_getresidualsupport1(pRegion, icg, rs, rsSizeMax, rsSize)
subroutine quicksortinteger(a, n)
subroutine binarysearchinteger(a, n, v, i, j)
**********************************************************************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 rflu_col_destroycoloring(pRegion)
subroutine, public rflu_col_writecoloring(pRegion)
subroutine, public rflu_getresidualsupport2(pRegion, icg, rs, rsSizeMax, rsSize)
subroutine, public rflu_copy_celldatas2p_i1d(global, pGrid, var, varSerial)
subroutine rflu_col_buildcoloringp(pRegion, pRegionSerial)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine, public rflu_col_readcoloring(pRegion)