CFPRIME UDSOLN                                                          UDSOLN      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  UDSOLN                                                UDSOLN      3
CD -------------------------------------------------------------------  UDSOLN      4
CD                                                                      UDSOLN      5
CD              *****     UDSOLN  ROUTINE   *****                       UDSOLN      6
CD                                                                      UDSOLN      7
CD -------------------------------------------------------------------  UDSOLN      8
CD                                                                      UDSOLN      9
CD       PURPOSE:  Solves the udc solution.                             UDSOLN     10
CD                                                                      UDSOLN     11
CD                                                                      UDSOLN     12
CD       DEFINITION OF LOCAL VARIABLES:                                 UDSOLN     13
CD                 JBLK    -  current udc block (in solution order.)    UDSOLN     14
CD                 J      - 'do' loop index.                            UDSOLN     15
CD                                                                      UDSOLN     16
CD -------------------------------------------------------------------  UDSOLN     17
      INCLUDE 'PARX.INS'                                                UDSOLN     18
      INCLUDE 'UDCA.INS'                                                UDSOLN     19
      INCLUDE 'UDCG.INS'                                                UDSOLN     20
      INCLUDE 'UDCH.INS'                                                UDSOLN     21
C                                                                       UDSOLN     22
C---------------------------------------------------------------------  UDSOLN     23
C                                                                       UDSOLN     24
C     Calculate outputs of all blocks                                   UDSOLN     25
C                                                                       UDSOLN     26
      DO 20 J = 1, IUDC                                                 UDSOLN     27
         JBLK = IUDPRM(J)                                               UDSOLN     28
C                                                                       UDSOLN     29
         IF(IUDTYP(JBLK).EQ.IACSYS)THEN                                 UDSOLN     30
C            CALL USACSY (JBLK)                                         UDSOLN     31
C                                                                       UDSOLN     32
         ELSEIF(IUDTYP(JBLK).EQ.IBINAR)THEN                             UDSOLN     33
            CALL USBIN (JBLK)                                           UDSOLN     34
C                                                                       UDSOLN     35
         ELSEIF(IUDTYP(JBLK).EQ.IBREAK)THEN                             UDSOLN     36
            CALL USBRKR (JBLK)                                          UDSOLN     37
C                                                                       UDSOLN     38
         ELSEIF(IUDTYP(JBLK).EQ.IFRTRA)THEN                             UDSOLN     39
            CALL USFORT (JBLK)                                          UDSOLN     40
C                                                                       UDSOLN     41
         ELSEIF(IUDTYP(JBLK).EQ.IFRMAC)THEN                             UDSOLN     42
            IF(FRSTAC) CALL USFRAC (JBLK)                               UDSOLN     43
C                                                                       UDSOLN     44
         ELSEIF(IUDTYP(JBLK).EQ.IFRMDC)THEN                             UDSOLN     45
            IF(FRSTDC) CALL USFRDC (JBLK)                               UDSOLN     46
C                                                                       UDSOLN     47
         ELSEIF(IUDTYP(JBLK).EQ.INTERF)THEN                             UDSOLN     48
            CALL USINTF (JBLK)                                          UDSOLN     49
C                                                                       UDSOLN     50
         ELSEIF(IUDTYP(JBLK).EQ.LIMITR)THEN                             UDSOLN     51
            CALL USLIMT (JBLK)                                          UDSOLN     52
C                                                                       UDSOLN     53
         ELSEIF(IUDTYP(JBLK).EQ.LOGIC)THEN                              UDSOLN     54
            CALL USLOGC (JBLK)                                          UDSOLN     55
C                                                                       UDSOLN     56
         ELSEIF(IUDTYP(JBLK).EQ.MULTI)THEN                              UDSOLN     57
            CALL USMLTP (JBLK)                                          UDSOLN     58
C                                                                       UDSOLN     59
         ELSEIF(IUDTYP(JBLK).EQ.IPRTR)THEN                              UDSOLN     60
            CALL USPRT(JBLK)                                            UDSOLN     61
C                                                                       UDSOLN     62
         ELSEIF(IUDTYP(JBLK).EQ.IOTHER)THEN                             UDSOLN     63
            CALL USOTHR (JBLK)                                          UDSOLN     64
C                                                                       UDSOLN     65
         ELSEIF(IUDTYP(JBLK).EQ.ISBLCK)THEN                             UDSOLN     66
            CALL USSBLK (JBLK)                                          UDSOLN     67
C                                                                       UDSOLN     68
         ELSEIF(IUDTYP(JBLK).EQ.ISOURC)THEN                             UDSOLN     69
            CALL USSRCE (JBLK)                                          UDSOLN     70
C                                                                       UDSOLN     71
         ELSEIF(IUDTYP(JBLK).EQ.ISETUP)THEN                             UDSOLN     72
            CALL USSETP (JBLK)                                          UDSOLN     73
C                                                                       UDSOLN     74
         ELSEIF(IUDTYP(JBLK).EQ.IUNARY)THEN                             UDSOLN     75
            CALL USUNA (JBLK)                                           UDSOLN     76
C                                                                       UDSOLN     77
         ELSEIF(IUDTYP(JBLK).EQ.IUDUMY)THEN                             UDSOLN     78
C                                                                       UDSOLN     79
C           Dummy blocks are evaluated in the USFORT routine,           UDSOLN     80
C           immediately following the evaluation of the parent FORTRAN  UDSOLN     81
C           block.                                                      UDSOLN     82
C                                                                       UDSOLN     83
         END IF                                                         UDSOLN     84
20    CONTINUE                                                          UDSOLN     85
C                                                                       UDSOLN     86
C                                                                       UDSOLN     87
C---------------------------------------------------------------------  UDSOLN     88
C                                                                       UDSOLN     89
      RETURN                                                            UDSOLN     90
C                                                                       UDSOLN     91
C---------------------------------------------------------------------  UDSOLN     92
C                                                                       UDSOLN     93
      END                                                               UDSOLN     94
