CFPRIME DCCONI                                                          DCCONI      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  DCCONI                                                DCCONI      3
CD -------------------------------------------------------------------  DCCONI      4
CD                                                                      DCCONI      5
CD              *****     DCCONI  ROUTINE   *****                       DCCONI      6
CD                                                                      DCCONI      7
CD -------------------------------------------------------------------  DCCONI      8
CD                                                                      DCCONI      9
CD       PURPOSE: Control the initialization of the UDC controls.       DCCONI     10
CD                                                                      DCCONI     11
CD                                                                      DCCONI     12
CD                                                                      DCCONI     13
CD       DEFINITION OF LOCAL VARIABLES:                                 DCCONI     14
CD                I      - 'do' loop index.                             DCCONI     15
CD                PRINT  -  indicates that titles for output are        DCCONI     16
CD                          needed.                                     DCCONI     17
CD                                                                      DCCONI     18
CD -------------------------------------------------------------------  DCCONI     19
      INCLUDE 'CNFLAG.INS'                                              DCCONI     20
      INCLUDE 'PARX.INS'                                                DCCONI     21
      INCLUDE 'CNPT.INS'                                                DCCONI     22
      INCLUDE 'GRDC01.INS'                                              DCCONI     23
      INCLUDE 'GRPDCS.INS'                                              DCCONI     24
      INCLUDE 'UDCA.INS'                                                DCCONI     25
      INCLUDE 'UDCE.INS'                                                DCCONI     26
      INCLUDE 'UDCF.INS'                                                DCCONI     27
      INCLUDE 'UDCG.INS'                                                DCCONI     28
      INCLUDE 'UDCH.INS'                                                DCCONI     29
      INCLUDE 'UDCJ.INS'                                                DCCONI     30
      INCLUDE 'CNMSG.INS'                                               DCCONI     31
C                                                                       DCCONI     32
C                                                                       DCCONI     33
      LOGICAL       XPRINT                                              DCCONI     34
C                                                                       DCCONI     35
      LDEB=.FALSE.                                                      DCCONI     36
C                                                                       DCCONI     37
C---------------------------------------------------------------------  DCCONI     38
C                                                                       DCCONI     39
      IF (HIST .AND. NACLIN .GT. 0) THEN                                DCCONI     40
C                                                                       DCCONI     41
C        Initialize line monitoring flags 1 MEANS NOT IN SERVICE        DCCONI     42
C                                                                       DCCONI     43
         DO 10 I = 1, NACLIN                                            DCCONI     44
            LINSER(I) = 1                                               DCCONI     45
10       CONTINUE                                                       DCCONI     46
      END IF                                                            DCCONI     47
C                                                                       DCCONI     48
      CALL UDINIT                                                       DCCONI     49
C                                                                       DCCONI     50
      CALL UDCONV                                                       DCCONI     51
C                                                                       DCCONI     52
      CALL URLIST                                                       DCCONI     53
C                                                                       DCCONI     54
      I = IDELFR - 1                                                    DCCONI     55
      WRITE(MSG(1),9010)                                                DCCONI     56
      WRITE(MSG(2),9020) I                                              DCCONI     57
      WRITE(MSG(3),9030) LEND                                           DCCONI     58
      WRITE(MSG(4),9040) IERCNT                                         DCCONI     59
      CALL PRTMSG(4)                                                    DCCONI     60
      IF (IERCNT .GT. 0) THEN                                           DCCONI     61
      MSG(1)='TERMINATED DUE TO ERRORS IN MTDC INITIALIZATION'          DCCONI     62
      CALL ASTOP(MSG(1),47)                                             DCCONI     63
      END IF                                                            DCCONI     64
C                                                                       DCCONI     65
C     Print initial solution                                            DCCONI     66
C                                                                       DCCONI     67
      XPRINT = .TRUE.                                                   DCCONI     68
      CALL USPRNT (XPRINT,IUD6)                                         DCCONI     69
C                                                                       DCCONI     70
      IF (SOLDC) CALL UDORDI                                            DCCONI     71
C                                                                       DCCONI     72
      IF (IERCNT .GT. 0) THEN                                           DCCONI     73
         MSG(1)='TERMINATED, MISSING REQUIRED UDC BLOCKS'               DCCONI     74
         CALL ASTOP(MSG(1),39)                                          DCCONI     75
      END IF                                                            DCCONI     76
C                                                                       DCCONI     77
      JTHDC1=1                                                          DCCONI     78
      DO 20 I = 1, ICDC                                                 DCCONI     79
      JPOSN = IDC(I)                                                    DCCONI     80
      IF(ICTYPE(JPOSN) .LT. 0) THEN                                     DCCONI     81
C                                                                       DCCONI     82
C        simplified converter                                           DCCONI     83
C                                                                       DCCONI     84
         WRITE(MSG(1),9050) DCCNAM(JPOSN)                               DCCONI     85
         IF(ICTYPE(JPOSN) .EQ. -1) THEN                                 DCCONI     86
C                                                                       DCCONI     87
C           line commutation                                            DCCONI     88
C                                                                       DCCONI     89
            WRITE(MSG(2),9060)                                          DCCONI     90
         ELSE                                                           DCCONI     91
C                                                                       DCCONI     92
C           self commutation                                            DCCONI     93
C                                                                       DCCONI     94
            WRITE(MSG(2),9070)                                          DCCONI     95
         ENDIF                                                          DCCONI     96
         CALL PRTMSG(2)                                                 DCCONI     97
C                                                                       DCCONI     98
C        block the simplified converters                                DCCONI     99
C                                                                       DCCONI    100
         JBLK=IUCBRE(JPOSN)                                             DCCONI    101
         NEXTR1 = IUDRPT(JBLK)                                          DCCONI    102
         UDRKW(NEXTR1) = 'BLOCK'                                        DCCONI    103
         UDRELA(NEXTR1) = 'XX'                                          DCCONI    104
      ELSE                                                              DCCONI    105
         JTHDC1=0                                                       DCCONI    106
      ENDIF                                                             DCCONI    107
   20 CONTINUE                                                          DCCONI    108
C                                                                       DCCONI    109
C     set JTHDC for all converters simplified                           DCCONI    110
C                                                                       DCCONI    111
      IF(JTHDC.EQ.0.AND.JTHDC1.EQ.1) JTHDC=1                            DCCONI    112
C                                                                       DCCONI    113
C---------------------------------------------------------------------  DCCONI    114
C                                                                       DCCONI    115
      RETURN                                                            DCCONI    116
C                                                                       DCCONI    117
C---------------------------------------------------------------------  DCCONI    118
C                                                                       DCCONI    119
 9010 FORMAT(' MTDC DATA AND ERROR MESSAGE:')                           DCCONI    120
 9020 FORMAT(' * THE DELAY LIST HAS A LENGTH OF ',I4)                   DCCONI    121
 9030 FORMAT(' * THE MAXIMUM LENGTH IS ',I4)                            DCCONI    122
 9040 FORMAT(' * THERE WERE ',I2,' USER DEFINED CONTROL (UDC)'          DCCONI    123
     *,' INITIALIZATION ERRORS.')                                       DCCONI    124
 9050 FORMAT(' * CONVERTER "', A29,'"')                                 DCCONI    125
 9060 FORMAT('   WILL BE REPRESENTED BY CONSTANT ID AND VD.')           DCCONI    126
 9070 FORMAT('   WILL BE REPRESENTED BY CONSTANT ID AND VD AND',        DCCONI    127
     *' UNITY POWER FACTOR.')                                           DCCONI    128
C                                                                       DCCONI    129
C---------------------------------------------------------------------  DCCONI    130
C                                                                       DCCONI    131
      END                                                               DCCONI    132
