subroutine openf(UNIT,FNAME)
c
c Associate a file specified by FNAME with a Fortran UNIT number.
c FNAME is an Aldes token.
c
integer UNIT, FNAME, FIRST, RED, F, BETA, i, LCODE, ichar, index, c
character char
common/ZBETA/BETA
common/ZLCODE/LCODE(156)
character*50 value
value = ""
i = 1
F=FNAME
if (F.EQ.BETA) return
1 c = FIRST(F)
index = LCODE(c+1)
c ... convert upper to lower case
if (c.GE.10.AND.c.LE.35) index = index+ichar('a')-ichar('A')
value(i:i) = char(index)
i = i + 1
F = RED(F)
if (F.NE.BETA) go to 1
open( UNIT , file = value )
rewind UNIT
return
end