    	SUBROUTINE IFMARK( XPOS, YPOS, SIZE, ANGLE, ICODE )
C
C   PROGRAMMER: R.S. ZHOU,		ALFRED UNIVERSITY
C
C	THIS ROUTINE DRAWS MARKER SYMBOLS USING "IFPLOT" COMMANDS.
C
C	ICODE --- POINTER TO THE FOLLOWING SYMBOL TABLE:
C
C		ICODE = 1 : SQUARE
C		ICODE = 2 : SOLID SQUARE
C		ICODE = 3 : HEXAGON
C		ICODE = 4 : SOLID HEXAGON
C		ICODE = 5 : TRIANGLE
C		ICODE = 6 : SOLID TRIANGLE
C		ICODE = 7 : DIAMOND
C		ICODE = 8 : SOLID DIAMOND
C		ICODE = 9 : PLUS
C		ICODE =10 : CROSS
C		ICODE =11 : STAR
C		ICODE =12 : DOUBLE TRIANGLES
C		ICODE =13 : CIRCLE
C		ICODE =14 : CIRCLE + CROSS
C		ICODE =15 : FULL MOON
C		ICODE =16 : RIGHT HALF MOON
C		ICODE =17 : LEFT HALF MOON
C		ICODE =18 : TOP HALF MOON
C		ICODE =19 : BOTTOM HALF MOON
C
C	SIZE --- DIAMETER OF SYMBOL IN INCHES.
C	XPOS --- X-COORDINATE OF SYMBOL CENTER.
C	YPOS --- X-COORDINATE OF SYMBOL CENTER.
C	ANGLE--- ROTATION ANGLE IN DEGREES.
C
     	INCLUDE 'TEKLIB.CBS'
C
C  SUPRESS WRITING OF "DI" FILE BY THE FOLLOWING SUBROUTINES...
C
     	IWD = IDW
     	IF( ITM.EQ.1 ) GOTO 999
     	IDW = 0
     	RAD = 0.5*ABS(SIZE)
     	IF( RAD.LT.0.01 ) RAD = 0.01
C
C  REORIGIN TO (XPOS,YPOS) ...
C
     	CALL IFPLOT( XPOS, YPOS, -3 )
C
C  SET THE SYMBOL ROTATION IF AT ALL...
C
    	IF( ANGLE.NE.0.0 ) THEN
     	    ANGX = XANG
     	    ANGY = YANG
     	    CALL IFROTA( ANGLE+XANG, ANGLE+YANG )
     	ENDIF
     	IF( XSCL.NE.YSCL ) THEN
     	    XSCF = XSCL
     	    YSCF = YSCL
     	    CALL IFSCAL( XSCL, XSCL )
     	ENDIF
     	LTYOLD = LTY
     	IF( LTY.GT.1 ) CALL IFSTYL(1,0)
    	ICD = IABS(ICODE)
     	IF( ICD.EQ.1 ) THEN			!SQUARE
     	    CALL IFMARK_SQUARE( 0.9*RAD )
     	ELSE IF( ICD.EQ.2 ) THEN		!SOLID SQUARE
     	    CALL IFMARK_SSQUARE( 0.9*RAD )
     	ELSE IF( ICD.EQ.3 ) THEN		!HEXAGON
     	    CALL IFMARK_HEXAGON( RAD )
     	ELSE IF( ICD.EQ.4 ) THEN
     	    CALL IFMARK_SHEXAGON( RAD )		!SOLID HEXAGON
     	ELSE IF( ICD.EQ.5 ) THEN
     	    CALL IFMARK_TRIANGLE( 1.2*RAD )	!TRIANGLE
     	ELSE IF( ICD.EQ.6 ) THEN
     	    CALL IFMARK_STRIANGLE( 1.2*RAD )	!SOLID TRIANGLE
     	ELSE IF( ICD.EQ.7 ) THEN
     	    CALL IFMARK_DIAMOND( 1.2*RAD )	!DIAMOND
     	ELSE IF( ICD.EQ.8 ) THEN
     	    CALL IFMARK_SDIAMOND( 1.2*RAD )	!SOLID DIAMOND
     	ELSE IF( ICD.EQ.9 ) THEN
     	    CALL IFMARK_PLUS( RAD )		!PLUS SIGN
     	ELSE IF( ICD.EQ.10 ) THEN
     	    CALL IFMARK_CROSS( 0.85*RAD )	!CROSS
     	ELSE IF( ICD.EQ.11 ) THEN
     	    CALL IFMARK_CROSS( 0.85*RAD )	!CROSS
     	    CALL IFMARK_PLUS( RAD )		!PLUS SIGN
     	ELSE IF( ICD.EQ.12 ) THEN
     	    CALL IFMARK_DTRIANGLE( RAD )	!DOUBLE TRIANGLE
     	ELSE IF( ICD.EQ.13 .OR. ICD.EQ.14 .OR. ICD.EQ.15 ) THEN
     	    IF( ICD.EQ.15 ) CALL IFFILL(1)
     	    CALL IFMARK_CIRCLE( RAD )		!CIRCLE
     	    IF( ICD.EQ.14 ) CALL IFMARK_PLUS(RAD)
     	    IF( ICD.EQ.15 ) CALL IFFILL(0)
     	ELSE IF( ICD.EQ.16 ) THEN
     	    CALL IFMARK_RMOON( RAD )		!RIGHT HALF MOON
     	ELSE IF( ICD.EQ.17 ) THEN
     	    CALL IFMARK_LMOON( RAD )		!LEFT HALF MOON
     	ELSE IF( ICD.EQ.18 ) THEN
     	    CALL IFMARK_TMOON( RAD )		!TOP HALF MOON
     	ELSE IF( ICD.EQ.19 ) THEN
     	    CALL IFMARK_BMOON( RAD )		!BOTTOM HALF MOON
     	ENDIF
C
C  RESTORE ...
C
     	IF( LTYOLD.GT.1 ) CALL IFSTYL(LTYOLD,0)
     	CALL IFPLOT( 0.0, 0.0, 3 )
     	IF( XSCF.NE.YSCF ) CALL IFSCAL( XSCF, YSCF )
    	IF( ANGLE.NE.0.0 ) CALL IFROTA( ANGX, ANGY )
     	CALL IFPLOT( -XPOS, -YPOS, -9 )

999	IF( IWD.NE.0 ) THEN
     	    IF( NPPS.GT.0 ) CALL IFPLOT_DUMP
     	    WRITE(IDF,1000) ICODE, SIZE, XPOS, YPOS, ANGLE
     	ENDIF
1000	FORMAT('MARK:',I3,4F8.3)
     	IDW = IWD
     	RETURN
     	END

     	SUBROUTINE IFMARK_SQUARE( SIZE )
     	RAD = SIZE
     	CALL IFPLOT(  0.0,  RAD, 2 )
    	CALL IFPLOT( -RAD,  RAD, 2 )
    	CALL IFPLOT( -RAD, -RAD, 2 )
    	CALL IFPLOT(  RAD, -RAD, 2 )
    	CALL IFPLOT(  RAD,  RAD, 2 )
     	CALL IFPLOT(  0.0,  RAD, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_SSQUARE( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
    	CALL IFPLOT( -RAD,  RAD, 3 )
    	CALL IFPLOT( -RAD, -RAD, 2 )
    	CALL IFPLOT(  RAD, -RAD, 2 )
    	CALL IFPLOT(  RAD,  RAD, 2 )
     	CALL IFPLOT( -RAD,  RAD, 2 )
     	CALL IFFILL(0)
     	RETURN
     	END

     	SUBROUTINE IFMARK_HEXAGON( SIZE )
     	RAD = SIZE
     	ADD = 0.866*RAD
     	DDA = 0.500*RAD
    	CALL IFPLOT(  0.0,  RAD, 2 )
    	CALL IFPLOT( -ADD,  DDA, 2 )
    	CALL IFPLOT( -ADD, -DDA, 2 )
    	CALL IFPLOT(  0.0, -RAD, 2 )
    	CALL IFPLOT(  ADD, -DDA, 2 )
    	CALL IFPLOT(  ADD,  DDA, 2 )
     	CALL IFPLOT(  0.0,  RAD, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_SHEXAGON( SIZE )
     	RAD = SIZE
     	ADD = 0.866*RAD
     	DDA = 0.500*RAD
     	CALL IFFILL(1)
    	CALL IFPLOT(  0.0,  RAD, 3 )
    	CALL IFPLOT( -ADD,  DDA, 2 )
    	CALL IFPLOT( -ADD, -DDA, 2 )
    	CALL IFPLOT(  0.0, -RAD, 2 )
    	CALL IFPLOT(  ADD, -DDA, 2 )
    	CALL IFPLOT(  ADD,  DDA, 2 )
     	CALL IFPLOT(  0.0,  RAD, 2 )
     	CALL IFFILL(0)
     	RETURN
     	END

     	SUBROUTINE IFMARK_TRIANGLE( SIZE )
     	RAD = SIZE
     	ADD = 0.500*RAD
     	DDA = 0.866*RAD
     	CALL IFPLOT(  0.0,  RAD, 2 )
    	CALL IFPLOT( -DDA, -ADD, 2 )
    	CALL IFPLOT(  DDA, -ADD, 2 )
    	CALL IFPLOT(  0.0,  RAD, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_STRIANGLE( SIZE )
     	RAD = SIZE
     	ADD = 0.500*RAD
     	DDA = 0.866*RAD
     	CALL IFFILL(1)
     	CALL IFPLOT(  0.0,  RAD, 3 )
    	CALL IFPLOT( -DDA, -ADD, 2 )
    	CALL IFPLOT(  DDA, -ADD, 2 )
    	CALL IFPLOT(  0.0,  RAD, 2 )
     	CALL IFFILL(0)
     	RETURN
     	END

     	SUBROUTINE IFMARK_DIAMOND( SIZE )
     	RAD = SIZE
     	CALL IFPLOT(  0.0,  RAD, 2 )
    	CALL IFPLOT( -RAD,  0.0, 2 )
    	CALL IFPLOT(  0.0, -RAD, 2 )
    	CALL IFPLOT(  RAD,  0.0, 2 )
    	CALL IFPLOT( 0.0, RAD, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_SDIAMOND( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
     	CALL IFPLOT(  0.0,  RAD, 3 )
    	CALL IFPLOT( -RAD,  0.0, 2 )
    	CALL IFPLOT(  0.0, -RAD, 2 )
    	CALL IFPLOT(  RAD,  0.0, 2 )
    	CALL IFPLOT(  0.0,  RAD, 2 )
     	CALL IFFILL(0)
     	RETURN
     	END

     	SUBROUTINE IFMARK_PLUS( SIZE )
     	RAD = SIZE
     	CALL IFPLOT(  0.0,  RAD, 3 )
    	CALL IFPLOT(  0.0, -RAD, 2 )
    	CALL IFPLOT( -RAD,  0.0, 3 )
    	CALL IFPLOT(  RAD,  0.0, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_CROSS( SIZE )
     	RAD = SIZE
     	CALL IFPLOT( -RAD, -RAD, 3 )
    	CALL IFPLOT(  RAD,  RAD, 2 )
    	CALL IFPLOT( -RAD,  RAD, 3 )
    	CALL IFPLOT(  RAD, -RAD, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_DTRIANGLE( SIZE )
     	RAD = SIZE
     	ADD = 0.25*RAD
    	DDA = -RAD + ADD
    	DDD =  RAD + ADD
    	CALL IFPLOT(  0.0, DDD, 3 )
    	CALL IFPLOT( -RAD, DDA, 2 )
    	CALL IFPLOT(  RAD, DDA, 2 )
    	CALL IFPLOT(  0.0, DDD, 2 )
    	DDA = DDA - ADD - ADD
    	DDD = DDD - ADD - ADD
    	CALL IFPLOT(  0.0, DDA, 3 )
    	CALL IFPLOT( -RAD, DDD, 2 )
    	CALL IFPLOT(  RAD, DDD, 2 )
    	CALL IFPLOT(  0.0, DDA, 2 )
     	RETURN
     	END

     	SUBROUTINE IFMARK_CIRCLE( SIZE )
     	RAD = SIZE
     	CALL IFPLOT( RAD, 0.0, 3 )
     	DO I=20,360,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	RETURN
     	END

     	SUBROUTINE IFMARK_RMOON( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
     	CALL IFPLOT( 0.0, -RAD, 3 )
     	DO I=-70,90,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	CALL IFFILL(0)
     	CALL IFPLOT( 0.0, RAD, 3 )
     	DO I=110,270,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	RETURN
     	END

     	SUBROUTINE IFMARK_LMOON( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
     	CALL IFPLOT( 0.0, RAD, 3 )
     	DO I=110,270,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	CALL IFFILL(0)
     	CALL IFPLOT( 0.0, -RAD, 3 )
     	DO I=-70,90,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	RETURN
     	END

     	SUBROUTINE IFMARK_TMOON( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
     	CALL IFPLOT( RAD, 0.0, 3 )
     	DO I=20,180,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	CALL IFFILL(0)
     	CALL IFPLOT( -RAD, 0.0, 3 )
     	DO I=-160,0,20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	RETURN
     	END

     	SUBROUTINE IFMARK_BMOON( SIZE )
     	RAD = SIZE
     	CALL IFFILL(1)
     	CALL IFPLOT( RAD, 0.0, 3 )
     	DO I=-20,-180,-20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	CALL IFFILL(0)
     	CALL IFPLOT( -RAD, 0.0, 3 )
     	DO I=160,0,-20
     	   CALL IFPLOT( RAD*COSD(FLOAT(I)), RAD*SIND(FLOAT(I)), 2 )
    	ENDDO
     	RETURN
     	END

