CFPRIME AUPIFN                                                          AUPIFN      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 AUPIFN(NBUS,CCINF,NRED)                                AUPIFN      3
CD                                                                      AUPIFN      4
CD    THIS ROUTINE UPDATES THE RIGHT HAND SIDE "RHS" VECTOR USING       AUPIFN      5
CD    THE LOWER-DIAGONAL FACTORIZED MATRIX STORED COLUMN-WISE IN        AUPIFN      6
CD    "KORNO", "CELEM", "NODIA", AND "INDEX".                           AUPIFN      7
CD                                                                      AUPIFN      8
      INCLUDE 'PARX.INS'                                                AUPIFN      9
      INCLUDE 'CNFLAG.INS'                                              AUPIFN     10
      INCLUDE 'CNSPC0.INS'                                              AUPIFN     11
      INCLUDE 'CNSPC1.INS'                                              AUPIFN     12
      INCLUDE 'CNSPC2.INS'                                              AUPIFN     13
      INCLUDE 'CNSPVI.INS'                                              AUPIFN     14
      INCLUDE 'CNSPDI.INS'                                              AUPIFN     15
      INCLUDE 'CNSPRE.INS'                                              AUPIFN     16
      INCLUDE 'CNSPWK.INS'                                              AUPIFN     17
      INCLUDE 'CNUNIT.INS'                                              AUPIFN     18
C                                                                       AUPIFN     19
      COMPLEX VOLTI,CCINF(NB)                                           AUPIFN     20
C                                                                       AUPIFN     21
      LDEB=(JDEB(57).NE.0)                                              AUPIFN     22
      IF(LDEB)WRITE(IUD6,500) (I,STAIRS(I),I=1,NBUS)                    AUPIFN     23
C                                                                       AUPIFN     24
      IF(LDEB)WRITE(IUD6,510)(CCINF(I),I=1,NBUS)                        AUPIFN     25
C                                                                       AUPIFN     26
C      UPDATE THE "RHS"VECTOR USING ONLY THE                            AUPIFN     27
C      COLUMN IDENTIFIED IN "NOROI". FOR A DESCRIPTION OF               AUPIFN     28
C      UPDATING ALGORITHM SEE SUBROUTINE "AUPDFR".                      AUPIFN     29
C                                                                       AUPIFN     30
      IF(NRED.NE.0)THEN                                                 AUPIFN     31
       NROW=NRED                                                        AUPIFN     32
      ELSE                                                              AUPIFN     33
       NROW=NOROWI-1                                                    AUPIFN     34
      ENDIF                                                             AUPIFN     35
      DO 280 M=1,NROW                                                   AUPIFN     36
      K=NOROI(M)                                                        AUPIFN     37
      I=IBUSO(K)                                                        AUPIFN     38
      VOLTI=CCINF(I)*STAIRS(I)                                          AUPIFN     39
      CCINF(I)=VOLTI                                                    AUPIFN     40
C                                                                       AUPIFN     41
      IS=INDEX(K)                                                       AUPIFN     42
      NE=NODIA(K)+IS-1                                                  AUPIFN     43
C                                                                       AUPIFN     44
      DO 270 J=IS,NE                                                    AUPIFN     45
      IR=KORNO(J)                                                       AUPIFN     46
      CCINF(IR)=CCINF(IR)-CELEM(J)*VOLTI                                AUPIFN     47
 270  CONTINUE                                                          AUPIFN     48
C                                                                       AUPIFN     49
 280  CONTINUE                                                          AUPIFN     50
C                                                                       AUPIFN     51
      IF(NRED.EQ.0)THEN                                                 AUPIFN     52
       I=IBUSO(NBUS)                                                    AUPIFN     53
       IF(NOROWI.EQ.1)I=IBUSO(NOROI(1))                                 AUPIFN     54
       CCINF(I)=CCINF(I)*STAIRS(I)                                      AUPIFN     55
      ENDIF                                                             AUPIFN     56
C                                                                       AUPIFN     57
C                                                                       AUPIFN     58
C  END OF "AUPDSR"                                                      AUPIFN     59
C                                                                       AUPIFN     60
      IF(LDEB)WRITE(IUD6,520) (CCINF(KK),KK=1,NBUS)                     AUPIFN     61
C                                                                       AUPIFN     62
      RETURN                                                            AUPIFN     63
C                                                                       AUPIFN     64
 500  FORMAT(2(1X,'I=',I4,' FYKK=',2G12.4))                             AUPIFN     65
 510  FORMAT(1X,'CURRENT INPUTS :',/,(10G12.4))                         AUPIFN     66
 520  FORMAT(1X,'RHS AFTER FORWARD OPERATION :',/,(10G12.4))            AUPIFN     67
C                                                                       AUPIFN     68
      END                                                               AUPIFN     69
