Fortran and C order their arrays differently. Fortran is column major; C is row major. There are performance implications to using the wrong order.
What do you do when you inherit a 10k+ line Fortran code written in C order? Regular expressions are not reliable. By-hand conversion takes too long and is fraught with human errors. So, I wrote the freo program in Scheme to flip the indicies of a specified function. Freo transposes Fortran indicies. It correctly converted the entire 12k line code in 54 files without human help in a few seconds.
Download exe file at: freo.exe and .scm code at: freo.scm. The code is not pretty and not optimal, but it does exist and does work. The code is compiled to a windows exe with Chicken Scheme.