






































































































      SUBROUTINE ESPSET (ISTART,IEND,PURPOS)



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INTEGER       ISTART, IEND, PURPOS, BLSTART, BLEND, I, IERR







      CALL ESP100 (BLSTART, BLEND, ISTART, IEND, IERR)
      IF (IERR.GT.0) GOTO 998



      DO 100 I=BLSTART, BLEND
         ESPUSE(I)=PURPOS
 100  CONTINUE



      IF (WIFPAR(1012).GE.2) THEN
         CALL GVSFMT ('?FMT062')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) BLSTART,BLEND,PURPOS
         CALL GVSRDB (LINE)
         CALL GVSTT6 (LINE)
         CALL GVSFMT ('?FMT061')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) ISTART,IEND,PURPOS
         CALL GVSRDB (LINE)
         CALL GVSTT6 (LINE)
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('ESPSET')



  998 CONTINUE


      RETURN
      END
      LOGICAL FUNCTION ESPBAD(ISTART,IEND,PURPOS)



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ESPACE.INC'
      INTEGER       ISTART, IEND, PURPOS, BLSTART, BLEND, I, IERR







      ESPBAD=.FALSE.



      CALL ESP100 (BLSTART,BLEND,ISTART,IEND,IERR)
      IF (IERR.NE.0) GOTO 998



      DO 100 I=BLSTART,BLEND
         IF (ESPUSE(I).NE.PURPOS) THEN
            ESPBAD=.TRUE.



            IF (WIFPAR(1012).GT.0) THEN
               CALL WIFPUSHPPP (1012,2)
               CALL GVSFMT ('?FMT060')
               WRITE (LINE,FMT,ERR=999) BLSTART,BLEND,PURPOS
               CALL GVSRDB (LINE)
               CALL GVSTT6 (LINE)
               CALL GVSFMT ('?FMT060A')
               WRITE (LINE,FMT,ERR=999) ISTART,IEND
               CALL GVSRDB (LINE)
               CALL GVSTT6 (LINE)
               CALL GVSFMT ('?FMT059')
               WRITE (LINE,FMT,ERR=999) I,ESPUSE(I)
               CALL GVSTT6 (LINE)
               CALL GVSTT6 ('?M0921')
               CALL WIFPOPPPP (1012)
            END IF
            GOTO 998
         END IF
 100  CONTINUE
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('ESPBAD')



  998 CONTINUE


      RETURN
      END
      SUBROUTINE ESP100 (BLSTART,BLEND,ISTART,IEND,IERR)



















      IMPLICIT      NONE
      INCLUDE       'ESPACE.INC'
      INTEGER       BLSTART, BLEND, ISTART, IEND, IERR
      LOGICAL       GVFIBN







      IF (.NOT.GVFIBN(ISTART,1,MAXESP)) THEN
         CALL GVSTTE ('?M0421')
         CALL GVSKIL
         IERR=1
         GOTO 998
      END IF
      IF (.NOT.GVFIBN(IEND,1,MAXESP)) THEN
         CALL GVSTTE ('?M0422')
         CALL GVSKIL
         IERR=1
         GOTO 998
      END IF



      BLSTART=((ISTART-1)/ESPBLS)+1
      BLEND=((IEND-1)/ESPBLS)+1
      IERR=0



  998 CONTINUE


      RETURN
      END
      SUBROUTINE ESPKIL (ISTART,IEND,PURPOS,NAME)



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       ISTART, IEND, PURPOS, GVFLEN
      LOGICAL       ESPBAD
      CHARACTER*(*) NAME







      IF (ESPBAD(ISTART,IEND,PURPOS)) THEN
         CALL GVSFMT ('?FMT063')
         CALL GVSCTB (LINE,80)
         WRITE (LINE,FMT,ERR=999) NAME(1:GVFLEN(NAME))
         CALL GVSRDB (LINE)
         CALL GVSTTB (LINE)
         CALL GVSKIL
      END IF
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('ESPKIL')



  998 CONTINUE


      RETURN
      END
