setup Subroutine

private subroutine setup(lvl, lvls1, lvls2)

Arguments

Type IntentOptional AttributesName
integer :: lvl
integer :: lvls1
integer :: lvls2

Calls

proc~~setup~~CallsGraph proc~setup setup psb_realloc psb_realloc proc~setup->psb_realloc

Contents

Source Code


Source Code

    SUBROUTINE SETUP(LVL, LVLS1, LVLS2)
        ! SETUP COMPUTES THE REVERSE LEVELING INFO FROM LVLS2 AND STORES
        ! IT INTO LVLS2.  NACUM(I) IS INITIALIZED TO NODES/ITH LEVEL FOR NODES
        ! ON THE PSEUDO-DIAMETER OF THE GRAPH.  LVL IS INITIALIZED TO NON-
        ! ZERO FOR NODES ON THE PSEUDO-DIAM AND NODES IN A DIFFERENT
        ! COMPONENT OF THE GRAPH.
        !      COMMON /GRA/ N, IDPTH, IDEG
        ! IT IS ASSUMED THAT THERE ARE AT MOST 100 LEVELS.
        ! COMMON /LVLW/ NHIGH(100), NLOW(100), NACUM(100)
        DIMENSION LVL(N), LVLS1(N), LVLS2(N)
        INTEGER :: SZ
        !----------------------------------------------------------
        SZ=SIZE(NACUM)
        IF(SZ  <  IDPTH) THEN
            WRITE(*,*) 'GPS_SETUP: on the fly reallocation of NACUM'
            CALL psb_realloc(idpth,nacum,info) !CALL REALLOC(NACUM,SZ,IDPTH)
        END IF
        !----------------------------------------------------------
        DO 10 I=1,IDPTH
            NACUM(I) = 0
10      END DO
        DO 30 I=1,N
            LVL(I) = 1
            LVLS2(I) = IDPTH + 1 - LVLS2(I)
            ITEMP = LVLS2(I)
            IF (ITEMP>IDPTH) CYCLE
            IF (ITEMP/=LVLS1(I)) GO TO 20
            NACUM(ITEMP) = NACUM(ITEMP) + 1
            CYCLE
20          LVL(I) = 0
30      END DO
        RETURN
    END SUBROUTINE SETUP