      SUBROUTINE DUMPBIN(KKK,KENT)  
      USE BLK1MOD
      USE BLKMAP
      CHARACTER*11 FNAME
            ISLP=0
            IPRT=1
            IPNN=1 
            IPEN=1 
            IPO=1 
            IRO=1 
            IPP=0 
            IRFN=0 
            IGEN=0 
            NXZL=0 
            NITST=1 
            ISCTXT=0 
            IFILL=0 
            IALTGM=1 
            NLAYD=0 
            HORIZ=10. 
            VERT=8. 
            XSALE=0. 
            YSALE=0. 
            XFACT=0. 
            YFACT=0. 
            AR=0. 
            ANG=0. 
            xadded=0.
            yadded=0.
            ntempin=0
      
      WRITE(FNAME,6001) KKK
6001  FORMAT('DMP-',I3.3,'.RST')
      OPEN(240,FILE=FNAME,STATUS='UNKNOWN',FORM='UNFORMATTED')
      IF(KENT .EQ. 0) THEN
         DO J=1,NELTS
           DO K=1,3
             NOPSTO(J,2*K-1,1)=NOPEL(J,K)
             NOPSTO(J,2*K,1)=0
           ENDDO
           NOPSTO(J,7,1)=0
           NOPSTO(J,8,1)=0
           IMATSTO(J,1)=1
           THTASTO(J,1)=0.
         ENDDO
       ELSE
         DO J=1,NE
           DO K=1,6
             NOPSTO(J,K,1)=NOP(J,K)
           ENDDO
           NOPSTO(J,7,1)=0
           NOPSTO(J,8,1)=0
           if(nop(j,1) .gt. 0) then
             IMATSTO(J,1)=1
           else
             IMATSTO(J,1)=0
           endif
           THTASTO(J,1)=0.
         ENDDO    
         NELTS=NE
       ENDIF 
       NPSTO(1)=NP
       NESTO(1)=NELTS   
       NLST=0
       NENTRY=0
       NLAYD=0
       NCLM=0     
          WRITE(240) TITLE,NP,NELTS
          WRITE(240) ISLP,IPRT,IPNN,IPEN,IPO,IRO,IPP,IRFN              &
     &  ,IGEN,NXZL,NITST,ISCTXT,IFILL,IALTGM,NLAYD,xadded,yadded,ntempin
          WRITE(240) HORIZ,VERT,XSALE,YSALE,XFACT,YFACT,AR,ANG 
       WRITE(240) ((NOPSTO(J,K,1),K=1,8),IMATSTO(J,1),THTASTO(J,1),J=1,NELTS) 
       WRITE(240)                                                     &
     &   (XUSR(J),YUSR(J),WD(J),WIDTH(J),SS1(J),SS2(J),WIDS(J),         &
     &    WIDBS(J),SSO(J),BS1(J),J=1,NP)                                       
!IPK MAR02 add BS1
!IPK JUL98     +   (XUSR(J),YUSR(J),WD(J),WIDTH(J),SS1(J),SS2(J),WIDS(J)
       WRITE(240) NLST 
!IPK JAN01
       WRITE(240) NENTRY,NLAYD,NCLM 
       CLOSE(240)
       RETURN
       END
    
