CFPRIME URPTLP                                                          URPTLP      1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*        Extended Transient-Midterm Stability Program (ETMSP)         *RIGHTE      3
C*        ====================================================         *RIGHTE      4
C*                                                                     *RIGHTE      5
C*       Copyright (C) (1993) Electric Power Research Institute        *RIGHTE      6
C*                                                                     *RIGHTE      7
C* EPRI reserves all rights in the software and associated             *RIGHTE      8
C* documentation as delivered. The software and its associated         *RIGHTE      9
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     10
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     11
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     12
C* of any changes or modifications to the software within two (2)      *RIGHTE     13
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     14
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     15
C* new designation sufficiently different from its then current        *RIGHTE     16
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     17
C* the current software as changed or modified.                        *RIGHTE     18
C*                                                                     *RIGHTE     19
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     20
C* directly from EPRI.                                                 *RIGHTE     21
C*                                                                     *RIGHTE     22
C* This program and supporting materials may be independently available*RIGHTE     23
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     24
C* distribution fee. The EPSC is a service of                          *RIGHTE     25
C*                                                                     *RIGHTE     26
C*                    Power Computing Company                          *RIGHTE     27
C*                    1930 Hi Line                                     *RIGHTE     28
C*                    Dallas, Tx 75207                                 *RIGHTE     29
C*                                                                     *RIGHTE     30
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     31
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     32
C*                                                                     *RIGHTE     33
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     34
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     35
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     36
C*    DOCUMENTATION; OR                                                *RIGHTE     37
C*                                                                     *RIGHTE     38
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     39
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     40
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     41
C*                                                                     *RIGHTE     42
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     43
C* THEREOF.                                                            *RIGHTE     44
C*                                                                     *RIGHTE     45
C***********************************************************************RIGHTE     46
      SUBROUTINE  URPTLP                                                URPTLP      3
CD -------------------------------------------------------------------  URPTLP      4
CD                                                                      URPTLP      5
CD              *****     URPTLP  ROUTINE   *****                       URPTLP      6
CD                                                                      URPTLP      7
CD -------------------------------------------------------------------  URPTLP      8
CD                                                                      URPTLP      9
CD       PURPOSE:  Print the arithmetic loops and subsystems found      URPTLP     10
CD                 in the udc system.                                   URPTLP     11
CD                                                                      URPTLP     12
CD                                                                      URPTLP     13
CD       DEFINITION OF LOCAL VARIABLES:                                 URPTLP     14
CD                 FIRST  -  flag used for output.                      URPTLP     15
CD                 I      - 'do' loop index.                            URPTLP     16
CD                 J      - 'do' loop index.                            URPTLP     17
CD                 K      - 'do' loop index.                            URPTLP     18
CD                 LABEL  -  title for printed output.                  URPTLP     19
CD                 LEN    -  length of each block name.                 URPTLP     20
CD                 LINLEN -  used to keep track of the length of line.  URPTLP     21
CD                 NEXT   -  current pointer in linked list.            URPTLP     22
CD                 NAME   -  list of block names.                       URPTLP     23
CD                 SNAME  -  udc subtype name.                          URPTLP     24
CD                 TNAME  -  udc type name.                             URPTLP     25
CD                                                                      URPTLP     26
CD -------------------------------------------------------------------  URPTLP     27
      INCLUDE 'CNUNIT.INS'                                              URPTLP     28
      INCLUDE 'CNMSG.INS'                                               URPTLP     29
      INCLUDE 'PARX.INS'                                                URPTLP     30
      INCLUDE 'UDCA.INS'                                                URPTLP     31
      INCLUDE 'UDCB.INS'                                                URPTLP     32
      INCLUDE 'UDCD.INS'                                                URPTLP     33
      INCLUDE 'UDCE.INS'                                                URPTLP     34
      INCLUDE 'UDCH.INS'                                                URPTLP     35
C                                                                       URPTLP     36
C                                                                       URPTLP     37
      DIMENSION  LEN(10)                                                URPTLP     38
C                                                                       URPTLP     39
      LOGICAL       FIRST                                               URPTLP     40
C                                                                       URPTLP     41
      CHARACTER*40  LABEL                                               URPTLP     42
      CHARACTER*17  NAME(10)                                            URPTLP     43
C                                                                       URPTLP     44
C                                                                       URPTLP     45
C---------------------------------------------------------------------  URPTLP     46
C                                                                       URPTLP     47
C                                                                       URPTLP     48
      LABEL = ' ***  LOOPS IN UDC SYSTEM  ***'                          URPTLP     49
      MSG(1)=LABEL                                                      URPTLP     50
      CALL PRTMSG(1)                                                    URPTLP     51
      DO 60 I = 1, LPMAX                                                URPTLP     52
         IF (LPSUBS(I) .GT. 0) THEN                                     URPTLP     53
            WRITE (MSG(1),9004) I                                       URPTLP     54
         ELSE                                                           URPTLP     55
            WRITE (MSG(1),9006) I                                       URPTLP     56
         END IF                                                         URPTLP     57
         CALL PRTMSG(1)                                                 URPTLP     58
         IF (LPLEAD(I) .EQ. 0) THEN                                     URPTLP     59
            WRITE (MSG(1),9008)                                         URPTLP     60
            CALL PRTMSG(1)                                              URPTLP     61
         ELSE                                                           URPTLP     62
            WRITE (MSG(2),9011) UDNAME(LPLEAD(I))                       URPTLP     63
            WRITE(MSG(1),9010)                                          URPTLP     64
            CALL PRTMSG(2)                                              URPTLP     65
         END IF                                                         URPTLP     66
         NEXT = LPTOP(I)                                                URPTLP     67
         J = 0                                                          URPTLP     68
         LINLEN = 0                                                     URPTLP     69
         FIRST = .TRUE.                                                 URPTLP     70
20       IF (NEXT .EQ. 0) GO TO 40                                      URPTLP     71
            IF (J .GE. 6 .OR. LINLEN .GT. 72) THEN                      URPTLP     72
               IF (FIRST) THEN                                          URPTLP     73
                  WRITE (MSG(1),9012) (NAME(K)(1:LEN(K)), K = 1, J)     URPTLP     74
                  FIRST = .FALSE.                                       URPTLP     75
               ELSE                                                     URPTLP     76
                  WRITE (MSG(1),9014) (NAME(K)(1:LEN(K)), K = 1, J)     URPTLP     77
               END IF                                                   URPTLP     78
               CALL PRTMSG(1)                                           URPTLP     79
               J = 0                                                    URPTLP     80
               LINLEN = 0                                               URPTLP     81
            ELSE                                                        URPTLP     82
               J = J + 1                                                URPTLP     83
               NAME(J) = LPNAME(NEXT)                                   URPTLP     84
               LEN(J) = IUDLEN(LPNUM(NEXT))                             URPTLP     85
               LINLEN = LINLEN + LEN(J)                                 URPTLP     86
               NEXT = LPNEXT(NEXT)                                      URPTLP     87
            END IF                                                      URPTLP     88
         GO TO 20                                                       URPTLP     89
40    CONTINUE                                                          URPTLP     90
      IF (FIRST) THEN                                                   URPTLP     91
         WRITE (MSG(1),9012) (NAME(K)(1:LEN(K)), K = 1, J)              URPTLP     92
      ELSE                                                              URPTLP     93
         WRITE (MSG(1),9014) (NAME(K)(1:LEN(K)), K = 1, J)              URPTLP     94
      END IF                                                            URPTLP     95
      CALL PRTMSG(1)                                                    URPTLP     96
C                                                                       URPTLP     97
60    CONTINUE                                                          URPTLP     98
C                                                                       URPTLP     99
C---------------------------------------------------------------------  URPTLP    100
C                                                                       URPTLP    101
      RETURN                                                            URPTLP    102
C                                                                       URPTLP    103
C---------------------------------------------------------------------  URPTLP    104
C                                                                       URPTLP    105
9004  FORMAT (5X, 'LOOP NUMBER:  ', I2, 5X, '(SUBSYTEM)')               URPTLP    106
9006  FORMAT (5X, 'LOOP NUMBER:  ', I2, 5X, '(LOOP)')                   URPTLP    107
9008  FORMAT (10X, '(FIRST BLOCK IN LOOP IS DETERMINED BY ',            URPTLP    108
     1        'INPUT ORDER OF THE BLOCKS IN THE LOOP.)')                URPTLP    109
9010  FORMAT (10X, '(FIRST BLOCK IN LOOP IS DEPENDENT ON THE ',         URPTLP    110
     1        'POSITION OF')                                            URPTLP    111
9011  FORMAT(11X, '"', A, '" IN INPUT FILE.)')                          URPTLP    112
9012  FORMAT (5X, 'LOOP:  ', 10 (A, 3X))                                URPTLP    113
9014  FORMAT (12X, 10 (A, 3X))                                          URPTLP    114
C                                                                       URPTLP    115
C---------------------------------------------------------------------  URPTLP    116
C                                                                       URPTLP    117
      END                                                               URPTLP    118
