CFPRIME MDYNDA                                                          MDYNDA      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 MDYNDA(FILENA,LENPAR,IUY,KLAYER)                       MDYNDA      3
CD                                                                      MDYNDA      4
CD    THIS SUBROUTINE IS THE MAIN DRIVER FOR INTERACTIVE DYNAMIC DEVICE MDYNDA      5
CD    DATA MODIFICATION.                                                MDYNDA      6
CD                                                                      MDYNDA      7
      INCLUDE 'PARX.INS'                                                MDYNDA      8
      INCLUDE 'CNFLAG.INS'                                              MDYNDA      9
      INCLUDE 'CNLSTA.INS'                                              MDYNDA     10
      INCLUDE 'CNUNIT.INS'                                              MDYNDA     11
      INCLUDE 'CNLUN.INS'                                               MDYNDA     12
      INCLUDE 'GRDC01.INS'                                              MDYNDA     13
C                                                                       MDYNDA     14
      CHARACTER*80 MSG,STRING                                           MDYNDA     15
      CHARACTER*50 FILENA                                               MDYNDA     16
      CHARACTER*7 SUBPMT                                                MDYNDA     17
C                                                                       MDYNDA     18
      LDEB=(JDEB(4).NE.0)                                               MDYNDA     19
      SUBPMT='MDYNDA '                                                  MDYNDA     20
C                                                                       MDYNDA     21
C    ..........................................................         MDYNDA     22
C    :GET ITEM TO BE CHANGE                                   :         MDYNDA     23
 100  CONTINUE                                                          MDYNDA     24
      IF(JTHDC.EQ.2) THEN                                               MDYNDA     25
         WRITE(LOUT,1000) 'ON'                                          MDYNDA     26
      ELSE                                                              MDYNDA     27
         WRITE(LOUT,1000) 'OFF'                                         MDYNDA     28
      ENDIF                                                             MDYNDA     29
      MSG='SELECT AN ITEM BY THE NUMBER (Q TO QUIT):'                   MDYNDA     30
      CALL REDLIN(LOUT,LIN,JERR,41,MSG,SUBPMT,'MDY',STRING,RECORD,      MDYNDA     31
     &IREC,KLAYER,KEND,KREAD,PLAYBA)                                    MDYNDA     32
      IF (JERR.LT.0)THEN                                                MDYNDA     33
      IF(PLAYBA)CALL PSTOP                                              MDYNDA     34
      GOTO 100                                                          MDYNDA     35
      ENDIF                                                             MDYNDA     36
      IF (KLAYER.LT.0) RETURN                                           MDYNDA     37
      IF (STRING(1:1).EQ.'Q'.OR.STRING(1:1).EQ.'q') GOTO 500            MDYNDA     38
      READ(STRING,*,IOSTAT=IOS) NTYPE                                   MDYNDA     39
      IF (IOS.NE.0.OR.NTYPE.LE.0.OR.NTYPE.GT.12)THEN                    MDYNDA     40
      IF(PLAYBA)CALL PSTOP                                              MDYNDA     41
      GOTO 100                                                          MDYNDA     42
      ENDIF                                                             MDYNDA     43
C                                                                       MDYNDA     44
C            DYNDAT RRDGED 'DGEN','MOTO',                               MDYNDA     45
      GOTO (    200,   210,   230,   260                                MDYNDA     46
C      ,'NSVC','NRAN','NSTP','NSDB','NLBS','IBUS','HVDC','STAND'        MDYNDA     47
     & ,  290,   300,   310,   330,   340,   250,   350,  380), NTYPE   MDYNDA     48
C ........................................................              MDYNDA     49
C                                                                       MDYNDA     50
  200 CONTINUE                                                          MDYNDA     51
C                                                                       MDYNDA     52
C  READ IN MORE DYNAMIC MODEL DATA                                      MDYNDA     53
C                                                                       MDYNDA     54
      CALL DYNDAT(FILENA,LENPAR,IUY,KLAYER)                             MDYNDA     55
C                                                                       MDYNDA     56
      GOTO 100                                                          MDYNDA     57
C                                                                       MDYNDA     58
  210 CONTINUE                                                          MDYNDA     59
C                                                                       MDYNDA     60
C  READ GENERATOR DYNAMIC DATA MODIFICATIONS                            MDYNDA     61
C                                                                       MDYNDA     62
      STRING='ENTER GENERATOR DYNAMIC DATA MODIFICATIONS FILE NAME:'    MDYNDA     63
      MSG=' *** ERROR IN OPENING GENERATOR DYNAMIC'//                   MDYNDA     64
     1    ' DATA MODIFICATIONS FILE'                                    MDYNDA     65
      IKEY=1                                                            MDYNDA     66
      JLENG=0                                                           MDYNDA     67
C                                                                       MDYNDA     68
      WRITE(LOUT,*)                                                     MDYNDA     69
      CALL FILEMG(IU50,53,STRING,63,MSG,SUBPMT,IKEY,JLENG,IEBK)         MDYNDA     70
      IF(IEBK.NE.0)THEN                                                 MDYNDA     71
      IF(PLAYBA)CALL PSTOP                                              MDYNDA     72
      GOTO 100                                                          MDYNDA     73
      ENDIF                                                             MDYNDA     74
C                                                                       MDYNDA     75
      CALL RRDGED(ICODE,IU50,IUY,IEBK)                                  MDYNDA     76
      CALL CLOSEF(IU50)                                                 MDYNDA     77
C                                                                       MDYNDA     78
      GOTO 100                                                          MDYNDA     79
C                                                                       MDYNDA     80
  230 CONTINUE                                                          MDYNDA     81
C                                                                       MDYNDA     82
C  MODIFYING DETAILED GENERATOR DATA                                    MDYNDA     83
C                                                                       MDYNDA     84
      CALL MDGEDA(ICODE,IEBK)                                           MDYNDA     85
C                                                                       MDYNDA     86
      GOTO 100                                                          MDYNDA     87
C                                                                       MDYNDA     88
C  240 CONTINUE                                                         MDYNDA     89
C                                                                       MDYNDA     90
C  MODIFYING CLASSICAL GENERATOR DATA                                   MDYNDA     91
C                                                                       MDYNDA     92
C      CALL MCGEDA(ICODE,IEBK)                                          MDYNDA     93
C      GOTO 100                                                         MDYNDA     94
C                                                                       MDYNDA     95
  250 CONTINUE                                                          MDYNDA     96
C                                                                       MDYNDA     97
C  MODIFYING INFINITE BUS DATA                                          MDYNDA     98
C                                                                       MDYNDA     99
      CALL MIFBDA                                                       MDYNDA    100
      GOTO 100                                                          MDYNDA    101
  260 CONTINUE                                                          MDYNDA    102
C                                                                       MDYNDA    103
C  MODIFYING INDUCTION MOTOR DATA                                       MDYNDA    104
C                                                                       MDYNDA    105
      CALL MIMODA                                                       MDYNDA    106
C                                                                       MDYNDA    107
      GOTO 100                                                          MDYNDA    108
C                                                                       MDYNDA    109
  290 CONTINUE                                                          MDYNDA    110
C                                                                       MDYNDA    111
C  MODIFYING SVC DATA                                                   MDYNDA    112
C                                                                       MDYNDA    113
      CALL MSVCDA                                                       MDYNDA    114
      GOTO 100                                                          MDYNDA    115
C                                                                       MDYNDA    116
  300 CONTINUE                                                          MDYNDA    117
C                                                                       MDYNDA    118
C  MODIFYING RANI DATA                                                  MDYNDA    119
C                                                                       MDYNDA    120
      CALL MRANDA                                                       MDYNDA    121
      GOTO 100                                                          MDYNDA    122
C                                                                       MDYNDA    123
  310 CONTINUE                                                          MDYNDA    124
C                                                                       MDYNDA    125
C  MODIFYING STP DATA                                                   MDYNDA    126
C                                                                       MDYNDA    127
      CALL MSTPDA                                                       MDYNDA    128
      GOTO 100                                                          MDYNDA    129
C                                                                       MDYNDA    130
  330 CONTINUE                                                          MDYNDA    131
C                                                                       MDYNDA    132
C  MODIFYING SDB DATA                                                   MDYNDA    133
C                                                                       MDYNDA    134
      CALL MSDBDA                                                       MDYNDA    135
      GOTO 100                                                          MDYNDA    136
C                                                                       MDYNDA    137
  340 CONTINUE                                                          MDYNDA    138
C                                                                       MDYNDA    139
C  MODIFYING NON-LINEAR LOAD DATA                                       MDYNDA    140
C                                                                       MDYNDA    141
      CALL MNLBDA                                                       MDYNDA    142
      GOTO 100                                                          MDYNDA    143
C                                                                       MDYNDA    144
 350  CONTINUE                                                          MDYNDA    145
C                                                                       MDYNDA    146
C  SIMPLIFIED HVDC CONVERTER REPRESENTATION                             MDYNDA    147
C                                                                       MDYNDA    148
      DO 370 I = 1, ICDC                                                MDYNDA    149
      J = IDC(I)                                                        MDYNDA    150
      IF(J. EQ. 0) GO TO 370                                            MDYNDA    151
 360  CONTINUE                                                          MDYNDA    152
      IF(ICTYPE(J).GT.0) THEN                                           MDYNDA    153
         MSG=' FULL REPRESENTATION'                                     MDYNDA    154
      ELSE                                                              MDYNDA    155
         MSG=' SIMPLIFIED REPRESENTATION'                               MDYNDA    156
      ENDIF                                                             MDYNDA    157
      WRITE(LOUT,1020) DCCNAM(J),MSG                                    MDYNDA    158
      MSG='CHANGE REPRESENTATION OF THE ABOVE CONVERTER ? (Y/N) '       MDYNDA    159
      CALL PMTRED(LOUT,LIN,JERR,53,MSG,'CA2',STRING,KREAD,PLAYBA)       MDYNDA    160
      IF(RECORD) WRITE(IREC,'(A)') STRING                               MDYNDA    161
      IF(STRING(1:1).EQ.'Y'.OR.STRING(1:1).EQ.'y') ICTYPE(J)=-ICTYPE(J) MDYNDA    162
      IF(JERR.LT.0)THEN                                                 MDYNDA    163
      IF(PLAYBA)CALL PSTOP                                              MDYNDA    164
      GOTO 360                                                          MDYNDA    165
      ENDIF                                                             MDYNDA    166
 370  CONTINUE                                                          MDYNDA    167
      GOTO 100                                                          MDYNDA    168
C                                                                       MDYNDA    169
 380  CONTINUE                                                          MDYNDA    170
C                                                                       MDYNDA    171
C  STAND ALONE HVDC (AND/OR FACTS)                                      MDYNDA    172
C                                                                       MDYNDA    173
      IF(JTHDC.EQ.2)THEN                                                MDYNDA    174
        JTHDC=0                                                         MDYNDA    175
      ELSE                                                              MDYNDA    176
        JTHDC=2                                                         MDYNDA    177
      ENDIF                                                             MDYNDA    178
      GOTO 100                                                          MDYNDA    179
C                                                                       MDYNDA    180
C                                                                       MDYNDA    181
  500 CONTINUE                                                          MDYNDA    182
C                                                                       MDYNDA    183
      RETURN                                                            MDYNDA    184
C                                                                       MDYNDA    185
 1000 FORMAT(//,                                                        MDYNDA    186
     17X,'DYNAMIC DATA INPUT AND MODIFICATIONS',/,                      MDYNDA    187
     27X,'------------------------------------',//,                     MDYNDA    188
     32X,' (1) READ DYNAMIC DATA FROM FILES',/,                         MDYNDA    189
     42X,' (2) READ GENERATOR DYNAMIC DATA MODIFICATIONS FROM FILES',/, MDYNDA    190
     52X,' (3) MODIFICATIONS OF GENERATOR DATA',/,                      MDYNDA    191
     62X,' (4) MODIFICATIONS OF INDUCTION MOTOR DATA',/,                MDYNDA    192
     72X,' (5) MODIFICATIONS OF SVC OR SATURABLE REACTOR DATA',/,       MDYNDA    193
     82X,' (6) MODIFICATIONS OF TCSC DATA',/,                           MDYNDA    194
     92X,' (7) MODIFICATIONS OF TCTC/TCPR DATA',/,                      MDYNDA    195
     *2X,' (8) MODIFICATIONS OF TCBR/TCBC DATA',/,                      MDYNDA    196
     12X,' (9) MODIFICATIONS OF NONLINEAR LOAD DATA',/,                 MDYNDA    197
     22X,'(10) MODIFICATIONS OF INFINITE BUS DATA',/,                   MDYNDA    198
     32X,'(11) FULL/SIMPLIFIED HVDC CONVERTER REPRESENTATION',/,        MDYNDA    199
     42X,'(12) STAND ALONE HVDC (AND/OR FACTS): ',A,/)                  MDYNDA    200
 1020 FORMAT(/,10X,'"',A29,'"',A,/)                                     MDYNDA    201
C                                                                       MDYNDA    202
       END                                                              MDYNDA    203
