BEGIN0()
$(BEGIN 0. INITIALIZE THE BASIC SYSTEM.
LOCAL VERSION IN ALDES.
****** 5/30/82 NOTE - CANNOT BE TRANSLATED AND USED WITH
CURRENT TRANSLATOR SINCE FORTRAN PRODUCED WILL HAVE
THE ACODE, SCODE, AND LCODE ARRAYS DIMENSIONED AT 47,
EVEN THOUGH THE CURRENT TRANSLATOR HAS AN INTERNAL
CHI OF 156. THE VERSION THAT SHOULD BE USED IS
A CORRECTED FORTRAN VERSION THAT SHOULD RESIDE IN
THE SAME DIRECTORY AS THIS ALGORITHM.
******
C HOW THIS VERSION IS NONSTANDARD
C
C RMARG IS SET TO 80.
C CHI IS SET TO 156 TO ENABLE USE OF THE EXTENDED CHARACTER SET,
C CHARACTER CARD ASSOCIATED WITH UNIT 1 BY THE CALL OPENN(1, 0).
C PRNTR SET TO OUNIT+1 SO THAT (132A1) FORMAT ALWAYS USED FOR
C OUTPUT, SINCE UNIX FORTRAN DOESN'T HAVE CARRIAGE CONTROL.
C )
SAFE BEGIN0.
(1) $(READ CLOCK.) TAU0=CLOCK().
(2) $(SET CHARACTER SET SIZE.) CHI=156.
(3) $(SET INPUT GLOBALS.) IUNIT=5. ISIZE=80. IPOS=ISIZE. ECHO=0.
CUNIT=1.
(4) $(SET OUTPUT GLOBALS.) MUNIT=6. OUNIT=6. PRNTR=OUNIT+1.
SLMARG(0). RMARG=80. OLINE=0. EJECT=0. APOS=0.
(5) $(INITIALIZE CODE ARRAYS.) CHI3=CHI/3. CHI33=2*CHI3.
IUNOLD=IUNIT. IUNIT=CUNIT.
OPENN(1,0).
INPUT. FOR I=1,...,CHI3 DO
( LCODE(I)=IBUFF(I). SCODE(I)=LCODE(I). ACODE(I)=I-1 ).
INPUT. FOR I=CHI3+1,...,CHI33 DO
( LCODE(I)=IBUFF(I-CHI3). SCODE(I)=LCODE(I). ACODE(I)=I-CHI3-1 ).
INPUT. FOR I=CHI33+1,...,CHI DO
( LCODE(I)=IBUFF(I-CHI33). SCODE(I)=LCODE(I). ACODE(I)=I-CHI33-1 ).
IUNIT=IUNOLD.
FOR J=CHI-1,CHI-2,...,1 DO ( FOR I=1,...,J DO ( C=SCODE(I).
D=SCODE(I+1). S=SIGN(C). T=SIGN(D). IF S GT T OR S=T AND C GT D
THEN ( SCODE(I)=D. SCODE(I+1)=C. C=ACODE(I).
ACODE(I)=ACODE(I+1). ACODE(I+1)=C ) ) ). RETURN..