C*-*-*BEGIN0
SUBROUTINE BEGIN0
c
c RMARG is set to 80.
c CHI is set to 156 to enable use of the Extended Character Set,
c also dimensions of ACODE, SCODE, and LCODE set to 156.
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
C BEGIN0,INPUT,OPENN,SLMARG
INTEGER CLOCK
COMMON/ZACODE/ACODE(156) /ZAPOS/APOS /ZCHI/CHI /ZCUNIT/CUNIT
x/ZECHO
X/ECHO /ZEJECT/EJECT /ZIBUFF/IBUFF(80) /ZIPOS/IPOS /ZISIZE/ISIZE /Z
XIUNIT/IUNIT /ZLCODE/LCODE(156) /ZMUNIT/MUNIT /ZOLINE/OLINE
x/ZOUNIT/
XOUNIT /ZPRNTR/PRNTR /ZRMARG/RMARG /ZSCODE/SCODE(156) /ZTAU0/TAU0
INTEGER ACODE,APOS,C,CHI,CHI3,CHI33,CUNIT,D,ECHO,EJECT,I,IBUFF,IDU
XM,IPOS,ISIZE,IUNIT,IUNOLD,J,J1Y,J2Y,J3Y,J4Y,J5Y,J6Y,J7Y,J8Y,LCODE,
XMUNIT,OLINE,OUNIT,PRNTR,RMARG,S,SCODE,T,TAU0
7 TAU0=CLOCK(IDUM )
2 CHI=156
3 IUNIT=5
ISIZE=80
IPOS=ISIZE
ECHO=0
CUNIT=1
4 MUNIT=6
OUNIT=6
PRNTR=OUNIT+1
CALL SLMARG(0)
RMARG=80
OLINE=0
EJECT=0
APOS=0
5 CHI3=CHI/3
CHI33=2*CHI3
IUNOLD=IUNIT
IUNIT=CUNIT
CALL OPENN( 1 , 0 )
CALL INPUT
I=1
J1Y=CHI3
9 IF(I.GT.J1Y)GO TO 10
LCODE(I)=IBUFF(I)
SCODE(I)=LCODE(I)
ACODE(I)=I-1
I=I+1
GO TO 9
10 CALL INPUT
I=CHI3+1
J3Y=CHI33
11 IF(I.GT.J3Y)GO TO 12
J2Y=I-CHI3
LCODE(I)=IBUFF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