Learning FORTRAN In the Modern Era

后端 未结 10 561
既然无缘
既然无缘 2020-12-12 09:38

I\'ve recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I\'m having difficulties getting a handle on all of the, say, nuances, of a

10条回答
  •  猫巷女王i
    2020-12-12 09:50

    There's something in the original question that I would caution about. You say the code is rife with "performance enhancing improvements". Since Fortran problems are generally of a scientific and mathematical nature, do not assume these performance tricks are there to improve the compilation. It's probably not about the language. In Fortran, the solution is seldom about efficiency of the code itself but of the underlying mathematics to solve the end problem. The tricks may make the compilation slower, may even make the logic appear messy, but the intent is to make the solution faster. Unless you know exactly what it is doing and why, leave it alone.

    Even simple refactoring, like changing dumb looking variable names can be a big pitfall. Historically standard mathematical equations in a given field of science will have used a particular shorthand since the days of Maxwell. So to see an array named B(:) in electromagnetics tells all Emag engineers exactly what is being solved for. Change that at your peril. Moral, get to know the standard nomenclature of the science before renaming too.

提交回复
热议问题