why change “complex*16” to “complex(16)” cause the runtime increased unreasonably in fortran?

我的未来我决定 提交于 2019-12-04 17:08:55
Ian Bush

Oh dear. A kind value is not the same number as the bytes that a variable occupies. In most (but not all) compilers complex(16) is quadruple precision (where supported), and that is why your run time goes through the roof. Please learn about kind values, see for instance

Fortran 90 kind parameter

to get started, and then understand that for complex variables the kind values are the same as the kinds of the real values that constitute it.

I'm not going to say more as, to be honest, if somebody posts a relatively long program and then tells me to ignore the warnings during compilation and then sort out their problem, well I don't feel that inclined to put much effort in. Fix the warnings, cut the program down to at most a few tens of lines, and then I, and I suspect most other people, will look more carefully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!