gfortran does not allow character arrays with varying component lengths

試著忘記壹切 提交于 2019-11-28 00:16:13
francescalus

You have some lengths 12 in the constructor, so it may be better to use length 12.

Also, use instead

character(len=12), dimension(5) :: models = [character(len=12) :: "feddes.swp", &
                "jarvis89.swp", "jarvis10.swp", "pem.swp", "van.swp"]

Possibly even better, if you have compiler support, is

character(len=*), dimension(*) :: ...

The original code is accepted by ifort but it is not standard fortran, hence the error from gfortran. If you supply the option -std to ifort it will print warnings when the compiler allows extensions such as this.

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