CFPRIME USPRT                                                           USPRT       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  USPRT (JBLK)                                          USPRT       3
C                                                                       USPRT       4
      INCLUDE 'PARX.INS'                                                USPRT       5
      INCLUDE 'CNPARX.INS'                                              USPRT       6
      INCLUDE 'GRDC01.INS'                                              USPRT       7
      INCLUDE 'GRDC03.INS'                                              USPRT       8
      INCLUDE 'UDCA.INS'                                                USPRT       9
      INCLUDE 'UDCD.INS'                                                USPRT      10
      INCLUDE 'UDCE.INS'                                                USPRT      11
      INCLUDE 'UDCF.INS'                                                USPRT      12
      INCLUDE 'UDCG.INS'                                                USPRT      13
      INCLUDE 'UDCH.INS'                                                USPRT      14
      INCLUDE 'UDCJ.INS'                                                USPRT      15
      INCLUDE 'CNUNIT.INS'                                              USPRT      16
      INCLUDE 'CNMSG.INS'                                               USPRT      17
C                                                                       USPRT      18
C                                                                       USPRT      19
      CHARACTER*72  MESSAC                                              USPRT      20
      CHARACTER*20  SUBNAM                                              USPRT      21
      CHARACTER*17  BNAME                                               USPRT      22
      CHARACTER*8   TNAME                                               USPRT      23
C                                                                       USPRT      24
      INCLUDE 'GRPRT.INS'                                               USPRT      25
C                                                                       USPRT      26
      IF(SDBG)THEN                                                      USPRT      27
         SUBNAM = 'USPRT ROUTINE.'                                      USPRT      28
      ELSE                                                              USPRT      29
         SUBNAM = ' '                                                   USPRT      30
      END IF                                                            USPRT      31
      TNAME = TPNAME(IPRTR)                                             USPRT      32
      BNAME = UDNAME(JBLK)                                              USPRT      33
      LEN = IUDLEN(JBLK)                                                USPRT      34
C                                                                       USPRT      35
C                                                                       USPRT      36
C                                                                       USPRT      37
C     Retrieve input values.                                            USPRT      38
C                                                                       USPRT      39
      NEXTI = IUNIPT(JBLK)                                              USPRT      40
      NEXTP = IUDPPT(JBLK)                                              USPRT      41
      NEXTC = IUDCPT(JBLK)                                              USPRT      42
      IF (IUDSUB(JBLK) .EQ. IMESS) THEN                                 USPRT      43
         IPRTU = IUDINT(NEXTI)                                          USPRT      44
C                                                                       USPRT      45
         NEXTI = IUDINX(NEXTI)                                          USPRT      46
         IF(UIDENT(NEXTI) .NE. ' ')THEN                                 USPRT      47
            VALUE1= UDVAL(IUDINT(NEXTI))                                USPRT      48
         ELSE                                                           USPRT      49
            VALUE1= UDPARM(NEXTP)                                       USPRT      50
         END IF                                                         USPRT      51
         MESSAC = UDCCHR(NEXTC)                                         USPRT      52
C                                                                       USPRT      53
C     Calculate UDVAL.                                                  USPRT      54
C                                                                       USPRT      55
         IF(VALUE1.GT.0.0.AND.UDVAL(JBLK).EQ.0.0) THEN                  USPRT      56
            WRITE(IPRTU,9000) TIME, MESSAC                              USPRT      57
            UDVAL(JBLK) = 1.0                                           USPRT      58
         ELSEIF(VALUE1.LE.0.0.AND.UDVAL(JBLK).EQ.1.0) THEN              USPRT      59
            UDVAL(JBLK) = 0.0                                           USPRT      60
         ENDIF                                                          USPRT      61
C                                                                       USPRT      62
      ENDIF                                                             USPRT      63
C                                                                       USPRT      64
      RETURN                                                            USPRT      65
C                                                                       USPRT      66
C                                                                       USPRT      67
C---------------------------------------------------------------------  USPRT      68
C                                                                       USPRT      69
9000  FORMAT(/,1X,'At ',F8.5,' seconds: ',A)                            USPRT      70
C                                                                       USPRT      71
C---------------------------------------------------------------------  USPRT      72
C                                                                       USPRT      73
      END                                                               USPRT      74
