CFPRIME PCHAN                                                           PCHAN       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 PCHAN                                                  PCHAN       3
CD                                                                      PCHAN       4
CD    TO STORE INFORMATION FOR THE MONITORED VARIABLES (I.E.CHANNEL     PCHAN       5
CD    TYPE, FROM AND TO BUS NUMBER ETC.) AS REQUIRED BY THE OAP.        PCHAN       6
CD                                                                      PCHAN       7
      INCLUDE 'PARX.INS'                                                PCHAN       8
      INCLUDE 'CNPT.INS'                                                PCHAN       9
      INCLUDE 'CNIPTR.INS'                                              PCHAN      10
      INCLUDE 'CNSTN.INS'                                               PCHAN      11
      INCLUDE 'CNB0.INS'                                                PCHAN      12
      INCLUDE 'CNB1.INS'                                                PCHAN      13
      INCLUDE 'CNB8.INS'                                                PCHAN      14
      INCLUDE 'CNB19.INS'                                               PCHAN      15
      INCLUDE 'CNIOUT.INS'                                              PCHAN      16
      INCLUDE 'CNMDAT.INS'                                              PCHAN      17
      INCLUDE 'CNUNIT.INS'                                              PCHAN      18
      INCLUDE 'CNMON.INS'                                               PCHAN      19
      INCLUDE 'CNFLAG.INS'                                              PCHAN      20
      INCLUDE 'CNRAN.INS'                                               PCHAN      21
      INCLUDE 'CNSTP.INS'                                               PCHAN      22
      INCLUDE 'UDCA.INS'                                                PCHAN      23
      INCLUDE 'GRDC01.INS'                                              PCHAN      24
      INCLUDE 'CNREC9.INS'                                              PCHAN      25
      INCLUDE 'CNINTE.INS'                                              PCHAN      26
      DIMENSION LNTERF(6,NITERF)                                        PCHAN      27
      EQUIVALENCE (LNTERF(1,1),KNTERF(1,1))                             PCHAN      28
C                                                                       PCHAN      29
      DIMENSION JJNAME(2,7*NDCC)                                        PCHAN      30
      DIMENSION IITY(3*NBUF)                                            PCHAN      31
      DIMENSION RREC9(128)                                              PCHAN      32
      EQUIVALENCE (IREC9(1),RREC9(1))                                   PCHAN      33
C                                                                       PCHAN      34
      COMMON /SCRAT2/ ITY(3,NBUF),JNAME(6,NBUF)                         PCHAN      35
      EQUIVALENCE (IITY(1),ITY(1,1))                                    PCHAN      36
C                                                                       PCHAN      37
      CHARACTER*2 CNT4                                                  PCHAN      38
C                                                                       PCHAN      39
      INTEGER*4    IUID                                                 PCHAN      40
      CHARACTER*4  CNAME1,CNAME2,CNAME3,CNAME4                          PCHAN      41
      CHARACTER*2  UID                                                  PCHAN      42
      CHARACTER*4  CNAME5,CNAME6,CNAME7,CNAME8                          PCHAN      43
      EQUIVALENCE (JNAME1,CNAME1),(JNAME2,CNAME2),(JNAME3,CNAME3)       PCHAN      44
      EQUIVALENCE (JNAME4,CNAME4),(JNAME5,CNAME5),(JNAME6,CNAME6)       PCHAN      45
      EQUIVALENCE (JNAME7,CNAME7),(JNAME8,CNAME8)                       PCHAN      46
      CHARACTER*29 LDCNAM                                               PCHAN      47
      CHARACTER*17 LUDNAM                                               PCHAN      48
      CHARACTER*8  KNAME(8),DCNAME                                      PCHAN      49
C                                                                       PCHAN      50
      DIMENSION NCHAN(35),MCHAN(35)                                     PCHAN      51
C                                                                       PCHAN      52
C               'AGEO','BGEO','CGEO','GCOS','GOVV','GENS','GYVA'        PCHAN      53
      DATA NCHAN/   4 ,    7 ,   12 ,    4 ,    5 ,    0 ,    0         PCHAN      54
C              ,'AMOT','BMOT','ASVO','CONV','UDCO','ALOA'               PCHAN      55
     &         ,    4 ,    6 ,    3 ,    7 ,    1 ,    5                PCHAN      56
C              ,'LINE','SLIN','MVBS','DVOL','UEXC'                      PCHAN      57
     &         ,    6 ,    2 ,    2 ,    1 ,    0                       PCHAN      58
C              ,'UPSS','UEXL','UGOV','USVC','URAN','USTC','USPS','USDB' PCHAN      59
     &         ,    0 ,    0 ,    0 ,    0 ,    0 ,    0 ,    0 ,    0  PCHAN      60
C              'AFBO','BFBO','CFBO','FFBO','PWRA','PWRB','CANA','CANB'  PCHAN      61
     &         ,   10 ,   20 ,   27 ,    9 ,  8 ,   17 ,    8 ,   17    PCHAN      62
C              'BWRA'                                                   PCHAN      63
     &         ,   22/                                                  PCHAN      64
C               'AGEO','BGEO','CGEO','GCOS','GOVV','GENS','GYVA'        PCHAN      65
      DATA MCHAN/   0 ,    0 ,    0 ,   12 ,   16 ,  500 ,  600         PCHAN      66
C              ,'AMOT','BMOT','ASVO','CONV','UDCO','ALOA'               PCHAN      67
     &         ,   21 ,   21,   27  ,   45 ,  700 ,   30                PCHAN      68
C              ,'LINE','SLIN','MVBS','DVOL','UEXC'                      PCHAN      69
     &         ,   35 ,   41 ,  43  ,   53 ,  800                       PCHAN      70
C              ,'UPSS','UEXL','UGOV','USVC','URAN','USTC','USPS','USDB' PCHAN      71
     &         ,  900 , 1000 , 1100 , 1200 , 1300 , 1400 , 1500 , 1600  PCHAN      72
C               'AFBO','BFBO','CFBO','FFBO','PWRA','PWRB','CANA','CANB' PCHAN      73
     &         ,   65 ,   65 ,   65 ,   92 ,  137,  137 ,  154,   154   PCHAN      74
C               'BWRA'                                                  PCHAN      75
     &         ,  171/                                                  PCHAN      76
CD                                                                      PCHAN      77
CD     ITY(1,ISCHAN) STORES CHANNEL TYPE AND CIRCUIT OR UNIT IDENTITY   PCHAN      78
CD     ITY(2,ISCHAN) STORES THE FROM BUS NUMBER                         PCHAN      79
CD     ITY(3,ISCHAN) STORES THE TO BUS NUMBER IF APPLICABLE             PCHAN      80
CD                                                                      PCHAN      81
      LDEB=(JDEB(32).NE.0)                                              PCHAN      82
C                                                                       PCHAN      83
      NLF=0                                                             PCHAN      84
      IOFF=0                                                            PCHAN      85
      IRECJ=0                                                           PCHAN      86
C                                                                       PCHAN      87
      IF(LDEB)WRITE(IUD6,6660) (KOPDAT(JJ),JJ=1,500)                    PCHAN      88
C                                                                       PCHAN      89
C  GENERATORS                                                           PCHAN      90
C                                                                       PCHAN      91
      DO 120 K=1,NOPTR                                                  PCHAN      92
      IPOS=KOPTR(K)                                                     PCHAN      93
      JSEM=KOPDAT(IPOS+1)                                               PCHAN      94
      IF(JSEM.LT.4)THEN                                                 PCHAN      95
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN      96
      IF(ICOUNX .EQ. 0)GOTO 120                                         PCHAN      97
      IPOS=IPOS+2                                                       PCHAN      98
C                                                                       PCHAN      99
C  PULL OUT THE BUS NUMBER AND DEVICE NAME                              PCHAN     100
C                                                                       PCHAN     101
      ICOUNT=0                                                          PCHAN     102
 100  ICOUNT=ICOUNT+1                                                   PCHAN     103
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     104
      IF(IPBNO.LE.IPNODE)THEN                                           PCHAN     105
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     106
      IMAC =KOPDAT(IPOS+2)                                              PCHAN     107
      IF(IMAC.NE.0)THEN                                                 PCHAN     108
C                                                                       PCHAN     109
      NLF=NOLD(IPBNO)                                                   PCHAN     110
      IGVN=ICONTA(2,IMAC)                                               PCHAN     111
      IF (IGVN.EQ.46) IGVN=0                                            PCHAN     112
C                                                                       PCHAN     113
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     114
C                                                                       PCHAN     115
      K3=IPBNO*3                                                        PCHAN     116
      JNAME1=INAME(K3-2)                                                PCHAN     117
      JNAME2=INAME(K3-1)                                                PCHAN     118
      JNAME3=INAME(K3)                                                  PCHAN     119
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     120
      ENDIF                                                             PCHAN     121
C                                                                       PCHAN     122
C  STORE CHANNEL NUMBERS IN BUF                                         PCHAN     123
C                                                                       PCHAN     124
      LITEM=NCHAN(JSEM)                                                 PCHAN     125
      JITEM=0                                                           PCHAN     126
 110  JITEM=JITEM+1                                                     PCHAN     127
      ISCHAN=ISCHAN+1                                                   PCHAN     128
      CALL PACK(UID,JITEM,ITFK)                                         PCHAN     129
      ITY(1,ISCHAN)=ITFK                                                PCHAN     130
      ITY(2,ISCHAN)=NLF                                                 PCHAN     131
      ITY(3,ISCHAN)=0                                                   PCHAN     132
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     133
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     134
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     135
      IF(JITEM.LT.LITEM)GOTO 110                                        PCHAN     136
      ENDIF                                                             PCHAN     137
      IPOS=IPOS+4                                                       PCHAN     138
      IF(ICOUNT.LT.ICOUNX)GOTO 100                                      PCHAN     139
      ENDIF                                                             PCHAN     140
 120  CONTINUE                                                          PCHAN     141
C                                                                       PCHAN     142
C  GENERATOR EXCITATION AND GOVERNOR CONTROL SIGNALS                    PCHAN     143
C                                                                       PCHAN     144
      IF(NGCOSO.NE.0)THEN                                               PCHAN     145
C                                                                       PCHAN     146
      DO 320 K=1,NOPTR                                                  PCHAN     147
      IPOS=KOPTR(K)                                                     PCHAN     148
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     149
      IF(JSEM.EQ.4)THEN                                                 PCHAN     150
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     151
      IF(ICOUNX .EQ. 0)GOTO 320                                         PCHAN     152
      IPOS=IPOS+2                                                       PCHAN     153
      ICOUNT=0                                                          PCHAN     154
 300  ICOUNT=ICOUNT+1                                                   PCHAN     155
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     156
      NLF=0                                                             PCHAN     157
      IF(IPBNO.NE.0)THEN                                                PCHAN     158
      NLF=NOLD(IPBNO)                                                   PCHAN     159
C                                                                       PCHAN     160
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     161
C                                                                       PCHAN     162
      K3=IPBNO*3                                                        PCHAN     163
      JNAME1=INAME(K3-2)                                                PCHAN     164
      JNAME2=INAME(K3-1)                                                PCHAN     165
      JNAME3=INAME(K3)                                                  PCHAN     166
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     167
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     168
      IF(IMAC.NE.0)THEN                                                 PCHAN     169
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     170
      ELSE                                                              PCHAN     171
      UID='  '                                                          PCHAN     172
      ENDIF                                                             PCHAN     173
      LITEM=NCHAN(JSEM)                                                 PCHAN     174
      MCHANX=MCHAN(JSEM)                                                PCHAN     175
      JITEM=0                                                           PCHAN     176
 310  JITEM=JITEM+1                                                     PCHAN     177
      ISCHAN=ISCHAN+1                                                   PCHAN     178
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     179
      ITY(1,ISCHAN)=ITFK                                                PCHAN     180
      ITY(2,ISCHAN)=NLF                                                 PCHAN     181
      ITY(3,ISCHAN)=0                                                   PCHAN     182
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     183
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     184
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     185
      IF(JITEM.LT.LITEM)GOTO 310                                        PCHAN     186
C                                                                       PCHAN     187
C   ENDIF IPBNO.NE.0                                                    PCHAN     188
C                                                                       PCHAN     189
      ENDIF                                                             PCHAN     190
      IPOS=IPOS+3                                                       PCHAN     191
      IF(ICOUNT.LT.ICOUNX)GOTO 300                                      PCHAN     192
      ENDIF                                                             PCHAN     193
C                                                                       PCHAN     194
 320  CONTINUE                                                          PCHAN     195
C                                                                       PCHAN     196
C   ENDIF NGCOSO.NE.0                                                   PCHAN     197
C                                                                       PCHAN     198
      ENDIF                                                             PCHAN     199
C                                                                       PCHAN     200
C  GENERATOR GOVERNOR VARIABLES                                         PCHAN     201
C                                                                       PCHAN     202
      IF(NGOVVO.NE.0)THEN                                               PCHAN     203
C                                                                       PCHAN     204
      DO 370 K=1,NOPTR                                                  PCHAN     205
      IPOS=KOPTR(K)                                                     PCHAN     206
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     207
      IF(JSEM.EQ.5)THEN                                                 PCHAN     208
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     209
      IF(ICOUNX .EQ. 0)GOTO 370                                         PCHAN     210
      IPOS=IPOS+2                                                       PCHAN     211
      ICOUNT=0                                                          PCHAN     212
 350  ICOUNT=ICOUNT+1                                                   PCHAN     213
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     214
      NLF=0                                                             PCHAN     215
      IF(IPBNO.GT.0)THEN                                                PCHAN     216
      NLF=NOLD(IPBNO)                                                   PCHAN     217
C                                                                       PCHAN     218
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     219
C                                                                       PCHAN     220
      K3=IPBNO*3                                                        PCHAN     221
      JNAME1=INAME(K3-2)                                                PCHAN     222
      JNAME2=INAME(K3-1)                                                PCHAN     223
      JNAME3=INAME(K3)                                                  PCHAN     224
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     225
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     226
      IF(IMAC.NE.0)THEN                                                 PCHAN     227
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     228
      ELSE                                                              PCHAN     229
      UID='  '                                                          PCHAN     230
      ENDIF                                                             PCHAN     231
      LITEM=NCHAN(JSEM)                                                 PCHAN     232
      MCHANX=MCHAN(JSEM)                                                PCHAN     233
      JITEM=0                                                           PCHAN     234
 360  JITEM=JITEM+1                                                     PCHAN     235
      ISCHAN=ISCHAN+1                                                   PCHAN     236
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     237
      ITY(1,ISCHAN)=ITFK                                                PCHAN     238
      ITY(2,ISCHAN)=NLF                                                 PCHAN     239
      ITY(3,ISCHAN)=0                                                   PCHAN     240
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     241
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     242
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     243
      IF(JITEM.LT.LITEM)GOTO 360                                        PCHAN     244
C                                                                       PCHAN     245
C   ENDIF IPBNO.GT.0                                                    PCHAN     246
C                                                                       PCHAN     247
      ENDIF                                                             PCHAN     248
      IPOS=IPOS+3                                                       PCHAN     249
      IF(ICOUNT.LT.ICOUNX)GOTO 350                                      PCHAN     250
      ENDIF                                                             PCHAN     251
C                                                                       PCHAN     252
 370  CONTINUE                                                          PCHAN     253
C                                                                       PCHAN     254
C   ENDIF NGCOSO.NE.0                                                   PCHAN     255
C                                                                       PCHAN     256
      ENDIF                                                             PCHAN     257
C                                                                       PCHAN     258
C                                                                       PCHAN     259
C  FOSSIL FIRED BOILER OUTPUT VARIABLES                                 PCHAN     260
C                                                                       PCHAN     261
      IF(NFBOUT.NE.0)THEN                                               PCHAN     262
C                                                                       PCHAN     263
C   PRINT FRONT PAGE : TITLE & LIST OF SYMBOLS                          PCHAN     264
C                                                                       PCHAN     265
      DO 1030 K=1,NOPTR                                                 PCHAN     266
      IPOS=KOPTR(K)                                                     PCHAN     267
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     268
      IF(JSEM.GE.27 .AND. JSEM.LE.29)THEN                               PCHAN     269
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     270
      IF(ICOUNX.EQ.0)GOTO 1030                                          PCHAN     271
      IPOS=IPOS+2                                                       PCHAN     272
      ICOUNT=0                                                          PCHAN     273
 1010 ICOUNT=ICOUNT+1                                                   PCHAN     274
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     275
      NLF=0                                                             PCHAN     276
      IF(IPBNO.NE.0)THEN                                                PCHAN     277
      NLF=NOLD(IPBNO)                                                   PCHAN     278
C                                                                       PCHAN     279
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     280
C                                                                       PCHAN     281
      K3=IPBNO*3                                                        PCHAN     282
      JNAME1=INAME(K3-2)                                                PCHAN     283
      JNAME2=INAME(K3-1)                                                PCHAN     284
      JNAME3=INAME(K3)                                                  PCHAN     285
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     286
      IGVN=ICONTA(2,IMAC)                                               PCHAN     287
      ISHIFT=0                                                          PCHAN     288
      IF(IGVN.EQ.43)ISHIFT=36                                           PCHAN     289
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     290
      IF(IMAC.LE.NT)THEN                                                PCHAN     291
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     292
      ELSE                                                              PCHAN     293
      UID='  '                                                          PCHAN     294
      ENDIF                                                             PCHAN     295
      LITEM=NCHAN(JSEM)                                                 PCHAN     296
      MCHANX=MCHAN(JSEM)                                                PCHAN     297
      JITEM=0                                                           PCHAN     298
 1020 JITEM=JITEM+1                                                     PCHAN     299
      ISCHAN=ISCHAN+1                                                   PCHAN     300
      CALL PACK(UID,JITEM+MCHANX+ISHIFT,ITFK)                           PCHAN     301
      ITY(1,ISCHAN)=ITFK                                                PCHAN     302
      ITY(2,ISCHAN)=NLF                                                 PCHAN     303
      ITY(3,ISCHAN)=0                                                   PCHAN     304
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     305
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     306
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     307
      IF(JITEM.LT.LITEM)GOTO 1020                                       PCHAN     308
C                                                                       PCHAN     309
C   ENDIF IPBNO.NE.0                                                    PCHAN     310
C                                                                       PCHAN     311
      ENDIF                                                             PCHAN     312
      IPOS=IPOS+3                                                       PCHAN     313
      IF(ICOUNT.LT.ICOUNX)GOTO 1010                                     PCHAN     314
      ENDIF                                                             PCHAN     315
C                                                                       PCHAN     316
 1030  CONTINUE                                                         PCHAN     317
C                                                                       PCHAN     318
C   ENDIF NFFOUT.NE.0                                                   PCHAN     319
C                                                                       PCHAN     320
      ENDIF                                                             PCHAN     321
C                                                                       PCHAN     322
C                                                                       PCHAN     323
C  FOSSIL FIRED BOILER CONTROL VARIBALES                                PCHAN     324
C                                                                       PCHAN     325
      IF(NFFBCO.NE.0)THEN                                               PCHAN     326
C                                                                       PCHAN     327
C   PRINT FRONT PAGE : TITLE & LIST OF SYMBOLS                          PCHAN     328
C                                                                       PCHAN     329
      DO 1060 K=1,NOPTR                                                 PCHAN     330
      IPOS=KOPTR(K)                                                     PCHAN     331
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     332
      IF(JSEM.EQ.30)THEN                                                PCHAN     333
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     334
      IF(ICOUNX.EQ.0)GOTO 1060                                          PCHAN     335
      IPOS=IPOS+2                                                       PCHAN     336
      ICOUNT=0                                                          PCHAN     337
 1040 ICOUNT=ICOUNT+1                                                   PCHAN     338
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     339
      NLF=0                                                             PCHAN     340
      IF(IPBNO.NE.0)THEN                                                PCHAN     341
      NLF=NOLD(IPBNO)                                                   PCHAN     342
C                                                                       PCHAN     343
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     344
C                                                                       PCHAN     345
      K3=IPBNO*3                                                        PCHAN     346
      JNAME1=INAME(K3-2)                                                PCHAN     347
      JNAME2=INAME(K3-1)                                                PCHAN     348
      JNAME3=INAME(K3)                                                  PCHAN     349
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     350
      IGVN=ICONTA(2,IMAC)                                               PCHAN     351
      ISHIFT=0                                                          PCHAN     352
      IF(IGVN.EQ.43)ISHIFT=36                                           PCHAN     353
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     354
      IF(IMAC.LE.NT)THEN                                                PCHAN     355
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     356
      ELSE                                                              PCHAN     357
      UID='  '                                                          PCHAN     358
      ENDIF                                                             PCHAN     359
      LITEM=NCHAN(JSEM)                                                 PCHAN     360
      MCHANX=MCHAN(JSEM)                                                PCHAN     361
      JITEM=0                                                           PCHAN     362
 1050 JITEM=JITEM+1                                                     PCHAN     363
      ISCHAN=ISCHAN+1                                                   PCHAN     364
      CALL PACK(UID,JITEM+MCHANX+ISHIFT,ITFK)                           PCHAN     365
      ITY(1,ISCHAN)=ITFK                                                PCHAN     366
      ITY(2,ISCHAN)=NLF                                                 PCHAN     367
      ITY(3,ISCHAN)=0                                                   PCHAN     368
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     369
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     370
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     371
      IF(JITEM.LT.LITEM)GOTO 1050                                       PCHAN     372
C                                                                       PCHAN     373
C   ENDIF IPBNO.NE.0                                                    PCHAN     374
C                                                                       PCHAN     375
      ENDIF                                                             PCHAN     376
      IPOS=IPOS+3                                                       PCHAN     377
      IF(ICOUNT.LT.ICOUNX)GOTO 1040                                     PCHAN     378
      ENDIF                                                             PCHAN     379
C                                                                       PCHAN     380
 1060 CONTINUE                                                          PCHAN     381
C                                                                       PCHAN     382
C   ENDIF NFFCBO .NE.0                                                  PCHAN     383
C                                                                       PCHAN     384
      ENDIF                                                             PCHAN     385
C                                                                       PCHAN     386
C  NUCLEAR PWR MODEL VARIABLES                                          PCHAN     387
C                                                                       PCHAN     388
      IF(NPWRO.NE.0)THEN                                                PCHAN     389
C                                                                       PCHAN     390
C   PRINT FRONT PAGE : TITLE & LIST OF SYMBOLS                          PCHAN     391
C                                                                       PCHAN     392
      DO 1090 K=1,NOPTR                                                 PCHAN     393
      IPOS=KOPTR(K)                                                     PCHAN     394
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     395
      IF(JSEM.EQ.31 .OR. JSEM.EQ.32)THEN                                PCHAN     396
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     397
      IF(ICOUNX.EQ.0)GOTO 1090                                          PCHAN     398
      IPOS=IPOS+2                                                       PCHAN     399
      ICOUNT=0                                                          PCHAN     400
 1070 ICOUNT=ICOUNT+1                                                   PCHAN     401
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     402
      NLF=0                                                             PCHAN     403
      IF(IPBNO.NE.0)THEN                                                PCHAN     404
      NLF=NOLD(IPBNO)                                                   PCHAN     405
C                                                                       PCHAN     406
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     407
C                                                                       PCHAN     408
      K3=IPBNO*3                                                        PCHAN     409
      JNAME1=INAME(K3-2)                                                PCHAN     410
      JNAME2=INAME(K3-1)                                                PCHAN     411
      JNAME3=INAME(K3)                                                  PCHAN     412
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     413
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     414
      IF(IMAC.LE.NT)THEN                                                PCHAN     415
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     416
      ELSE                                                              PCHAN     417
      UID='  '                                                          PCHAN     418
      ENDIF                                                             PCHAN     419
      LITEM=NCHAN(JSEM)                                                 PCHAN     420
      MCHANX=MCHAN(JSEM)                                                PCHAN     421
      JITEM=0                                                           PCHAN     422
 1080 JITEM=JITEM+1                                                     PCHAN     423
      ISCHAN=ISCHAN+1                                                   PCHAN     424
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     425
      ITY(1,ISCHAN)=ITFK                                                PCHAN     426
      ITY(2,ISCHAN)=NLF                                                 PCHAN     427
      ITY(3,ISCHAN)=0                                                   PCHAN     428
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     429
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     430
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     431
      IF(JITEM.LT.LITEM)GOTO 1080                                       PCHAN     432
C                                                                       PCHAN     433
C   ENDIF IPBNO.NE.0                                                    PCHAN     434
C                                                                       PCHAN     435
      ENDIF                                                             PCHAN     436
      IPOS=IPOS+3                                                       PCHAN     437
      IF(ICOUNT.LT.ICOUNX)GOTO 1070                                     PCHAN     438
      ENDIF                                                             PCHAN     439
C                                                                       PCHAN     440
 1090  CONTINUE                                                         PCHAN     441
C                                                                       PCHAN     442
C   ENDIF NPWRO.NE.0                                                    PCHAN     443
C                                                                       PCHAN     444
      ENDIF                                                             PCHAN     445
C                                                                       PCHAN     446
C                                                                       PCHAN     447
C  CANDU NUCLEAR MODEL OUTPUT VARIABLES                                 PCHAN     448
C                                                                       PCHAN     449
      IF(NCANO.NE.0)THEN                                                PCHAN     450
C                                                                       PCHAN     451
C   PRINT FRONT PAGE : TITLE & LIST OF SYMBOLS                          PCHAN     452
C                                                                       PCHAN     453
      DO 1120 K=1,NOPTR                                                 PCHAN     454
      IPOS=KOPTR(K)                                                     PCHAN     455
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     456
      IF(JSEM.EQ.33 .OR. JSEM.EQ.34)THEN                                PCHAN     457
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     458
      IF(ICOUNX.EQ.0)GOTO 1120                                          PCHAN     459
      IPOS=IPOS+2                                                       PCHAN     460
      ICOUNT=0                                                          PCHAN     461
 1100 ICOUNT=ICOUNT+1                                                   PCHAN     462
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     463
      NLF=0                                                             PCHAN     464
      IF(IPBNO.NE.0)THEN                                                PCHAN     465
      NLF=NOLD(IPBNO)                                                   PCHAN     466
C                                                                       PCHAN     467
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     468
C                                                                       PCHAN     469
      K3=IPBNO*3                                                        PCHAN     470
      JNAME1=INAME(K3-2)                                                PCHAN     471
      JNAME2=INAME(K3-1)                                                PCHAN     472
      JNAME3=INAME(K3)                                                  PCHAN     473
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     474
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     475
      IF(IMAC.LE.NT)THEN                                                PCHAN     476
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     477
      ELSE                                                              PCHAN     478
      UID='  '                                                          PCHAN     479
      ENDIF                                                             PCHAN     480
      LITEM=NCHAN(JSEM)                                                 PCHAN     481
      MCHANX=MCHAN(JSEM)                                                PCHAN     482
      JITEM=0                                                           PCHAN     483
 1110 JITEM=JITEM+1                                                     PCHAN     484
      ISCHAN=ISCHAN+1                                                   PCHAN     485
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     486
      ITY(1,ISCHAN)=ITFK                                                PCHAN     487
      ITY(2,ISCHAN)=NLF                                                 PCHAN     488
      ITY(3,ISCHAN)=0                                                   PCHAN     489
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     490
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     491
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     492
      IF(JITEM.LT.LITEM)GOTO 1110                                       PCHAN     493
C                                                                       PCHAN     494
C   ENDIF IPBNO.NE.0                                                    PCHAN     495
C                                                                       PCHAN     496
      ENDIF                                                             PCHAN     497
      IPOS=IPOS+3                                                       PCHAN     498
      IF(ICOUNT.LT.ICOUNX)GOTO 1100                                     PCHAN     499
      ENDIF                                                             PCHAN     500
C                                                                       PCHAN     501
 1120  CONTINUE                                                         PCHAN     502
C                                                                       PCHAN     503
C   ENDIF NCANO.NE.0                                                    PCHAN     504
C                                                                       PCHAN     505
      ENDIF                                                             PCHAN     506
C                                                                       PCHAN     507
C     NUCLEAR BWR MODEL OUTPUT VARIABLES                                PCHAN     508
C                                                                       PCHAN     509
      IF(NBWROT.NE.0)THEN                                               PCHAN     510
C                                                                       PCHAN     511
C   PRINT FRONT PAGE : TITLE & LIST OF SYMBOLS                          PCHAN     512
C                                                                       PCHAN     513
      DO 1150 K=1,NOPTR                                                 PCHAN     514
      IPOS=KOPTR(K)                                                     PCHAN     515
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     516
      IF(JSEM.EQ.35)THEN                                                PCHAN     517
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     518
      IF(ICOUNX.EQ.0)GOTO 1150                                          PCHAN     519
      IPOS=IPOS+2                                                       PCHAN     520
      ICOUNT=0                                                          PCHAN     521
 1130 ICOUNT=ICOUNT+1                                                   PCHAN     522
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     523
      NLF=0                                                             PCHAN     524
      IF(IPBNO.NE.0)THEN                                                PCHAN     525
      NLF=NOLD(IPBNO)                                                   PCHAN     526
C                                                                       PCHAN     527
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     528
C                                                                       PCHAN     529
      K3=IPBNO*3                                                        PCHAN     530
      JNAME1=INAME(K3-2)                                                PCHAN     531
      JNAME2=INAME(K3-1)                                                PCHAN     532
      JNAME3=INAME(K3)                                                  PCHAN     533
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     534
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     535
      IF(IMAC.LE.NT)THEN                                                PCHAN     536
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN     537
      ELSE                                                              PCHAN     538
      UID='  '                                                          PCHAN     539
      ENDIF                                                             PCHAN     540
      LITEM=NCHAN(JSEM)                                                 PCHAN     541
      MCHANX=MCHAN(JSEM)                                                PCHAN     542
      JITEM=0                                                           PCHAN     543
 1140 JITEM=JITEM+1                                                     PCHAN     544
      ISCHAN=ISCHAN+1                                                   PCHAN     545
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     546
      ITY(1,ISCHAN)=ITFK                                                PCHAN     547
      ITY(2,ISCHAN)=NLF                                                 PCHAN     548
      ITY(3,ISCHAN)=0                                                   PCHAN     549
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     550
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     551
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     552
      IF(JITEM.LT.LITEM)GOTO 1140                                       PCHAN     553
C                                                                       PCHAN     554
C   ENDIF IPBNO.NE.0                                                    PCHAN     555
C                                                                       PCHAN     556
      ENDIF                                                             PCHAN     557
      IPOS=IPOS+3                                                       PCHAN     558
      IF(ICOUNT.LT.ICOUNX)GOTO 1130                                     PCHAN     559
      ENDIF                                                             PCHAN     560
C                                                                       PCHAN     561
 1150  CONTINUE                                                         PCHAN     562
C                                                                       PCHAN     563
C   ENDIF NBWROT.NE.0                                                   PCHAN     564
C                                                                       PCHAN     565
      ENDIF                                                             PCHAN     566
C                                                                       PCHAN     567
C                                                                       PCHAN     568
C                                                                       PCHAN     569
C  GENERATOR & CONTROL STATES                                           PCHAN     570
C                                                                       PCHAN     571
      IF(NGENSO.NE.0)THEN                                               PCHAN     572
C                                                                       PCHAN     573
      KSEM=6                                                            PCHAN     574
      ASSIGN 390 TO I5000                                               PCHAN     575
      GOTO 5000                                                         PCHAN     576
C                                                                       PCHAN     577
C   ENDIF NGENSO.NE.0                                                   PCHAN     578
C                                                                       PCHAN     579
      ENDIF                                                             PCHAN     580
C                                                                       PCHAN     581
C  GENERATOR Y VARIABLES                                                PCHAN     582
C                                                                       PCHAN     583
 390  IF(NGENYO.NE.0)THEN                                               PCHAN     584
C                                                                       PCHAN     585
      KSEM=7                                                            PCHAN     586
      ASSIGN 400 TO I5000                                               PCHAN     587
      GOTO 5000                                                         PCHAN     588
C                                                                       PCHAN     589
C   ENDIF NGENYO.NE.0                                                   PCHAN     590
C                                                                       PCHAN     591
      ENDIF                                                             PCHAN     592
C                                                                       PCHAN     593
C  GENERATOR USER DEFINED EXCITER BLOCK OUTPUTS                         PCHAN     594
C                                                                       PCHAN     595
 400  IF(NUEXCO.NE.0)THEN                                               PCHAN     596
C                                                                       PCHAN     597
      KSEM=18                                                           PCHAN     598
      ASSIGN 410 TO I5000                                               PCHAN     599
      GOTO 5000                                                         PCHAN     600
C                                                                       PCHAN     601
C   ENDIF NUEXCO.NE.0                                                   PCHAN     602
C                                                                       PCHAN     603
      ENDIF                                                             PCHAN     604
C                                                                       PCHAN     605
C  GENERATOR USER DEFINED STABILIZER BLOCK OUTPUTS                      PCHAN     606
C                                                                       PCHAN     607
 410  IF(NUPSSO.NE.0)THEN                                               PCHAN     608
C                                                                       PCHAN     609
      KSEM=19                                                           PCHAN     610
      ASSIGN 420 TO I5000                                               PCHAN     611
      GOTO 5000                                                         PCHAN     612
C                                                                       PCHAN     613
C   ENDIF NUPSSO.NE.0                                                   PCHAN     614
C                                                                       PCHAN     615
      ENDIF                                                             PCHAN     616
C                                                                       PCHAN     617
C  GENERATOR USER DEFINED UNDER/OVER EXCITER BLOCK OUTPUTS              PCHAN     618
C                                                                       PCHAN     619
 420  IF(NUUELO.NE.0)THEN                                               PCHAN     620
C                                                                       PCHAN     621
      KSEM=20                                                           PCHAN     622
      ASSIGN 430 TO I5000                                               PCHAN     623
      GOTO 5000                                                         PCHAN     624
C                                                                       PCHAN     625
C   ENDIF NUUELO.NE.0                                                   PCHAN     626
C                                                                       PCHAN     627
      ENDIF                                                             PCHAN     628
C                                                                       PCHAN     629
C  GENERATOR USER DEFINED GOVERNOR BLOCK OUTPUTS                        PCHAN     630
C                                                                       PCHAN     631
 430  IF(NUGOVO.NE.0)THEN                                               PCHAN     632
C                                                                       PCHAN     633
      KSEM=21                                                           PCHAN     634
      ASSIGN 440 TO I5000                                               PCHAN     635
      GOTO 5000                                                         PCHAN     636
C                                                                       PCHAN     637
C   ENDIF NUGOVO.NE.0                                                   PCHAN     638
C                                                                       PCHAN     639
      ENDIF                                                             PCHAN     640
C                                                                       PCHAN     641
C  NONLINEAR LOAD BUS                                                   PCHAN     642
C                                                                       PCHAN     643
 440  IF(NLOADO.NE.0)THEN                                               PCHAN     644
C                                                                       PCHAN     645
      MCHANX=MCHAN(13)                                                  PCHAN     646
      DO 480 K=1,NOPTR                                                  PCHAN     647
      IPOS=KOPTR(K)                                                     PCHAN     648
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     649
      IF(JSEM.EQ.13)THEN                                                PCHAN     650
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     651
      IF(ICOUNX .EQ. 0)GOTO 480                                         PCHAN     652
      IPOS=IPOS+2                                                       PCHAN     653
      ICOUNT=0                                                          PCHAN     654
 460  ICOUNT=ICOUNT+1                                                   PCHAN     655
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     656
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     657
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     658
      IF(IPBNO.NE.0)THEN                                                PCHAN     659
      NLF=NOLD(IPBNO)                                                   PCHAN     660
C                                                                       PCHAN     661
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     662
C                                                                       PCHAN     663
      K3=IPBNO*3                                                        PCHAN     664
      JNAME1=INAME(K3-2)                                                PCHAN     665
      JNAME2=INAME(K3-1)                                                PCHAN     666
      JNAME3=INAME(K3)                                                  PCHAN     667
      ENDIF                                                             PCHAN     668
      LITEM=NCHAN(JSEM)                                                 PCHAN     669
      MCHANX=MCHAN(JSEM)                                                PCHAN     670
      JITEM=0                                                           PCHAN     671
 470  JITEM=JITEM+1                                                     PCHAN     672
      ISCHAN=ISCHAN+1                                                   PCHAN     673
      CNT4='  '                                                         PCHAN     674
      CALL PACK(CNT4,JITEM+MCHANX,ITFK)                                 PCHAN     675
      ITY(1,ISCHAN)=ITFK                                                PCHAN     676
      ITY(2,ISCHAN)=NLF                                                 PCHAN     677
      ITY(3,ISCHAN)=0                                                   PCHAN     678
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     679
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     680
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     681
      IF(JITEM.LT.LITEM)GOTO 470                                        PCHAN     682
C                                                                       PCHAN     683
      IF(IPBNO.NE.0)THEN                                                PCHAN     684
C                                                                       PCHAN     685
C   ENDIF IPBNO.GT.IPNODE                                               PCHAN     686
C                                                                       PCHAN     687
      ENDIF                                                             PCHAN     688
      IPOS=IPOS+4                                                       PCHAN     689
      IF(ICOUNT.LT.ICOUNX)GOTO 460                                      PCHAN     690
      ENDIF                                                             PCHAN     691
C                                                                       PCHAN     692
 480  CONTINUE                                                          PCHAN     693
C                                                                       PCHAN     694
C   ENDIF NLOADO.NE.0                                                   PCHAN     695
C                                                                       PCHAN     696
      ENDIF                                                             PCHAN     697
C                                                                       PCHAN     698
C  INDUCTION MOTORS                                                     PCHAN     699
C                                                                       PCHAN     700
      IF(NMOTL.NE.0)THEN                                                PCHAN     701
C                                                                       PCHAN     702
      DO 520 K=1,NOPTR                                                  PCHAN     703
      IPOS=KOPTR(K)                                                     PCHAN     704
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     705
      IF(JSEM.EQ.8.OR.JSEM.EQ.9)THEN                                    PCHAN     706
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     707
      IF(ICOUNX .EQ. 0)GOTO 520                                         PCHAN     708
      IPOS=IPOS+2                                                       PCHAN     709
      ICOUNT=0                                                          PCHAN     710
 500  ICOUNT=ICOUNT+1                                                   PCHAN     711
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     712
      IMAC=KOPDAT(IPOS+2)                                               PCHAN     713
      IF(IMAC.NE.0)THEN                                                 PCHAN     714
      UID(1:2)=NDMC(IMAC)(3:4)                                          PCHAN     715
      ELSE                                                              PCHAN     716
      UID(1:2)='  '                                                     PCHAN     717
      ENDIF                                                             PCHAN     718
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN     719
      IF(IPBNO.NE.0)THEN                                                PCHAN     720
      NLF=NOLD(IPBNO)                                                   PCHAN     721
C                                                                       PCHAN     722
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     723
C                                                                       PCHAN     724
      K3=IPBNO*3                                                        PCHAN     725
      JNAME1=INAME(K3-2)                                                PCHAN     726
      JNAME2=INAME(K3-1)                                                PCHAN     727
      JNAME3=INAME(K3)                                                  PCHAN     728
      ENDIF                                                             PCHAN     729
      LITEM=NCHAN(JSEM)                                                 PCHAN     730
      MCHANX=MCHAN(JSEM)                                                PCHAN     731
      JITEM=0                                                           PCHAN     732
 510  JITEM=JITEM+1                                                     PCHAN     733
      ISCHAN=ISCHAN+1                                                   PCHAN     734
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     735
      ITY(1,ISCHAN)=ITFK                                                PCHAN     736
      ITY(2,ISCHAN)=NLF                                                 PCHAN     737
      ITY(3,ISCHAN)=0                                                   PCHAN     738
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     739
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     740
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     741
      IF(JITEM.LT.LITEM)GOTO 510                                        PCHAN     742
C                                                                       PCHAN     743
      IPOS=IPOS+3                                                       PCHAN     744
      IF(ICOUNT.LT.ICOUNX)GOTO 500                                      PCHAN     745
      ENDIF                                                             PCHAN     746
C                                                                       PCHAN     747
 520  CONTINUE                                                          PCHAN     748
C                                                                       PCHAN     749
C   ENDIF NMOTL.NE.0                                                    PCHAN     750
C                                                                       PCHAN     751
      ENDIF                                                             PCHAN     752
C                                                                       PCHAN     753
C  SVC AND REACTORS                                                     PCHAN     754
C                                                                       PCHAN     755
      IF(NSVCO.NE.0)THEN                                                PCHAN     756
C                                                                       PCHAN     757
      DO 620 K=1,NOPTR                                                  PCHAN     758
      IPOS=KOPTR(K)                                                     PCHAN     759
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     760
      IF(JSEM.EQ.10)THEN                                                PCHAN     761
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     762
      IF(ICOUNX .EQ. 0)GOTO 620                                         PCHAN     763
      IPOS=IPOS+2                                                       PCHAN     764
      ICOUNT=0                                                          PCHAN     765
 600  ICOUNT=ICOUNT+1                                                   PCHAN     766
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     767
      IMAC=KOPDAT(IPOS+3)                                               PCHAN     768
      ITFK=KOPDAT(IPOS+2)                                               PCHAN     769
      CALL UNPACK(UID,JJJ,ITFK)                                         PCHAN     770
      ISCHAN=KOPDAT(IPOS+4)                                             PCHAN     771
      IF(IPBNO.NE.0)THEN                                                PCHAN     772
      NLF=NOLD(IPBNO)                                                   PCHAN     773
C                                                                       PCHAN     774
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     775
C                                                                       PCHAN     776
      K3=IPBNO*3                                                        PCHAN     777
      JNAME1=INAME(K3-2)                                                PCHAN     778
      JNAME2=INAME(K3-1)                                                PCHAN     779
      JNAME3=INAME(K3)                                                  PCHAN     780
      ENDIF                                                             PCHAN     781
      LITEM=NCHAN(JSEM)                                                 PCHAN     782
      MCHANX=MCHAN(JSEM)                                                PCHAN     783
      CALL PACK(UID,MCHANX+1,ITFK)                                      PCHAN     784
      ITY(1,ISCHAN)=ITFK                                                PCHAN     785
      ITY(2,ISCHAN+1)=NLF                                               PCHAN     786
      ITY(3,ISCHAN+1)=0                                                 PCHAN     787
      JNAME(1,ISCHAN+1)=JNAME1                                          PCHAN     788
      JNAME(2,ISCHAN+1)=JNAME2                                          PCHAN     789
      JNAME(3,ISCHAN+1)=JNAME3                                          PCHAN     790
      CALL PACK(CNT4,MCHANX+2,ITFK)                                     PCHAN     791
      ITY(1,ISCHAN+2)=ITFK                                              PCHAN     792
      ITY(2,ISCHAN+2)=NLF                                               PCHAN     793
      ITY(3,ISCHAN+2)=0                                                 PCHAN     794
      JNAME(1,ISCHAN+2)=JNAME1                                          PCHAN     795
      JNAME(2,ISCHAN+2)=JNAME2                                          PCHAN     796
      JNAME(3,ISCHAN+2)=JNAME3                                          PCHAN     797
      CALL PACK(CNT4,MCHANX+3,ITFK)                                     PCHAN     798
      ITY(1,ISCHAN+3)=ITFK                                              PCHAN     799
      ITY(2,ISCHAN+3)=NLF                                               PCHAN     800
      ITY(3,ISCHAN+3)=0                                                 PCHAN     801
      JNAME(1,ISCHAN+3)=JNAME1                                          PCHAN     802
      JNAME(2,ISCHAN+3)=JNAME2                                          PCHAN     803
      JNAME(3,ISCHAN+3)=JNAME3                                          PCHAN     804
C                                                                       PCHAN     805
      IPOS=IPOS+4                                                       PCHAN     806
      IF(ICOUNT.LT.ICOUNX)GOTO 600                                      PCHAN     807
      ENDIF                                                             PCHAN     808
C                                                                       PCHAN     809
 620  CONTINUE                                                          PCHAN     810
C                                                                       PCHAN     811
C   ENDIF NSVCO.NE.0                                                    PCHAN     812
C                                                                       PCHAN     813
      ENDIF                                                             PCHAN     814
C                                                                       PCHAN     815
C   USER DEFINED SVC BLOCK OUTPUTS                                      PCHAN     816
C                                                                       PCHAN     817
      IF(NUSVCO.NE.0)THEN                                               PCHAN     818
C                                                                       PCHAN     819
      KSEM=22                                                           PCHAN     820
      ASSIGN 630 TO I5200                                               PCHAN     821
      GOTO 5200                                                         PCHAN     822
C                                                                       PCHAN     823
C   ENDIF NUSVCO.NE.0                                                   PCHAN     824
C                                                                       PCHAN     825
      ENDIF                                                             PCHAN     826
C                                                                       PCHAN     827
C   USER DEFINED SDB BLOCK OUTPUTS                                      PCHAN     828
C                                                                       PCHAN     829
 630  IF(NUSDBO.NE.0)THEN                                               PCHAN     830
C                                                                       PCHAN     831
      KSEM=26                                                           PCHAN     832
      ASSIGN 650 TO I5240                                               PCHAN     833
      GOTO 5240                                                         PCHAN     834
C                                                                       PCHAN     835
C   ENDIF NUSDBO.NE.0                                                   PCHAN     836
C                                                                       PCHAN     837
      ENDIF                                                             PCHAN     838
C                                                                       PCHAN     839
 650  CONTINUE                                                          PCHAN     840
C                                                                       PCHAN     841
C  MONITORED BUS                                                        PCHAN     842
C                                                                       PCHAN     843
      IF(NVBS.NE.0)THEN                                                 PCHAN     844
C                                                                       PCHAN     845
C                                                                       PCHAN     846
      DO 720 K=1,NOPTR                                                  PCHAN     847
      IPOS=KOPTR(K)                                                     PCHAN     848
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     849
      IF(JSEM.EQ.16)THEN                                                PCHAN     850
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     851
      IF(ICOUNX .EQ. 0)GOTO 720                                         PCHAN     852
      IPOS=IPOS+2                                                       PCHAN     853
      ICOUNT=0                                                          PCHAN     854
 700  ICOUNT=ICOUNT+1                                                   PCHAN     855
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN     856
      ISCHAN=KOPDAT(IPOS+2)                                             PCHAN     857
      IF(IPBNO.NE.0)THEN                                                PCHAN     858
      NLF=NOLD(IPBNO)                                                   PCHAN     859
C                                                                       PCHAN     860
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     861
C                                                                       PCHAN     862
      K3=IPBNO*3                                                        PCHAN     863
      JNAME1=INAME(K3-2)                                                PCHAN     864
      JNAME2=INAME(K3-1)                                                PCHAN     865
      JNAME3=INAME(K3)                                                  PCHAN     866
      ELSE                                                              PCHAN     867
      NLF=0                                                             PCHAN     868
      ENDIF                                                             PCHAN     869
      IF(LDEB)WRITE(IUD6,6140) NLF,ISCHAN,IPOS+2                        PCHAN     870
      LITEM=NCHAN(JSEM)                                                 PCHAN     871
      MCHANX=MCHAN(JSEM)                                                PCHAN     872
      CNT4(1:2)='  '                                                    PCHAN     873
      CALL PACK(CNT4,MCHANX+1,ITFK)                                     PCHAN     874
      ITY(1,ISCHAN+1)=ITFK                                              PCHAN     875
      ITY(2,ISCHAN+1)=NLF                                               PCHAN     876
      ITY(3,ISCHAN+1)=0                                                 PCHAN     877
      JNAME(1,ISCHAN+1)=JNAME1                                          PCHAN     878
      JNAME(2,ISCHAN+1)=JNAME2                                          PCHAN     879
      JNAME(3,ISCHAN+1)=JNAME3                                          PCHAN     880
      CALL PACK(CNT4,MCHANX+2,ITFK)                                     PCHAN     881
      ITY(1,ISCHAN+2)=ITFK                                              PCHAN     882
      ITY(2,ISCHAN+2)=NLF                                               PCHAN     883
      ITY(3,ISCHAN+2)=0                                                 PCHAN     884
      JNAME(1,ISCHAN+2)=JNAME1                                          PCHAN     885
      JNAME(2,ISCHAN+2)=JNAME2                                          PCHAN     886
      JNAME(3,ISCHAN+2)=JNAME3                                          PCHAN     887
      IPOS=IPOS+2                                                       PCHAN     888
      IF(ICOUNT.LT.ICOUNX)GOTO 700                                      PCHAN     889
      ENDIF                                                             PCHAN     890
 720  CONTINUE                                                          PCHAN     891
C                                                                       PCHAN     892
C   ENDIF NVBS.NE.0                                                     PCHAN     893
C                                                                       PCHAN     894
      ENDIF                                                             PCHAN     895
C                                                                       PCHAN     896
C  URAN BLOCK OUTPUTS                                                   PCHAN     897
C                                                                       PCHAN     898
      IF(NURANO.NE.0)THEN                                               PCHAN     899
      KSEM=23                                                           PCHAN     900
      ASSIGN 780 TO I5100                                               PCHAN     901
      GOTO 5100                                                         PCHAN     902
C                                                                       PCHAN     903
C   ENDIF NURANO.NE.0                                                   PCHAN     904
C                                                                       PCHAN     905
      ENDIF                                                             PCHAN     906
C                                                                       PCHAN     907
C  USTC BLOCK OUTPUTS                                                   PCHAN     908
C                                                                       PCHAN     909
 780  IF(NUSTCO.NE.0)THEN                                               PCHAN     910
      KSEM=24                                                           PCHAN     911
      ASSIGN 790 TO I5100                                               PCHAN     912
      GOTO 5100                                                         PCHAN     913
C                                                                       PCHAN     914
C   ENDIF NUSTCO.NE.0                                                   PCHAN     915
C                                                                       PCHAN     916
      ENDIF                                                             PCHAN     917
C                                                                       PCHAN     918
C  USPS BLOCK OUTPUTS                                                   PCHAN     919
C                                                                       PCHAN     920
 790  IF(NUSPSO.NE.0)THEN                                               PCHAN     921
      KSEM=25                                                           PCHAN     922
      ASSIGN 800 TO I5100                                               PCHAN     923
      GOTO 5100                                                         PCHAN     924
C                                                                       PCHAN     925
C   ENDIF NUSPSO.NE.0                                                   PCHAN     926
C                                                                       PCHAN     927
      ENDIF                                                             PCHAN     928
C                                                                       PCHAN     929
C  MONITORED LINES                                                      PCHAN     930
C                                                                       PCHAN     931
  800 IF(NLINEO.NE.0)THEN                                               PCHAN     932
C                                                                       PCHAN     933
      DO 830 K=1,NOPTR                                                  PCHAN     934
      IPOS=KOPTR(K)                                                     PCHAN     935
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     936
      IF(JSEM.EQ.14)THEN                                                PCHAN     937
      LITEM=NCHAN(JSEM)                                                 PCHAN     938
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     939
      IF(ICOUNX .EQ. 0)GOTO 830                                         PCHAN     940
      IPOS=IPOS+2                                                       PCHAN     941
      ICOUNT=0                                                          PCHAN     942
 810  ICOUNT=ICOUNT+1                                                   PCHAN     943
      ILINE=KOPDAT(IPOS+1)                                              PCHAN     944
      ISCHAN=KOPDAT(IPOS+2)                                             PCHAN     945
      IF(LDEB)WRITE(IUD6,6150) ILINE,ISCHAN,IPOS+2                      PCHAN     946
      ILIN12=ILINE*12                                                   PCHAN     947
      INT4=MLFTB(ILIN12-10)                                             PCHAN     948
      CALL UPACKI(IPBNOF,IPBNOT,INT4)                                   PCHAN     949
      NLFF=NOLD(IPBNOF)                                                 PCHAN     950
      NLFT=NOLD(IPBNOT)                                                 PCHAN     951
C                                                                       PCHAN     952
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN     953
C                                                                       PCHAN     954
      K3=IPBNOF*3                                                       PCHAN     955
      JNAME1=INAME(K3-2)                                                PCHAN     956
      JNAME2=INAME(K3-1)                                                PCHAN     957
      JNAME3=INAME(K3)                                                  PCHAN     958
      J3=IPBNOT*3                                                       PCHAN     959
      JNAME4=INAME(J3-2)                                                PCHAN     960
      JNAME5=INAME(J3-1)                                                PCHAN     961
      JNAME6=INAME(J3)                                                  PCHAN     962
      IUID=MACKT(ILIN12-9)                                              PCHAN     963
      CALL UNPACK(UID,JJJ,IUID)                                         PCHAN     964
      MCHANX=MCHAN(JSEM)                                                PCHAN     965
      JITEM=0                                                           PCHAN     966
 820  JITEM=JITEM+1                                                     PCHAN     967
      ISCHAN=ISCHAN+1                                                   PCHAN     968
      CALL PACK(UID,JITEM+MCHANX,ITFK)                                  PCHAN     969
      ITY(1,ISCHAN)=ITFK                                                PCHAN     970
      ITY(2,ISCHAN)=NLFF                                                PCHAN     971
      ITY(3,ISCHAN)=NLFT                                                PCHAN     972
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN     973
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN     974
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN     975
      JNAME(4,ISCHAN)=JNAME4                                            PCHAN     976
      JNAME(5,ISCHAN)=JNAME5                                            PCHAN     977
      JNAME(6,ISCHAN)=JNAME6                                            PCHAN     978
      IF(JITEM.LT.LITEM)GOTO 820                                        PCHAN     979
      IPOS=IPOS+2                                                       PCHAN     980
      IF(ICOUNT.LT.ICOUNX)GOTO 810                                      PCHAN     981
      ENDIF                                                             PCHAN     982
 830  CONTINUE                                                          PCHAN     983
C                                                                       PCHAN     984
C   ENDIF NLINEO.NE.0                                                   PCHAN     985
C                                                                       PCHAN     986
      ENDIF                                                             PCHAN     987
C                                                                       PCHAN     988
C  MONITORED INTERFACES                                                 PCHAN     989
C                                                                       PCHAN     990
      IF(NINTEO.NE.0)THEN                                               PCHAN     991
C                                                                       PCHAN     992
      DO 880 K=1,NOPTR                                                  PCHAN     993
      IPOS=KOPTR(K)                                                     PCHAN     994
      JSEM=KOPDAT(IPOS+1)                                               PCHAN     995
      IF(JSEM.EQ.15)THEN                                                PCHAN     996
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN     997
      IF(ICOUNX .EQ. 0)GOTO 880                                         PCHAN     998
      IF(LDEB)WRITE(IUD6,6450) JSEM,IPOS,ICOUNX                         PCHAN     999
      IPOS=IPOS+2                                                       PCHAN    1000
      ICOUNT=0                                                          PCHAN    1001
 850  ICOUNT=ICOUNT+1                                                   PCHAN    1002
      ISCHAN=KOPDAT(IPOS+1)                                             PCHAN    1003
      JITERF=KOPDAT(IPOS+2)                                             PCHAN    1004
      JCOUNX=KOPDAT(IPOS+3)                                             PCHAN    1005
      IF(LDEB)WRITE(IUD6,6440) ISCHAN,JITERF,JCOUNX,LITEM,IPOS          PCHAN    1006
      IPOS=IPOS+3                                                       PCHAN    1007
      JCOUNT=0                                                          PCHAN    1008
 860  JCOUNT=JCOUNT+1                                                   PCHAN    1009
      ILINE=KOPDAT(IPOS+1)                                              PCHAN    1010
      IF(LDEB)WRITE(IUD6,6460) JCOUNT,ILINE                             PCHAN    1011
      ILIN12=ILINE*12                                                   PCHAN    1012
      INT4=MLFTB(ILIN12-10)                                             PCHAN    1013
      CALL UPACKI(IPBNOF,IPBNOT,INT4)                                   PCHAN    1014
      NLFF=NOLD(IPBNOF)                                                 PCHAN    1015
      NLFT=NOLD(IPBNOT)                                                 PCHAN    1016
C                                                                       PCHAN    1017
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN    1018
C                                                                       PCHAN    1019
      K3=IPBNOF*3                                                       PCHAN    1020
      JNAME1=INAME(K3-2)                                                PCHAN    1021
      JNAME2=INAME(K3-1)                                                PCHAN    1022
      JNAME3=INAME(K3)                                                  PCHAN    1023
      J3=IPBNOT*3                                                       PCHAN    1024
      JNAME4=INAME(J3-2)                                                PCHAN    1025
      JNAME5=INAME(J3-1)                                                PCHAN    1026
      JNAME6=INAME(J3)                                                  PCHAN    1027
      IUID=MACKT(ILIN12-9)                                              PCHAN    1028
      CALL UNPACK(UID,JJJ,IUID)                                         PCHAN    1029
      IPOS=IPOS+1                                                       PCHAN    1030
      IF(JCOUNT.LT.JCOUNX)GOTO 860                                      PCHAN    1031
      LITEM=NCHAN(JSEM)                                                 PCHAN    1032
      MCHANX=MCHAN(JSEM)                                                PCHAN    1033
      ISCHAN=ISCHAN+1                                                   PCHAN    1034
      CALL PACK(UID,MCHANX+1,ITFK)                                      PCHAN    1035
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1036
      ITY(2,ISCHAN)=NLFT                                                PCHAN    1037
      JNAME(1,ISCHAN)=LNTERF(1,JITERF)                                  PCHAN    1038
      JNAME(2,ISCHAN)=LNTERF(2,JITERF)                                  PCHAN    1039
      JNAME(3,ISCHAN)=LNTERF(3,JITERF)                                  PCHAN    1040
      JNAME(4,ISCHAN)=LNTERF(4,JITERF)                                  PCHAN    1041
      JNAME(5,ISCHAN)=LNTERF(5,JITERF)                                  PCHAN    1042
      JNAME(6,ISCHAN)=LNTERF(6,JITERF)                                  PCHAN    1043
      ISCHAN=ISCHAN+1                                                   PCHAN    1044
      CALL PACK(UID,MCHANX+2,ITFK)                                      PCHAN    1045
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1046
      ITY(2,ISCHAN)=NLFF                                                PCHAN    1047
      ITY(3,ISCHAN)=NLFT                                                PCHAN    1048
      JNAME(1,ISCHAN)=LNTERF(1,JITERF)                                  PCHAN    1049
      JNAME(2,ISCHAN)=LNTERF(2,JITERF)                                  PCHAN    1050
      JNAME(3,ISCHAN)=LNTERF(3,JITERF)                                  PCHAN    1051
      JNAME(4,ISCHAN)=LNTERF(4,JITERF)                                  PCHAN    1052
      JNAME(5,ISCHAN)=LNTERF(5,JITERF)                                  PCHAN    1053
      JNAME(6,ISCHAN)=LNTERF(6,JITERF)                                  PCHAN    1054
      IF(ICOUNT.LT.ICOUNX)GOTO 850                                      PCHAN    1055
      ENDIF                                                             PCHAN    1056
 880  CONTINUE                                                          PCHAN    1057
C                                                                       PCHAN    1058
C   ENDIF NINTEO.NE.0                                                   PCHAN    1059
C                                                                       PCHAN    1060
      ENDIF                                                             PCHAN    1061
C                                                                       PCHAN    1062
C   PREPARE DC ARRAYS                                                   PCHAN    1063
C                                                                       PCHAN    1064
      IF(NCONVO.NE.0)THEN                                               PCHAN    1065
C                                                                       PCHAN    1066
      DO 910 K=1,NOPTR                                                  PCHAN    1067
      IPOS=KOPTR(K)                                                     PCHAN    1068
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1069
      IF(JSEM.EQ.11)THEN                                                PCHAN    1070
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1071
      IF(ICOUNX .EQ. 0)GOTO 910                                         PCHAN    1072
      IF(LDEB)WRITE(IUD6,6450) JSEM,IPOS,ICOUNX                         PCHAN    1073
      IPOS=IPOS+2                                                       PCHAN    1074
      ICOUNT=0                                                          PCHAN    1075
 890  ICOUNT=ICOUNT+1                                                   PCHAN    1076
      JPOSN=KOPDAT(IPOS+1)                                              PCHAN    1077
      ISCHAN=KOPDAT(IPOS+2)                                             PCHAN    1078
      IPOS=IPOS+2                                                       PCHAN    1079
      IF(JPOSN.NE.0)THEN                                                PCHAN    1080
      LDCNAM=DCCNAM(JPOSN)                                              PCHAN    1081
      ELSE                                                              PCHAN    1082
      LDCNAM='                            '                             PCHAN    1083
      ENDIF                                                             PCHAN    1084
      CNAME1=LDCNAM(1:4)                                                PCHAN    1085
      CNAME2=LDCNAM(5:8)                                                PCHAN    1086
      CNAME3=LDCNAM(9:12)                                               PCHAN    1087
      CNAME4=LDCNAM(13:16)                                              PCHAN    1088
      CNAME5=LDCNAM(17:20)                                              PCHAN    1089
      CNAME6=LDCNAM(21:24)                                              PCHAN    1090
      CNAME7=LDCNAM(25:28)                                              PCHAN    1091
      CNAME8=LDCNAM(29:29)                                              PCHAN    1092
      MCHANX=MCHAN(JSEM)                                                PCHAN    1093
      LITEM=NCHAN(JSEM)                                                 PCHAN    1094
      DO 900 JITEM=1,LITEM                                              PCHAN    1095
      IOFF=IOFF+1                                                       PCHAN    1096
      ISCHAN=ISCHAN+1                                                   PCHAN    1097
      CALL PACK(CNT4,JITEM+MCHANX,ITFK)                                 PCHAN    1098
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1099
      ITY(2,ISCHAN)=0                                                   PCHAN    1100
      ITY(3,ISCHAN)=IOFF                                                PCHAN    1101
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1102
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1103
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1104
      JNAME(4,ISCHAN)=JNAME4                                            PCHAN    1105
      JNAME(5,ISCHAN)=JNAME5                                            PCHAN    1106
      JNAME(6,ISCHAN)=JNAME6                                            PCHAN    1107
      JJNAME(1,IOFF)=JNAME7                                             PCHAN    1108
      JJNAME(2,IOFF)=JNAME8                                             PCHAN    1109
 900  CONTINUE                                                          PCHAN    1110
      IF(ICOUNT.LT.ICOUNX)GOTO 890                                      PCHAN    1111
C                                                                       PCHAN    1112
C   ENDIF JSEM.EQ.11                                                    PCHAN    1113
C                                                                       PCHAN    1114
      ENDIF                                                             PCHAN    1115
 910  CONTINUE                                                          PCHAN    1116
C                                                                       PCHAN    1117
C    ENDIF NCONVO.NE.0                                                  PCHAN    1118
C                                                                       PCHAN    1119
      ENDIF                                                             PCHAN    1120
C                                                                       PCHAN    1121
      IF(NUDCO.NE.0)THEN                                                PCHAN    1122
C                                                                       PCHAN    1123
      DO 930 K=1,NOPTR                                                  PCHAN    1124
      IPOS=KOPTR(K)                                                     PCHAN    1125
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1126
      IF(JSEM.EQ.12)THEN                                                PCHAN    1127
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1128
      IF(ICOUNX .EQ. 0)GOTO 930                                         PCHAN    1129
      IF(LDEB)WRITE(IUD6,6450) JSEM,IPOS,ICOUNX                         PCHAN    1130
      IPOS=IPOS+2                                                       PCHAN    1131
      ICOUNT=0                                                          PCHAN    1132
 920  ICOUNT=ICOUNT+1                                                   PCHAN    1133
      NEXT=KOPDAT(IPOS+1)                                               PCHAN    1134
      ISCHAN=KOPDAT(IPOS+2)+1                                           PCHAN    1135
      IPOS=IPOS+2                                                       PCHAN    1136
      MCHANX=MCHAN(12)                                                  PCHAN    1137
      IF(NEXT.NE.0)THEN                                                 PCHAN    1138
      LUDNAM=UDNAME(NEXT)                                               PCHAN    1139
      CNAME1=LUDNAM(1:4)                                                PCHAN    1140
      CNAME2=LUDNAM(5:8)                                                PCHAN    1141
      CNAME3=LUDNAM(9:12)                                               PCHAN    1142
      CNAME4=LUDNAM(13:16)                                              PCHAN    1143
      CNAME5=LUDNAM(17:17)                                              PCHAN    1144
      ELSE                                                              PCHAN    1145
      LUDNAM='                 '                                        PCHAN    1146
      ENDIF                                                             PCHAN    1147
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1148
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1149
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1150
      JNAME(4,ISCHAN)=JNAME4                                            PCHAN    1151
      JNAME(5,ISCHAN)=JNAME5                                            PCHAN    1152
      CALL PACK(CNT4,MCHANX,ITFK)                                       PCHAN    1153
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1154
      ITY(2,ISCHAN)=0                                                   PCHAN    1155
      ITY(3,ISCHAN)=0                                                   PCHAN    1156
      IF(ICOUNT.LT.ICOUNX)GOTO 920                                      PCHAN    1157
C                                                                       PCHAN    1158
C   ENDIF JSEM.EQ.12                                                    PCHAN    1159
C                                                                       PCHAN    1160
      ENDIF                                                             PCHAN    1161
C                                                                       PCHAN    1162
 930  CONTINUE                                                          PCHAN    1163
C                                                                       PCHAN    1164
C   ENDIF NUDCO.NE.0                                                    PCHAN    1165
C                                                                       PCHAN    1166
      ENDIF                                                             PCHAN    1167
C                                                                       PCHAN    1168
      IF(NDVOLO.NE.0)THEN                                               PCHAN    1169
C                                                                       PCHAN    1170
      DO 950 K=1,NOPTR                                                  PCHAN    1171
      IPOS=KOPTR(K)                                                     PCHAN    1172
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1173
      IF(JSEM.EQ.17)THEN                                                PCHAN    1174
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1175
      IF(ICOUNX .EQ. 0)GOTO 950                                         PCHAN    1176
      IF(LDEB)WRITE(IUD6,6450) JSEM,IPOS,ICOUNX                         PCHAN    1177
      IPOS=IPOS+2                                                       PCHAN    1178
      ICOUNT=0                                                          PCHAN    1179
      JL=0                                                              PCHAN    1180
 940  ICOUNT=ICOUNT+1                                                   PCHAN    1181
      NEXT=KOPDAT(IPOS+1)                                               PCHAN    1182
      ISCHAN=KOPDAT(IPOS+2)+1                                           PCHAN    1183
      IPOS=IPOS+2                                                       PCHAN    1184
      MCHANX=MCHAN(17)                                                  PCHAN    1185
      IF(NEXT.NE.0)THEN                                                 PCHAN    1186
      DCNAME=IDCNOD(NEXT)                                               PCHAN    1187
      CNAME1=DCNAME(1:4)                                                PCHAN    1188
      CNAME2=DCNAME(5:8)                                                PCHAN    1189
      ELSE                                                              PCHAN    1190
      DCNAME='        '                                                 PCHAN    1191
      ENDIF                                                             PCHAN    1192
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1193
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1194
      CALL PACK(CNT4,MCHANX,ITFK)                                       PCHAN    1195
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1196
      ITY(2,ISCHAN)=0                                                   PCHAN    1197
      ITY(3,ISCHAN)=0                                                   PCHAN    1198
      IF(NEXT.NE.0)THEN                                                 PCHAN    1199
      JL=JL+1                                                           PCHAN    1200
      KNAME(JL)=DCNAME                                                  PCHAN    1201
      ENDIF                                                             PCHAN    1202
      IF(ICOUNT.LT.ICOUNX)GOTO 940                                      PCHAN    1203
C                                                                       PCHAN    1204
C   ENDIF JSEM.EQ.17                                                    PCHAN    1205
C                                                                       PCHAN    1206
      ENDIF                                                             PCHAN    1207
C                                                                       PCHAN    1208
 950  CONTINUE                                                          PCHAN    1209
C                                                                       PCHAN    1210
C   ENDIF NDVOLO.NE.0                                                   PCHAN    1211
C                                                                       PCHAN    1212
      ENDIF                                                             PCHAN    1213
C                                                                       PCHAN    1214
C                                                                       PCHAN    1215
C  WRITE DIRECTORY AND DESCRIPTIVE RECORDS TO RESULT FILE               PCHAN    1216
C                                                                       PCHAN    1217
      IREC=(ICHAN+127)/128                                              PCHAN    1218
C                                                                       PCHAN    1219
C   ALLOW 9 HEADING RECORDS                                             PCHAN    1220
C                                                                       PCHAN    1221
      NREC=10                                                           PCHAN    1222
CD                                                                      PCHAN    1223
CD    1. WRITE IITY ARRAYS                                              PCHAN    1224
CD                                                                      PCHAN    1225
      KK=-127                                                           PCHAN    1226
      DO 2000 I=1,IREC*3                                                PCHAN    1227
      KK=KK+128                                                         PCHAN    1228
      CALL DAIWR(IU8,0,NREC,IITY(KK),128)                               PCHAN    1229
 2000 CONTINUE                                                          PCHAN    1230
CD                                                                      PCHAN    1231
CD    2. WRITE JNAME ARRAYS                                             PCHAN    1232
CD                                                                      PCHAN    1233
      DO 2040 L=1,6                                                     PCHAN    1234
      KK=-128                                                           PCHAN    1235
      DO 2030 I=1,IREC                                                  PCHAN    1236
      KK=KK+128                                                         PCHAN    1237
      DO 2020 K=1,128                                                   PCHAN    1238
      IREC9(K)=JNAME(L,KK+K)                                            PCHAN    1239
 2020 CONTINUE                                                          PCHAN    1240
      CALL DAIWR(IU8,0,NREC,IREC9,128)                                  PCHAN    1241
 2030 CONTINUE                                                          PCHAN    1242
 2040 CONTINUE                                                          PCHAN    1243
C                                                                       PCHAN    1244
C  RESERVE RECORDS FOR JRSKRS ARRAY                                     PCHAN    1245
C                                                                       PCHAN    1246
      IRREC=(NPFL+127)/128                                              PCHAN    1247
      LRREC=NREC                                                        PCHAN    1248
      NREC=NREC+IRREC                                                   PCHAN    1249
CD                                                                      PCHAN    1250
CD    3. WRITE THE LAST TWO WORDS OF CONVERTER BUS                      PCHAN    1251
CD                                                                      PCHAN    1252
      IF(NCONVO.NE.0)THEN                                               PCHAN    1253
         IRECJ=(IOFF+127)/128                                           PCHAN    1254
         DO 2070 L=1,2                                                  PCHAN    1255
         KK=-128                                                        PCHAN    1256
         DO 2060 I=1,IRECJ                                              PCHAN    1257
         KK=KK+128                                                      PCHAN    1258
         DO 2050 K=1,128                                                PCHAN    1259
         IREC9(K)=JJNAME(L,KK+K)                                        PCHAN    1260
 2050    CONTINUE                                                       PCHAN    1261
         CALL DAIWR(IU8,0,NREC,IREC9,128)                               PCHAN    1262
 2060    CONTINUE                                                       PCHAN    1263
 2070    CONTINUE                                                       PCHAN    1264
      ENDIF                                                             PCHAN    1265
C                                                                       PCHAN    1266
C   CASE ID AND TITLE                                                   PCHAN    1267
C                                                                       PCHAN    1268
      CALL MOVE(0,IREC9,IREC9,128)                                      PCHAN    1269
      IREC9(1)=ICASID(1)                                                PCHAN    1270
      IREC9(2)=ICASID(2)                                                PCHAN    1271
      IREC9(3)=ICASID(3)                                                PCHAN    1272
      KK=3                                                              PCHAN    1273
      DO 2074 I=1,20                                                    PCHAN    1274
        DO 2072 K=1,6                                                   PCHAN    1275
          KK=KK+1                                                       PCHAN    1276
          IREC9(KK)=ITITLE(K,I)                                         PCHAN    1277
2072    CONTINUE                                                        PCHAN    1278
2074  CONTINUE                                                          PCHAN    1279
C                                                                       PCHAN    1280
      JREC=7                                                            PCHAN    1281
      CALL DAIWR(IU8,0,JREC,IREC9,128)                                  PCHAN    1282
C                                                                       PCHAN    1283
C   STUDY DESCRIPTION AND DATE RECORD                                   PCHAN    1284
C                                                                       PCHAN    1285
      CALL MOVE(0,IREC9,IREC9,128)                                      PCHAN    1286
      DO 2080 I=1,20                                                    PCHAN    1287
      IREC9(I)=ITEXT(I)                                                 PCHAN    1288
      IREC9(20+I)=ISWTEX(I)                                             PCHAN    1289
      IREC9(40+I)=JTEXT(I)                                              PCHAN    1290
 2080 CONTINUE                                                          PCHAN    1291
      IREC9(101)=LDATE(1)                                               PCHAN    1292
      IREC9(102)=LDATE(2)                                               PCHAN    1293
      IREC9(103)=LDATE(3)                                               PCHAN    1294
      IREC9(104)=IVERS                                                  PCHAN    1295
      IREC9(105)=NCONVO                                                 PCHAN    1296
      IREC9(106)=IOFF                                                   PCHAN    1297
      IREC9(107)=KLFO                                                   PCHAN    1298
      RREC9(108)=BASPC                                                  PCHAN    1299
      RREC9(109)=FQBASE                                                 PCHAN    1300
CD                                                                      PCHAN    1301
CD    4.  WRITE STUDY DESCRIPTION AND DATE RECORD (RECORD 8) TO RESULT  PCHAN    1302
CD        FILE                                                          PCHAN    1303
CD                                                                      PCHAN    1304
      JREC=8                                                            PCHAN    1305
      CALL DAIWR(IU8,0,JREC,IREC9,128)                                  PCHAN    1306
C                                                                       PCHAN    1307
C                                                                       PCHAN    1308
C   STORE RECORD INFORMATIONS                                           PCHAN    1309
C                                                                       PCHAN    1310
      CALL MOVE(0,IREC9,IREC9,128)                                      PCHAN    1311
      IREC9(1)=ICHAN                                                    PCHAN    1312
      IREC9(2)=IREC                                                     PCHAN    1313
      IREC9(3)=IRECJ                                                    PCHAN    1314
C                                                                       PCHAN    1315
C   STARTING RECORD OF IITY ARRAY                                       PCHAN    1316
C                                                                       PCHAN    1317
      IREC9(4)=10                                                       PCHAN    1318
C                                                                       PCHAN    1319
C   STARTING RECORD OF STATION NAMES                                    PCHAN    1320
C                                                                       PCHAN    1321
      IREC9(6)=IREC9(4)+IREC*3                                          PCHAN    1322
C                                                                       PCHAN    1323
C   STARTING RECORD OF TIME POINTS                                      PCHAN    1324
C                                                                       PCHAN    1325
      IREC9(7)=NREC                                                     PCHAN    1326
C                                                                       PCHAN    1327
C   NUMBER OF MONITERED LINES                                           PCHAN    1328
C                                                                       PCHAN    1329
      IREC9(8)=NPFL                                                     PCHAN    1330
C                                                                       PCHAN    1331
C   STARTING RECORD OF JRSKRS ARRAY                                     PCHAN    1332
C                                                                       PCHAN    1333
      IREC9(9)=LRREC                                                    PCHAN    1334
C                                                                       PCHAN    1335
C   NUMBER OF RECORD JRSKRS ARRAY NEED                                  PCHAN    1336
C                                                                       PCHAN    1337
      IREC9(10)=IRREC                                                   PCHAN    1338
CD                                                                      PCHAN    1339
CD    5. WRITE REC9 TO RESULT FILE                                      PCHAN    1340
CD                                                                      PCHAN    1341
      JREC=9                                                            PCHAN    1342
      CALL DAIWR(IU8,0,JREC,IREC9,128)                                  PCHAN    1343
C                                                                       PCHAN    1344
      RETURN                                                            PCHAN    1345
C                                                                       PCHAN    1346
 5000 CONTINUE                                                          PCHAN    1347
      DO 5030 K=1,NOPTR                                                 PCHAN    1348
      IPOS=KOPTR(K)                                                     PCHAN    1349
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1350
      IF(JSEM.EQ.KSEM)THEN                                              PCHAN    1351
      MCHANX=MCHAN(JSEM)                                                PCHAN    1352
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1353
      IF(ICOUNX .EQ. 0)GOTO 5030                                        PCHAN    1354
      IPOS=IPOS+2                                                       PCHAN    1355
      ICOUNT=0                                                          PCHAN    1356
 5010 ICOUNT=ICOUNT+1                                                   PCHAN    1357
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN    1358
      NLF=0                                                             PCHAN    1359
      IF(IPBNO.NE.0)THEN                                                PCHAN    1360
      NLF=NOLD(IPBNO)                                                   PCHAN    1361
C                                                                       PCHAN    1362
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN    1363
C                                                                       PCHAN    1364
      K3=IPBNO*3                                                        PCHAN    1365
      JNAME1=INAME(K3-2)                                                PCHAN    1366
      JNAME2=INAME(K3-1)                                                PCHAN    1367
      JNAME3=INAME(K3)                                                  PCHAN    1368
      IMAC=KOPDAT(IPOS+2)                                               PCHAN    1369
      LITEM=KOPDAT(IPOS+3)                                              PCHAN    1370
      ISCHAN=KOPDAT(IPOS+4)                                             PCHAN    1371
      IF(IMAC.NE.0)THEN                                                 PCHAN    1372
      UID(1:2)=NDGC(IMAC)(3:4)                                          PCHAN    1373
      ELSE                                                              PCHAN    1374
      UID='  '                                                          PCHAN    1375
      ENDIF                                                             PCHAN    1376
      IF(LDEB)WRITE(IUD6,6340) ICOUNT,IPOS,IPBNO,ISCHAN,IMAC            PCHAN    1377
     &,UID,LITEM                                                        PCHAN    1378
      JITEM=0                                                           PCHAN    1379
      LL=0                                                              PCHAN    1380
 5020 JITEM=JITEM+1                                                     PCHAN    1381
      LL=LL+2                                                           PCHAN    1382
      NSTNO=KOPDAT(IPOS+JITEM+4)                                        PCHAN    1383
      ISCHAN=ISCHAN+1                                                   PCHAN    1384
      CALL PACK(UID,MCHANX+NSTNO,ITFK)                                  PCHAN    1385
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1386
      ITY(2,ISCHAN)=NLF                                                 PCHAN    1387
      ITY(3,ISCHAN)=0                                                   PCHAN    1388
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1389
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1390
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1391
      IF(JITEM.LT.LITEM)GOTO 5020                                       PCHAN    1392
C                                                                       PCHAN    1393
C   ENDIF IPBNO.GT.0                                                    PCHAN    1394
C                                                                       PCHAN    1395
      ENDIF                                                             PCHAN    1396
      IPOS=IPOS+4+LITEM                                                 PCHAN    1397
      IF(ICOUNT.LT.ICOUNX)GOTO 5010                                     PCHAN    1398
      ENDIF                                                             PCHAN    1399
C                                                                       PCHAN    1400
 5030 CONTINUE                                                          PCHAN    1401
      GOTO I5000                                                        PCHAN    1402
C                                                                       PCHAN    1403
 5100 CONTINUE                                                          PCHAN    1404
C                                                                       PCHAN    1405
C  URAN USTC AND USPS BLOCK OUTPUTS                                     PCHAN    1406
C                                                                       PCHAN    1407
      MCHANX=MCHAN(KSEM)                                                PCHAN    1408
      DO 5160 K=1,NOPTR                                                 PCHAN    1409
      IPOS=KOPTR(K)                                                     PCHAN    1410
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1411
      IF(JSEM.EQ.KSEM)THEN                                              PCHAN    1412
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1413
      IF(ICOUNX .EQ. 0)GOTO 5160                                        PCHAN    1414
      IPOS=IPOS+2                                                       PCHAN    1415
      ICOUNT=0                                                          PCHAN    1416
 5140 ICOUNT=ICOUNT+1                                                   PCHAN    1417
      IMAC=KOPDAT(IPOS+1)                                               PCHAN    1418
      KITEM=KOPDAT(IPOS+2)                                              PCHAN    1419
      ISCHAN=KOPDAT(IPOS+3)                                             PCHAN    1420
      IPOS=IPOS+3                                                       PCHAN    1421
C                                                                       PCHAN    1422
      IF(IMAC.NE.0)THEN                                                 PCHAN    1423
C                                                                       PCHAN    1424
        IF(KSEM.EQ.23)THEN                                              PCHAN    1425
        JR=JRDAT(IMAC)                                                  PCHAN    1426
        ELSE                                                            PCHAN    1427
        JR=JTPDAT(IMAC)                                                 PCHAN    1428
        ENDIF                                                           PCHAN    1429
       IPBNOF=IDDAT(JR+1)                                               PCHAN    1430
       IPBNOT=IDDAT(JR+2)                                               PCHAN    1431
       IUID=IDDAT(JR+3)                                                 PCHAN    1432
       CALL UNPACK(UID,JJJ,IUID)                                        PCHAN    1433
C                                                                       PCHAN    1434
          IF(IPBNOF.NE.0)THEN                                           PCHAN    1435
          NLFF=NOLD(IPBNOF)                                             PCHAN    1436
          K3=IPBNOF*3                                                   PCHAN    1437
          JNAME1=INAME(K3-2)                                            PCHAN    1438
          JNAME2=INAME(K3-1)                                            PCHAN    1439
          JNAME3=INAME(K3)                                              PCHAN    1440
          ENDIF                                                         PCHAN    1441
C                                                                       PCHAN    1442
          IF(IPBNOT.NE.0)THEN                                           PCHAN    1443
          NLFT=NOLD(IPBNOT)                                             PCHAN    1444
          J3=IPBNOT*3                                                   PCHAN    1445
          JNAME4=INAME(J3-2)                                            PCHAN    1446
          JNAME5=INAME(J3-1)                                            PCHAN    1447
          JNAME6=INAME(J3)                                              PCHAN    1448
          ENDIF                                                         PCHAN    1449
C                                                                       PCHAN    1450
      ENDIF                                                             PCHAN    1451
C                                                                       PCHAN    1452
      JITEM=0                                                           PCHAN    1453
      LL=0                                                              PCHAN    1454
 5150 JITEM=JITEM+1                                                     PCHAN    1455
      ISCHAN=ISCHAN+1                                                   PCHAN    1456
      IPOS=IPOS+1                                                       PCHAN    1457
      NSTNO=KOPDAT(IPOS)                                                PCHAN    1458
      LL=LL+2                                                           PCHAN    1459
      CALL PACK(UID,MCHANX+NSTNO,ITFK)                                  PCHAN    1460
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1461
      ITY(2,ISCHAN)=NLFF                                                PCHAN    1462
      ITY(3,ISCHAN)=NLFT                                                PCHAN    1463
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1464
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1465
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1466
      JNAME(4,ISCHAN)=JNAME4                                            PCHAN    1467
      JNAME(5,ISCHAN)=JNAME5                                            PCHAN    1468
      JNAME(6,ISCHAN)=JNAME6                                            PCHAN    1469
      IF(JITEM.LT.KITEM)GOTO 5150                                       PCHAN    1470
      IF(ICOUNT.LT.ICOUNX)GOTO 5140                                     PCHAN    1471
      ENDIF                                                             PCHAN    1472
 5160  CONTINUE                                                         PCHAN    1473
      GOTO I5100                                                        PCHAN    1474
C                                                                       PCHAN    1475
 5200 CONTINUE                                                          PCHAN    1476
C                                                                       PCHAN    1477
C  USER DEFINED SVC BLOCK OUTPUTS                                       PCHAN    1478
C                                                                       PCHAN    1479
      MCHANX=MCHAN(KSEM)                                                PCHAN    1480
      DO 5230 K=1,NOPTR                                                 PCHAN    1481
      IPOS=KOPTR(K)                                                     PCHAN    1482
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1483
      IF(JSEM.EQ.KSEM)THEN                                              PCHAN    1484
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1485
      IF(ICOUNX .EQ. 0)GOTO 5230                                        PCHAN    1486
      IPOS=IPOS+2                                                       PCHAN    1487
      ICOUNT=0                                                          PCHAN    1488
 5210 ICOUNT=ICOUNT+1                                                   PCHAN    1489
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN    1490
      NLF=0                                                             PCHAN    1491
      IF(IPBNO.NE.0)THEN                                                PCHAN    1492
      NLF=NOLD(IPBNO)                                                   PCHAN    1493
C                                                                       PCHAN    1494
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN    1495
C                                                                       PCHAN    1496
      K3=IPBNO*3                                                        PCHAN    1497
      JNAME1=INAME(K3-2)                                                PCHAN    1498
      JNAME2=INAME(K3-1)                                                PCHAN    1499
      JNAME3=INAME(K3)                                                  PCHAN    1500
      ITFK=KOPDAT(IPOS+2)                                               PCHAN    1501
      CALL UNPACK(UID,LITEM,ITFK)                                       PCHAN    1502
      IMAC=KOPDAT(IPOS+3)                                               PCHAN    1503
      ISCHAN=KOPDAT(IPOS+4)                                             PCHAN    1504
      JITEM=0                                                           PCHAN    1505
      LL=0                                                              PCHAN    1506
 5220 JITEM=JITEM+1                                                     PCHAN    1507
      LL=LL+2                                                           PCHAN    1508
      NSTNO=KOPDAT(IPOS+JITEM+4)                                        PCHAN    1509
      ISCHAN=ISCHAN+1                                                   PCHAN    1510
      CALL PACK(UID,MCHANX+NSTNO,ITFK)                                  PCHAN    1511
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1512
      ITY(2,ISCHAN)=NLF                                                 PCHAN    1513
      ITY(3,ISCHAN)=0                                                   PCHAN    1514
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1515
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1516
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1517
      IF(JITEM.LT.LITEM)GOTO 5220                                       PCHAN    1518
C                                                                       PCHAN    1519
C   ENDIF IPBNO.GT.0                                                    PCHAN    1520
C                                                                       PCHAN    1521
      ENDIF                                                             PCHAN    1522
      IPOS=IPOS+4+LITEM                                                 PCHAN    1523
      IF(ICOUNT.LT.ICOUNX)GOTO 5210                                     PCHAN    1524
      ENDIF                                                             PCHAN    1525
C                                                                       PCHAN    1526
 5230 CONTINUE                                                          PCHAN    1527
C                                                                       PCHAN    1528
      GOTO I5200                                                        PCHAN    1529
C                                                                       PCHAN    1530
C                                                                       PCHAN    1531
 5240 CONTINUE                                                          PCHAN    1532
C                                                                       PCHAN    1533
C  USER DEFINED SDB BLOCK OUTPUTS                                       PCHAN    1534
C                                                                       PCHAN    1535
      MCHANX=MCHAN(KSEM)                                                PCHAN    1536
      DO 5270 K=1,NOPTR                                                 PCHAN    1537
      IPOS=KOPTR(K)                                                     PCHAN    1538
      JSEM=KOPDAT(IPOS+1)                                               PCHAN    1539
      IF(JSEM.EQ.KSEM)THEN                                              PCHAN    1540
      ICOUNX=KOPDAT(IPOS+2)                                             PCHAN    1541
      IF(ICOUNX .EQ. 0)GOTO 5270                                        PCHAN    1542
      IPOS=IPOS+2                                                       PCHAN    1543
      ICOUNT=0                                                          PCHAN    1544
 5250 ICOUNT=ICOUNT+1                                                   PCHAN    1545
      IPBNO=KOPDAT(IPOS+1)                                              PCHAN    1546
      NLF=0                                                             PCHAN    1547
      IF(IPBNO.NE.0)THEN                                                PCHAN    1548
      NLF=NOLD(IPBNO)                                                   PCHAN    1549
C                                                                       PCHAN    1550
C   STORE STATION NAME AND ADDRESS COUNT                                PCHAN    1551
C                                                                       PCHAN    1552
      K3=IPBNO*3                                                        PCHAN    1553
      JNAME1=INAME(K3-2)                                                PCHAN    1554
      JNAME2=INAME(K3-1)                                                PCHAN    1555
      JNAME3=INAME(K3)                                                  PCHAN    1556
      IMAC=KOPDAT(IPOS+2)                                               PCHAN    1557
      LITEM=KOPDAT(IPOS+3)                                              PCHAN    1558
      ISCHAN=KOPDAT(IPOS+4)                                             PCHAN    1559
      JITEM=0                                                           PCHAN    1560
      LL=0                                                              PCHAN    1561
 5260 JITEM=JITEM+1                                                     PCHAN    1562
      LL=LL+2                                                           PCHAN    1563
      NSTNO=KOPDAT(IPOS+JITEM+4)                                        PCHAN    1564
      ISCHAN=ISCHAN+1                                                   PCHAN    1565
      CNT4(1:2)='  '                                                    PCHAN    1566
      CALL PACK(CNT4,MCHANX+NSTNO,ITFK)                                 PCHAN    1567
      ITY(1,ISCHAN)=ITFK                                                PCHAN    1568
      ITY(2,ISCHAN)=NLF                                                 PCHAN    1569
      ITY(3,ISCHAN)=0                                                   PCHAN    1570
      JNAME(1,ISCHAN)=JNAME1                                            PCHAN    1571
      JNAME(2,ISCHAN)=JNAME2                                            PCHAN    1572
      JNAME(3,ISCHAN)=JNAME3                                            PCHAN    1573
      IF(JITEM.LT.LITEM)GOTO 5260                                       PCHAN    1574
C                                                                       PCHAN    1575
C   ENDIF IPBNO.GT.0                                                    PCHAN    1576
C                                                                       PCHAN    1577
      ENDIF                                                             PCHAN    1578
      IPOS=IPOS+4+LITEM                                                 PCHAN    1579
      IF(ICOUNT.LT.ICOUNX)GOTO 5250                                     PCHAN    1580
      ENDIF                                                             PCHAN    1581
C                                                                       PCHAN    1582
 5270 CONTINUE                                                          PCHAN    1583
C                                                                       PCHAN    1584
      GOTO I5240                                                        PCHAN    1585
C                                                                       PCHAN    1586
C                                                                       PCHAN    1587
 6140 FORMAT(1X,'ROUTINE PCHAN NLF=',I4,' ISCHAN=',I4,' IPOS+2=',I4)    PCHAN    1588
 6150 FORMAT(1X,'ROUTINE PCHAN ILINE=',I4,' ISCHAN=',I4,' IPOS+2=',I4)  PCHAN    1589
 6340 FORMAT(1X,'ICOUNT=',I5,' IPOS=',I4,' IPBNO=',I5                   PCHAN    1590
     &,' ISCHAN=',I5,' IMAC=',I4,'  UID=',A2,' LITEM=',I4)              PCHAN    1591
 6440 FORMAT(1X,'SLIN ISCHAN=',I3,' JITERF=',I3,' JCOUNX=',I3           PCHAN    1592
     &,' LITEM=',I3,' IPOS=',I4)                                        PCHAN    1593
 6450 FORMAT(1X,'JSEM=',I3,' IPOS=',I4,' ICOUNX=',I3)                   PCHAN    1594
 6460 FORMAT(1X,'JCOUNT=',I3,' ILINE=',I3)                              PCHAN    1595
 6660 FORMAT(1X,'KOPDAT:',/,(25I5))                                     PCHAN    1596
C                                                                       PCHAN    1597
      END                                                               PCHAN    1598
