CFPRIME STDCPU                                                          STDCPU      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  STDCPU                                                STDCPU      3
CD--------------------------------------------------------------------- STDCPU      4
CD                                                                      STDCPU      5
CD               *****     STDCPU  ROUTINE   *****                      STDCPU      6
CD                                                                      STDCPU      7
CD--------------------------------------------------------------------- STDCPU      8
CD                                                                      STDCPU      9
CD        PURPOSE:  This subroutine performs the calculation of per     STDCPU     10
CD                  unit constants and the per unitizing of data.       STDCPU     11
CD                                                                      STDCPU     12
CD                                                                      STDCPU     13
CD        DEFINITION OF LOCAL VARIABLES:                                STDCPU     14
CD                  I      - 'do' loop index.                           STDCPU     15
CD                  YBASE  -  base value.                               STDCPU     16
CD                  XNORAT -  nominal voltage ratio.                    STDCPU     17
CD                  JPOSN   -  internal number for the name.            STDCPU     18
CD                  RATIO  -  unitized factor.                          STDCPU     19
CD                  RATIO1 -  per unitized factor for xc.               STDCPU     20
CD                                                                      STDCPU     21
CD                                                                      STDCPU     22
CD        SUBROUTINES REQUIRED:  ******                                 STDCPU     23
CD                                                                      STDCPU     24
CD--------------------------------------------------------------------- STDCPU     25
      INCLUDE 'PARX.INS'                                                STDCPU     26
      INCLUDE 'CNPARX.INS'                                              STDCPU     27
      INCLUDE 'GRDC01.INS'                                              STDCPU     28
      INCLUDE 'GRDC02.INS'                                              STDCPU     29
C                                                                       STDCPU     30
      INCLUDE 'UDCF.INS'                                                STDCPU     31
      INCLUDE 'UDCG.INS'                                                STDCPU     32
      INCLUDE 'UDCJ.INS'                                                STDCPU     33
C                                                                       STDCPU     34
C---------------------------------------------------------------------  STDCPU     35
C                                                                       STDCPU     36
      RATIO = (PDBASE / (VDBASE * VDBASE))                              STDCPU     37
      YBASE = (PDBASE*1000.)/VDBASE                                     STDCPU     38
C                                                                       STDCPU     39
C     Per unitize converter information.                                STDCPU     40
C                                                                       STDCPU     41
      DO 20 I = 1, ICDC                                                 STDCPU     42
         IF(IDC(I) .NE. 0)THEN                                          STDCPU     43
            JPOSN = IDC(I)                                              STDCPU     44
            XNORAT = TAPNOM(JPOSN)                                      STDCPU     45
            IF(CNVMVA(JPOSN).LE.0.0.AND.CNVMVA(JPOSN).GE.0.0)THEN       STDCPU     46
               RATIO1 = 1.0                                             STDCPU     47
            ELSE                                                        STDCPU     48
               IF(IABS(ICTYPE(JPOSN)) .EQ. 1) THEN                      STDCPU     49
                  RATIO1 = (VABASE(JPOSN) * XNORAT) ** 2 / CNVMVA(JPOSN)STDCPU     50
               ELSE                                                     STDCPU     51
                  RATIO1 = VABASE(JPOSN) **2 /CNVMVA(JPOSN)             STDCPU     52
               ENDIF                                                    STDCPU     53
            ENDIF                                                       STDCPU     54
            FACT=REAL(NSBRDG(JPOSN))                                    STDCPU     55
            IF(IABS(ICTYPE(JPOSN)) .EQ. 1) THEN                         STDCPU     56
C                                                                       STDCPU     57
C              line commutated converter                                STDCPU     58
C                                                                       STDCPU     59
               VACDC(JPOSN) = (3. * SQRT(2.0) * FACT/ PII) *            STDCPU     60
     1                       XNORAT * VABASE(JPOSN)                     STDCPU     61
            ELSEIF(IABS(ICTYPE(JPOSN)) .EQ. 2) THEN                     STDCPU     62
C                                                                       STDCPU     63
C              self commutated voltage sourced converter                STDCPU     64
C                                                                       STDCPU     65
               VACDC(JPOSN) = GAINKC(JPOSN) * VABASE(JPOSN) / XNORAT    STDCPU     66
            ENDIF                                                       STDCPU     67
            XCCONV(JPOSN) = XCOHMS(JPOSN) * FACT* RATIO1                STDCPU     68
         ENDIF                                                          STDCPU     69
20    CONTINUE                                                          STDCPU     70
C                                                                       STDCPU     71
C---------------------------------------------------------------------  STDCPU     72
C                                                                       STDCPU     73
      RETURN                                                            STDCPU     74
C                                                                       STDCPU     75
C---------------------------------------------------------------------  STDCPU     76
C                                                                       STDCPU     77
      END                                                               STDCPU     78
