CFPRIME EPSTCV                                                          EPSTCV      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 EPSTCV (IRMBUS,IOHTYP,EPSTAB,ISTABX,EPTEB,ITEBX,       EPSTCV      3
     +                   STABB,STABB1,STABB2,STABB3)                    EPSTCV      4
CD                                                                      EPSTCV      5
CD    TO CONVERT BPA/WSCC/EPRI(OLD) STABILIZER MODELS TO EPRI(NEW)      EPSTCV      6
CD    MODEL.                                                            EPSTCV      7
CD                                                                      EPSTCV      8
      INCLUDE 'PARX.INS'                                                EPSTCV      9
      INCLUDE 'CNFLAG.INS'                                              EPSTCV     10
      INCLUDE 'CNUNIT.INS'                                              EPSTCV     11
      INCLUDE 'CNMSG.INS'                                               EPSTCV     12
C                                                                       EPSTCV     13
      CHARACTER*80 STABB,STABB1,STABB2,STABB3                           EPSTCV     14
      DIMENSION EPSTAB(*),EPTEB(*)                                      EPSTCV     15
      CHARACTER*12 BUSNAM,BLANK                                         EPSTCV     16
      DATA BLANK/'            '/                                        EPSTCV     17
C                                                                       EPSTCV     18
      LDEB=(JDEB(95).NE.0)                                              EPSTCV     19
C                                                                       EPSTCV     20
         CALL FMOVE(0,EPSTAB,EPSTAB,J9S1D)                              EPSTCV     21
         CALL FMOVE(0,EPTEB,EPTEB,4)                                    EPSTCV     22
         IRMBUS=0                                                       EPSTCV     23
         IOHTYP=0                                                       EPSTCV     24
CD                                                                      EPSTCV     25
CD    BPA/WSCC/EPRI(OLD) TYPES SB - TEB --> EPRI(NEW) TYPE 1            EPSTCV     26
CD                                                                      EPSTCV     27
       IF(STABB(2:2).EQ.'B')THEN                                        EPSTCV     28
         ITEBX=1                                                        EPSTCV     29
         READ(STABB,1100) T1,T2,VTL,AK                                  EPSTCV     30
         IF(VTL.EQ.0.0)VTL=1.5                                          EPSTCV     31
         EPTEB(1)=AK                                                    EPSTCV     32
         EPTEB(2)=T1                                                    EPSTCV     33
         EPTEB(3)=T2                                                    EPSTCV     34
         EPTEB(4)=VTL                                                   EPSTCV     35
         GOTO 9900                                                      EPSTCV     36
       ENDIF                                                            EPSTCV     37
CD                                                                      EPSTCV     38
CD    BPA/WSCC/EPRI(OLD) TYPES S, P, F --> EPRI(NEW) TYPE 10.           EPSTCV     39
CD                                                                      EPSTCV     40
       IF (STABB(2:2).EQ.'S'.OR. STABB(2:2).EQ.'P' .OR. STABB(2:2)      EPSTCV     41
     + .EQ. 'F') THEN                                                   EPSTCV     42
          ISTABX = 10                                                   EPSTCV     43
          IBUS = 0                                                      EPSTCV     44
       READ(STABB,1000) S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,                 EPSTCV     45
     1                 S11,S12,S13,S14,BUSNAM                           EPSTCV     46
C                                                                       EPSTCV     47
       IF(S14.LE.0.0)THEN                                               EPSTCV     48
         S14=-S12                                                       EPSTCV     49
       ELSE                                                             EPSTCV     50
         S14=-S14                                                       EPSTCV     51
       ENDIF                                                            EPSTCV     52
C                                                                       EPSTCV     53
       IF (LDEB) WRITE(IUD6,1010) STABB(1:2),STABB(4:15),S1,S2,S3,      EPSTCV     54
     1      S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,BUSNAM                    EPSTCV     55
C                                                                       EPSTCV     56
C         DO CONVERSION                                                 EPSTCV     57
C                                                                       EPSTCV     58
          IF( BUSNAM .NE. BLANK)CALL CHKBUS(BUSNAM,IBUS)                EPSTCV     59
            IRMBUS=IBUS                                                 EPSTCV     60
            IF (STABB(2:2) .EQ. 'S')THEN                                EPSTCV     61
               ITYPE = 1                                                EPSTCV     62
            ELSEIF (STABB(2:2) .EQ. 'P')THEN                            EPSTCV     63
               ITYPE = 2                                                EPSTCV     64
            ELSE                                                        EPSTCV     65
               ITYPE = 3                                                EPSTCV     66
            ENDIF                                                       EPSTCV     67
C                                                                       EPSTCV     68
          IOHTYP=ITYPE                                                  EPSTCV     69
C                                                                       EPSTCV     70
          EPSTAB(1) =S3                                                 EPSTCV     71
          IF(ITYPE.EQ.3) THEN                                           EPSTCV     72
             IF(S4.LE.0.05)THEN                                         EPSTCV     73
               WRITE(MSG(1),1200)STABB(1:2),STABB(4:15)                 EPSTCV     74
               WRITE(MSG(2),1300)S4                                     EPSTCV     75
               WRITE(MSG(3),1400)                                       EPSTCV     76
               CALL PRTMSG(3)                                           EPSTCV     77
               S4=0.05                                                  EPSTCV     78
             ENDIF                                                      EPSTCV     79
             EPSTAB(2) =0.0                                             EPSTCV     80
             EPSTAB(15)=S4                                              EPSTCV     81
          ELSE                                                          EPSTCV     82
             EPSTAB(2) =S4                                              EPSTCV     83
             EPSTAB(15)=0.0                                             EPSTCV     84
          ENDIF                                                         EPSTCV     85
          EPSTAB(3) =S1                                                 EPSTCV     86
          EPSTAB(4) =S2                                                 EPSTCV     87
          EPSTAB(5) =S5                                                 EPSTCV     88
          EPSTAB(6) =S7                                                 EPSTCV     89
          EPSTAB(7) =S6                                                 EPSTCV     90
C                                                                       EPSTCV     91
          EPSTAB(8) =S9                                                 EPSTCV     92
          EPSTAB(9)=S8                                                  EPSTCV     93
          EPSTAB(10)=S11                                                EPSTCV     94
          EPSTAB(11)=S10                                                EPSTCV     95
          EPSTAB(12)=S12                                                EPSTCV     96
          EPSTAB(13)=S14                                                EPSTCV     97
          EPSTAB(14)=S13                                                EPSTCV     98
C                                                                       EPSTCV     99
          EPSTAB(16)=0.0                                                EPSTCV    100
          EPSTAB(17)=0.0                                                EPSTCV    101
          EPSTAB(18)=-99.0                                              EPSTCV    102
      ELSE                                                              EPSTCV    103
C                                                                       EPSTCV    104
C    BRANCH HERE IF NO CONVERSION.                                      EPSTCV    105
C                                                                       EPSTCV    106
      WRITE(MSG(1),1020) STABB(4:16)                                    EPSTCV    107
      WRITE(MSG(2),1021) STABB(2:2)                                     EPSTCV    108
      CALL PRTMSG(2)                                                    EPSTCV    109
      ISTABX=0                                                          EPSTCV    110
      ITEBX=0                                                           EPSTCV    111
C                                                                       EPSTCV    112
C     BRANCH HERE AFTER SUCCESSFUL CONVERSION                           EPSTCV    113
C                                                                       EPSTCV    114
      ENDIF                                                             EPSTCV    115
C                                                                       EPSTCV    116
 9900 RETURN                                                            EPSTCV    117
C                                                                       EPSTCV    118
 1000 FORMAT(BZ,T17,F4.3,T21,F3.3,T24,F4.3,T28,F3.3,T31,F4.2,T35,F4.3,  EPSTCV    119
     1       T39,F4.3,T43,F4.3,T47,F4.3,T51,F4.3,T55,F4.3,T59,F4.3,     EPSTCV    120
     1       T63,F4.3,T67,F2.2,T69,A12)                                 EPSTCV    121
 1010 FORMAT(1X,'! DEBUG (EPSTCV) STABILIZER TYPE ',A2,' BUS :',A12,    EPSTCV    122
     1       /1X,17(1X,F7.3))                                           EPSTCV    123
 1020 FORMAT(' *** WARNING GENERATOR AT BUS: ',A)                       EPSTCV    124
 1021 FORMAT(5X,'TYPE ',A                                               EPSTCV    125
     *,' STABILIZER IS NOT CONVERTABLE TO NEW EPRI MODEL')              EPSTCV    126
 1100 FORMAT(16X,3F5.4,F6.3)                                            EPSTCV    127
 1200 FORMAT(' *** WARNING - STABILIZER TYPE ',A2,' AT BUS :',A12)      EPSTCV    128
 1300 FORMAT('     SPECIFIED TRANSDUCER TIME CONSTANT IS ',F8.4)        EPSTCV    129
 1400 FORMAT('     IT IS SET TO BPA DEFAULT VALUE OF 0.05.')            EPSTCV    130
     +                                                                  EPSTCV    131
      END                                                               EPSTCV    132
