Here is the original code. The only change is that I used implicit none to help find typos and declare all variables, then commented it out. (If lower case bothers you, run it through ‘tr’.)
C.....To classify USAS Fortran records into 36 classes
subroutine class (k, ityp)
C..... *****
C.....Specification
c implicit none
integer k(72)
integer ityp
C***********************************************************************
C* USAS Fortran record classifier -CLASS- *
C* *
C* Language... . . *
C* USAS Fortran (but nearly all USAS basic Fortran *
C* Input... . . *
C* K - An integer array containing 72A1 characters (not altered)*
C* Output... . .
C* ITYP - An integer type code from 1 to 36 *
C* Error exits... . .
C* None
C* Subroutines required... . .
C* KCOMP - A machine dependent integer function that accepts *
C* as arguments an A1 character and a Hollerith constant, and *
C* returns 0 if they represent the same character, otherwise 1 *
C* Type codes... . .
C* 1 comment 2 continuation 3 assignment 4 assign *
C* 5 go to 6 assd. go to 7 comp. go to 8 arith. if *
C* 9 logical if 10 do 11 continue 12 call
c* 13 return 14 stop 15 pause 16 read *
C* 17 write 18 rewind 19 backspace 20 endfile *
c* 21 format 22 integer 23 real 24 doub. prec. *
c* 25 complex 16 logical 27 external 28 dimension *
c* 29 common 30 equivalence 31 data 32 block data *
c* 33 subroutine 34 function 35 end 36 *rogue* *
c***********************************************************************
c.....Declarations
integer kalp(46), ksuc(46), kfal(46), kdec(10), kf(8)
c.....Length of array k
integer leng
data leng /72/
c.....Alphameric constants and match tables
c.....The decimal digits for integer recognition
data kdec(1), kdec(2), kdec(3), kdec(4), kdec( 5),
1 kdec(6), kdec(7), kdec(8), kdec(9), kdec(10)
2 /1h0, 1h1, 1h2, 1h3, 1h4, 1h5, 1h6, 1h7, 1h8, 1h9/
c.....The word -FUNCTION- for matching
data kf(1), kf(2), kf(3), kf(4), kf(5),kf(6), kf(7), kf(8)
1 /1hf, 1hu, 1hn, 1hc, 1ht, 1hi, 1ho, 1hn/
c.....Characters for recognition tests
c..... which are.. c blank ( ) = h / * 0 ,
integer kc,kblnk,klpar,krpar,keq
data kc,kblnk,klpar,krpar,keq /1hc,1h ,1h(,1h),1h=/
integer kh,kslsh,kastk,kzero,kcma
data kh,kslsh,kastk,kzero,kcma /1hh,1h/,1h*,1h0,1h,/
c.....Character array for tree scan
data kalp( 1),kalp( 2),kalp( 3),kalp( 4) /1hi,1hf,1hn,1hg/
data kalp( 5),kalp( 6),kalp( 7),kalp( 8) /1ho,1ht,1ho,1h(/
data kalp( 9),kalp(10),kalp(11),kalp(12) /1hc,1ha,1ho,1hn/
data kalp(13),kalp(14),kalp(15),kalp(16) /1hm,1hm,1hp,1hr/
data kalp(17),kalp(18),kalp(19),kalp(20) /1he,1ha,1hd,1hl/
data kalp(21),kalp(22),kalp(23),kalp(24) /1ht,1hw,1hf,1ho/
data kalp(25),kalp(26),kalp(27),kalp(28) /1hu,1hd,1hi,1ha/
data kalp(29),kalp(30),kalp(31),kalp(32) /1ho,1hu,1hw,1hs/
data kalp(33),kalp(34),kalp(35),kalp(36) /1ht,1hu,1he,1hn/
data kalp(37),kalp(38),kalp(39),kalp(40) /1hd,1hf,1hx,1hq/
data kalp(41),kalp(42),kalp(43),kalp(44) /1hb,1ha,1hl,1ha/
data kalp(45),kalp(46) /1hl,1hp /
c.....Succeed link for tree scan
data ksuc( 1),ksuc( 2),ksuc( 3),ksuc( 4) / 2, -8,-22, 5/
data ksuc( 5),ksuc( 6),ksuc( 7),ksuc( 8) / 6, 7, 8, -7/
data ksuc( 9),ksuc(10),ksuc(11),ksuc(12) / 10,-12, 12,-11/
data ksuc(13),ksuc(14),ksuc(15),ksuc(16) / 14,-29,-25, 17/
data ksuc(17),ksuc(18),ksuc(19),ksuc(20) / 18, 19,-16,-23/
data ksuc(21),ksuc(22),ksuc(23),ksuc(24) /-13,-18, 24,-21/
data ksuc(25),ksuc(26),ksuc(27),ksuc(28) /-34, 27,-28,-31/
data ksuc(29),ksuc(30),ksuc(31),ksuc(32) / 30,-24,-17, 33/
data ksuc(33),ksuc(34),ksuc(35),ksuc(36) /-14,-33, 36, 37/
data ksuc(37),ksuc(38),ksuc(39),ksuc(40) / 38,-20,-27,-30/
data ksuc(41),ksuc(42),ksuc(43),ksuc(44) / 42,-19,-32, -4/
data ksuc(45),ksuc(46) /-26,-15 /
c.....Fail link for tree scan
data kfal( 1),kfal( 2),kfal( 3),kfal( 4) / 4, 3,-36, 9/
data kfal( 5),kfal( 6),kfal( 7),kfal( 8) /-36,-36,-36, -5/
data kfal( 9),kfal(10),kfal(11),kfal(12) / 16, 11,-36, 13/
data kfal(13),kfal(14),kfal(15),kfal(16) /-36, 15,-36, 23/
data kfal(17),kfal(18),kfal(19),kfal(20) /-36, 21, 20,-36/
data kfal(21),kfal(22),kfal(23),kfal(24) / 22,-36, 26, 25/
data kfal(25),kfal(26),kfal(27),kfal(28) /-36, 31, 28, 29/
data kfal(29),kfal(30),kfal(31),kfal(32) /-36,-36, 32, 35/
data kfal(33),kfal(34),kfal(35),kfal(36) / 34,-36, 41, 39/
data kfal(37),kfal(38),kfal(39),kfal(40) /-36,-35, 40,-36/
data kfal(41),kfal(42),kfal(43),kfal(44) / 44, 43,-36, 45/
data kfal(45),kfal(46) / 46,-36 /
c..... Misc declarations
integer isw
integer jch, jcma, jeq, jholl, jsave, jsw, jtyp
integer j, l
integer kcomp
external kcomp
c.......................................................................
c.....Program entry point
c.....First check for comment
if (kcomp (k(1),kc)) 2,1,2
1 jtyp=1
go to 55
c.....Then check for a continuation record
2 if (kcomp (k(6),kblnk)) 3,5,3
3 if (kcomp (k(6),kzero)) 4,5,4
4 jtyp=2
go to 55
c.......................................................................
c.....Initialize the loop
5 jsw=0
isw=0
jeq=0
jcma=0
jholl=0
jsave=kblnk
c.....Assignment scan loop
do 26 j=7,leng
jch=k(j)
if (kcomp (jch,kblnk)) 6,26,6
c.....Its not blank, is Hollerith switch on ... . .
6 if (jholl) 12,12,7
7 do 8 l=1,10
if (kcomp (jch,kdec(l))) 8,10,8
8 continue
c.....First time, no integer means not Hollerith
if (jholl-1) 11,11,9
c..... Otherwise look for the H
9 if (kcomp (jch,kh)) 11,32,11
c.....Still fits Hollerith constant syntax
10 jholl=jholl+1
go to 25
c.....Not a Hollerith constant, set switch off
11 jholl=0
c.....Test other characters (),=/*
12 if (kcomp (jch,klpar)) 13,20,13
13 if (kcomp (jch,krpar)) 14,18,14
14 if (kcomp (jch,kcma )) 15,22,15
15 if (kcomp (jch,keq )) 16,23,16
16 if (kcomp (jch,kslsh)) 17,21,17
17 if (kcomp (jch,kastk)) 25,21,25
c.....Right parenthesis found
18 jsw=jsw-1
if (jsw) 19,19,25
c.....Set switch to allow only one more non-blank character
19 isw=1
go to 26
c.....Left parenthesis found
20 jsw=jsw+1
c.....Set Hollerith switch for ( , / *
21 jholl=1
go to 25
c.....Comma found, check level
22 if (jsw) 30,30,21
c.....Equals sign found, check level
23 if (jsw) 24,24,32
24 jeq=1
c.....Test if terminated by switch set
25 if (isw) 26,26,27
c.....End of assignment scan loop
26 continue
go to 28
c.....Save last character if terminated early
27 jsave=jch
c.......................................................................
c.....Leave scan and come here if ... . .
C..... no more characters
c..... one non-blank character after a right parenthesis
c.....not a do, might be assignment
28 if (jeq) 32, 32, 29
29 jtyp=3
go to 55
c.......................................................................
c.....Leave scan and come here if ... . .
c..... an upper level comma found
c.....might be a DO, not an assignment
30 jcma = 1
if (jeq) 32,32,31
31 jtyp=10
go to 55
c.......................................................................
c.....Leave scan and come here if ... . ..
c..... a Hollerith constant found
c..... an equals in parentheses
c..... filure of DO and assignment tests
c.....neither a DO nor an assignment
c.....enter the keyword classificaation
32 j=1
isw=7
33 jch=k(isw)
c.....If a blank, ignore, get the next
if (kcomp (jch,kblnk)) 34, 37, 34
c.....Test against current tree character
34 if (kcomp (jch,kalp(j))) 35, 36, 35
c.....Character does not match, try the next in tree
35 j=kfal(j)
if (j) 39, 39, 34
c.....Character matches, try next in tree and in record
36 j=ksuc(j)
if (j) 39, 39, 37
37 isw=isw+1
if (isw-leng) 33, 33, 38
c.....If run out of characters, force a rogue type
38 jch=kblnk
go to 35
c.......................................................................
c.....Classification completed, form type code
39 jtyp=-j
c.....Check to seeif more treatment needed
if (jtyp-5 ) 55,45,40
40 if (jtyp-8 ) 55,43,41
41 if (jtyp-22) 55,42,42
42 if (jtyp-26) 47,47,55
c.......................................................................
c.....Logical IF separation test
43 do 44 l=1,10
if (kcomp (jsave,kdec(l))) 44,55,44
44 continue
jtyp=9
go to 55
c.......................................................................
c.....Separate assigned and unconditional GOTOs
45 if (jcma) 55,55,46
46 jtyp=6
go to 55
c.......................................................................
c.....Check whether this is a type statement or a typed function
47 l=11
go to 52
48 l=l+1
if (l-leng) 49,49,55
49 if (kcomp (k(l),kblnk)) 50,48,50
50 if (kcomp (k(l),kf(isw))) 51,53,51
51 if (isw-1) 52,48,52
52 isw=1
go to 50
53 isw=isw+1
if (isw-8) 48,48,54
54 jtyp=34
c.......................................................................
c.....All results come here for return
55 ityp=jtyp
return
end