Check Fortran 77 line length

by Yi Zhang

Another issue with F77 is its length limit: each line should be less than 72 char, otherwise the rest of the content will be ignored. Of course I can demand compiler work in free-form mode, but that would cause other compatibility problems. This happens occasionally after I’ve done some “sed s/” stuff over the variable names. So I need to remember checking line length, by adding an awk line in the Makefile:

awk '/^[^cC]/ && length > 72 {print FILENAME,FNR}' *.f

 

Advertisements