     	SUBROUTINE IFSPEN( IPEN )
C
C  PROGRAMMER: R.S. ZHOU	SEP-1986
C
C	THIS ROUTINE SELECTS A NEW PEN OF NUMBER "IPEN".
C
    	INCLUDE 'HP7221.CBS'

     	IPN = IPEN
     	IF( IPN.EQ.ILP ) GOTO 999
     	IF( IPN.LT.1 .OR. IPN.GT.8 ) IPN = 1
     	IF( IPL.GT.NBS-2 ) CALL IFINIT_DUMP
     	IPL = IPL + 1
     	IPB(IPL) = 'v'
     	CALL IFINIT_SBN(IPN)
     	ILP = IPN

999	RETURN
    	END

