I have a code that I would like to translate from another language to Fortran. The code has a large numbered vector - V(n)- as well as both variables with the name tn (where n is a one-four-digit number) and numerous real numbers, which are currently written as integers. To get Fortran to treat integers as doubles, I would like to add .0D0at the end of each integer.
So, if I have an expression like:
V(1000) = t434 * 45/7 + 1296 * t18
I would like Vim to change it to:
V(1000) = t434 * 45.0D0/7.0D0 + 1296.0D0 * t18
I'm trying to use a negative look to ignore expressions starting with tor V(, and look ahead or ze to find the end of the numbers, but I'm out of luck. Anyone have any suggestions?
source
share