Fortran:CHARACTER声明中的语法错误 [英] Fortran: Syntax error in CHARACTER declaration

查看:330
本文介绍了Fortran:CHARACTER声明中的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在远程超级计算机上运行一个程序,该程序在我的笔记本电脑上运行良好。但该程序不在那里编译。试图追踪这个问题,我将程序降低到最低程度,但仍然给我一个编译错误。任何人有任何想法可能会在这里出错?

I am trying to run a program, which works fine on my laptop, on a remote supercomputer. But the program is not compiling there. Trying to trace the problem, I reduced the program to the basic minimum, and still it is giving me a compilation error. Anyone has any ideas what might be going wrong here?

[k00603@fe01p08 python_utilities]$cat test.f90
program test
character(:), allocatable :: out  
end program test
[k00603@fe01p08 python_utilities]$gfortran test.f90
In file test.f90:3

character(:), allocatable :: out
         1
Error: Syntax error in CHARACTER declaration at (1)

我猜gfortran运行良好,因为当我执行以下操作时,它可以工作:

I guess the gfortran is running fine as when I do the following, it works:

[k00603@fe01p08 python_utilities]$cat test.f90
program test
print *, "Hello World!"
end program test
[k00603@fe01p08 python_utilities]$gfortran test.f90
[k00603@fe01p08 python_utilities]$./a.out 
Hello World!

超级计算机上的编译器是:

The compiler on the supercomputer is:

[k00603@fe01p08 256]$gfortran --version
GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
Copyright (C) 2007 Free Software Foundation, Inc.


推荐答案

CHARACTER(:)... 是一个Fortran 2003特性,称为延迟长度字符。它最近才加入到gfortran中,并且在某些地区的支持(延期长度字符组件)仍然不完整。

CHARACTER(:)... is a Fortran 2003 feature known as deferred length character. It was only recently added to gfortran and support in some areas (deferred length character components) is still incomplete.

您的超级计算机可能运行的是旧版本的编译器,它缺少对此功能的支持。

Your supercomputer is probably running a older version of the compiler which lacks support for this feature.

这篇关于Fortran:CHARACTER声明中的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆