	SUBROUTINE SHFORM (FORM, LINE1, LINE2, LENGTH)
C
C	   Routine to show the AIDS FORMAT chemical formula in
C	   an easy to read manner.  The input, FORM, is in the
C	   format ready for Photo-Typesetting, as produced by
C	   subroutine PHFORM.
C
C	   By: Mark Holomany, JCPDS     Date: 31-Jan-1984
C
C

	IMPLICIT INTEGER (A-Z)

D	INCLUDE 'IORET.CMN'
C\$INCLUDE:'IORET.CMN'

	CHARACTER*80  FORM
	CHARACTER*80  LINE1,LINE2
	LOGICAL WRITE1

	PTR = 1
	WRITE1 = .FALSE.

	I = 0
3000	CONTINUE
	I = I + 1
	IF(I .GT. 80) GO TO 10

	IF(PTR.GT.80) THEN
           LENGTH = I - 1
           GO TO 15
        ENDIF

100	IF(FORM(PTR:PTR) .EQ. '@') THEN
	   PTR = PTR + 1
	   GO TO 100

	ELSE IF(FORM(PTR:PTR) .EQ. '#') THEN
	   LINE2(I:I) = FORM(PTR+1:PTR+1)
	   PTR = PTR + 2
	   LINE1(I:I) = ' '

	ELSE IF(FORM(PTR:PTR) .EQ. '$') THEN
	   LINE1(I:I+2) = FORM(PTR:PTR+2)
	   PTR = PTR + 3
	   LINE2(I:I+2) = ' '
	   I = I + 2

	ELSE IF(FORM(PTR:PTR) .EQ. ' ') THEN
	   LENGTH = I - 1
	   GO TO 15

	ELSE
	   LINE1(I:I) = FORM(PTR:PTR)
	   PTR = PTR + 1
	   LINE2(I:I) = ' '
	ENDIF
	GO TO 3000
10	LENGTH = 80

15	CONTINUE
C-->	IF(WRITE1) WRITE(NOUT,101) LINE@(1:LENGTH)
C-->	WRITE(NOUT,101) LINE1(1:LENGTH)
C-->	WRITE(NOUT,101) LINE2(1:LENGTH)
C-->101	FORMAT(' ',A)

	RETURN
	END
