      SUBROUTINE ERROR( LUN,MSG,DSW,IOS )                                 00001 
C                                                                         00002 
C                                                                         00003 
      COMMON  / DSWTB / DSWSY                                             00004 
      COMMON  / IOSTB / IOSSY                                             00005 
C                                                                         00006 
      INTEGER DSWSY(1)                                                    00007 
      INTEGER IOSSY(1)                                                    00008 
C                                                                         00009 
      INTEGER LUN                                                         00010 
      BYTE    MSG(1)                                                      00011 
      INTEGER DSW                                                         00012 
      INTEGER IOS                                                         00013 
C                                                                         00014 
C                                                                         00015 
      NMSG=0                                                              00016 
32758 IF(.NOT.( MSG(NMSG+1).NE.0 )) GO TO 32757                           00017 
      NMSG = NMSG+1                                                       00017 
      GO TO 32758                                                         00017 
32757 WRITE( LUN,1000 )  (MSG(I),I=1,NMSG)                                00018 
 1000 FORMAT( /' IWGDETAPE -- ',<NMSG>A1 )                                00019 
C                                                                         00020 
C                                                                         00021 
      IF(.NOT.( DSW.LE.0 )) GO TO 32756                                   00022 
      I0 = 1                                                              00023 
32755 IF(.NOT.( DSWSY(I0).NE.0 .AND. DSWSY(I0).NE.DSW )) GO TO 32754      00024 
      I0 = I0+1                                                           00024 
      GO TO 32755                                                         00024 
32754 I1 = I0+1                                                           00025 
      I2 = I1+1                                                           00026 
32753 IF(.NOT.( DSWSY(I2).NE.0 .AND. DSWSY(I2).GE.0 )) GO TO 32752        00027 
      I1 = I1+1                                                           00028 
      I2 = I1+1                                                           00029 
      GO TO 32753                                                         00030 
32752 IF(.NOT.( DSWSY(I0).NE.0 )) GO TO 32750                             00031 
      WRITE ( LUN,1010 )  (DSWSY(I),I=I0+1,I0+3),(DSWSY(I),I=I0+4,I1)     00032 
 1010 FORMAT( ' **** DSW == ',3A2,' - ',<I1-I0-3>A2 )                     00033 
      GO TO 32751                                                         00034 
32750 WRITE ( LUN,1020 )  DSW                                             00036 
 1020 FORMAT( ' **** DSW == ',I3 )                                        00037 
32751 CONTINUE                                                            00039 
C                                                                         00040 
C                                                                         00041 
32756 IF(.NOT.( IOS.GE.128 )) GO TO 32749                                 00042 
      I0 = 1                                                              00043 
32748 IF(.NOT.( IOSSY(I0).NE.0 .AND. IOSSY(I0).NE.IOS )) GO TO 32747      00044 
      I0 = I0+1                                                           00044 
      GO TO 32748                                                         00044 
32747 I1 = I0+1                                                           00045 
      I2 = I1+1                                                           00046 
32746 IF(.NOT.( IOSSY(I2).NE.0.AND.(IOSSY(I2).GT.255.OR.IOSSY(I2).LT.128  00047 
     1) )) GO TO 32745                                                    00047 
      I1 = I1+1                                                           00048 
      I2 = I1+1                                                           00049 
      GO TO 32746                                                         00050 
32745 IF(.NOT.( IOSSY(I0).NE.0 )) GO TO 32743                             00051 
      WRITE( LUN,1030 )  (IOSSY(I),I=I0+1,I0+3),(IOSSY(I),I=I0+4,I1)      00052 
 1030 FORMAT( ' **** IOS == ',3A2,' - ',<I1-I0-3>A2 )                     00053 
      GO TO 32744                                                         00054 
32743 WRITE( LUN,1040 )  (IOS+"177400)                                    00056 
 1040 FORMAT( ' **** IOS == ',I3 )                                        00057 
32744 CONTINUE                                                            00059 
C                                                                         00060 
C                                                                         00061 
32749 RETURN                                                              00062 
C                                                                         00063 
C                                                                         00064 
      END                                                                 00065 
