CFPRIME USPRNT                                                          USPRNT      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  USPRNT (FIRST,IUY)                                    USPRNT      3
CD -------------------------------------------------------------------  USPRNT      4
CD                                                                      USPRNT      5
CD              *****     USPRNT  ROUTINE   *****                       USPRNT      6
CD                                                                      USPRNT      7
CD -------------------------------------------------------------------  USPRNT      8
CD                                                                      USPRNT      9
CD       PURPOSE:  Prints output value for each specified udc block     USPRNT     10
CD                 (in solution order).                                 USPRNT     11
CD                                                                      USPRNT     12
CD                                                                      USPRNT     13
CD       DEFINITION OF LOCAL VARIABLES:                                 USPRNT     14
CD          (P)    FIRST  -  indicates if titles for print are          USPRNT     15
CD                           required.                                  USPRNT     16
CD                 I      - 'do' loop index.                            USPRNT     17
CD                 J      - 'do' loop index.                            USPRNT     18
CD                 K      - 'do' loop index.                            USPRNT     19
CD                 LABEL  -  title used for printing.                   USPRNT     20
CD                 NAME   -  udc block name.                            USPRNT     21
CD                 NEXT   -  index into udc arrays.                     USPRNT     22
CD                 VALUE  -  value to be printed.                       USPRNT     23
CD                                                                      USPRNT     24
CD -------------------------------------------------------------------  USPRNT     25
      INCLUDE 'CNUNIT.INS'                                              USPRNT     26
      INCLUDE 'PARX.INS'                                                USPRNT     27
      INCLUDE 'UDCA.INS'                                                USPRNT     28
      INCLUDE 'UDCG.INS'                                                USPRNT     29
      INCLUDE 'UDCH.INS'                                                USPRNT     30
      INCLUDE 'CNFLAG.INS'                                              USPRNT     31
C                                                                       USPRNT     32
C                                                                       USPRNT     33
      DIMENSION  VALUE(6)                                               USPRNT     34
C                                                                       USPRNT     35
      LOGICAL       FIRST                                               USPRNT     36
C                                                                       USPRNT     37
      CHARACTER*50  LABEL                                               USPRNT     38
      CHARACTER*17  NAME(6)                                             USPRNT     39
C                                                                       USPRNT     40
C                                                                       USPRNT     41
C---------------------------------------------------------------------  USPRNT     42
C                                                                       USPRNT     43
      LDEB=(JDEB(306).NE.0)                                             USPRNT     44
C                                                                       USPRNT     45
      IF (FIRST) THEN                                                   USPRNT     46
C                                                                       USPRNT     47
         FIRST = .FALSE.                                                USPRNT     48
         IPRNUM = 0                                                     USPRNT     49
         DO 20 J = 1, IUDC                                              USPRNT     50
            I = IUDPRM(J)                                               USPRNT     51
            IF (UDPRNT(I)) THEN                                         USPRNT     52
               IPRNUM = IPRNUM + 1                                      USPRNT     53
               IPRLIS(IPRNUM) = I                                       USPRNT     54
            END IF                                                      USPRNT     55
20       CONTINUE                                                       USPRNT     56
C                                                                       USPRNT     57
         IF (LDEB) THEN                                                 USPRNT     58
            LABEL = '***  USER DEFINED CONTROLS SOLUTION  ***'          USPRNT     59
            WRITE (IUY,9004) LABEL                                      USPRNT     60
            J = 0                                                       USPRNT     61
            DO 40 I = 1, IPRNUM                                         USPRNT     62
               NEXT = IPRLIS(I)                                         USPRNT     63
               J = J + 1                                                USPRNT     64
               NAME(J) = UDNAME(NEXT)                                   USPRNT     65
               IF (J .EQ. 6) THEN                                       USPRNT     66
                  WRITE (IUY,9006) (NAME(K), K = 1, J)                  USPRNT     67
                  J = 0                                                 USPRNT     68
               END IF                                                   USPRNT     69
40          CONTINUE                                                    USPRNT     70
            IF (J .NE. 0) THEN                                          USPRNT     71
               WRITE (IUY,9006) (NAME(K), K = 1, J)                     USPRNT     72
            END IF                                                      USPRNT     73
C                                                                       USPRNT     74
         END IF                                                         USPRNT     75
      END IF                                                            USPRNT     76
C                                                                       USPRNT     77
C                                                                       USPRNT     78
      IF (LDEB) THEN                                                    USPRNT     79
         WRITE (IUY,9008) TIME                                          USPRNT     80
      END IF                                                            USPRNT     81
C                                                                       USPRNT     82
C      WRITE (SCROUT,9008) TIME                                         USPRNT     83
C                                                                       USPRNT     84
C                                                                       USPRNT     85
C     Calculate outputs of all blocks                                   USPRNT     86
C                                                                       USPRNT     87
      J = 0                                                             USPRNT     88
      DO 60 I = 1, IPRNUM                                               USPRNT     89
         NEXT = IPRLIS(I)                                               USPRNT     90
         J = J + 1                                                      USPRNT     91
         VALUE(J) = UDVAL(NEXT)                                         USPRNT     92
         IF (J .EQ. 6) THEN                                             USPRNT     93
            IF (LDEB) THEN                                              USPRNT     94
               WRITE (IUY,9010) (VALUE(K), K = 1, J)                    USPRNT     95
            END IF                                                      USPRNT     96
            J = 0                                                       USPRNT     97
         END IF                                                         USPRNT     98
60    CONTINUE                                                          USPRNT     99
C                                                                       USPRNT    100
C                                                                       USPRNT    101
      IF (J .NE. 0) THEN                                                USPRNT    102
         IF (LDEB) THEN                                                 USPRNT    103
            WRITE (IUY,9010) (VALUE(K), K = 1, J)                       USPRNT    104
         END IF                                                         USPRNT    105
      END IF                                                            USPRNT    106
C                                                                       USPRNT    107
C                                                                       USPRNT    108
C---------------------------------------------------------------------  USPRNT    109
C                                                                       USPRNT    110
      RETURN                                                            USPRNT    111
C                                                                       USPRNT    112
C---------------------------------------------------------------------  USPRNT    113
C                                                                       USPRNT    114
9004  FORMAT (///, '1', 20X, A, /)                                      USPRNT    115
9006  FORMAT (' ', 2X, 6 (2X, A, 1X))                                   USPRNT    116
9008  FORMAT (//,' UDC SOLUTION AT TIME = ', F12.6)                     USPRNT    117
9010  FORMAT (' ', 2X, 6 (E15.5, 4X))                                   USPRNT    118
C                                                                       USPRNT    119
C---------------------------------------------------------------------  USPRNT    120
C                                                                       USPRNT    121
      END                                                               USPRNT    122
