buffered=“yes”处的语法错误在公开声明中
我正在编写一个 Fortran 程序,其中一行是这样写的,
open(unit=un1,file=filenm,form='unformatted',buffered='yes',status='replace',buffercount=127)
我已经定义了
character*256 filenm.
un1=11
,但我仍然收到错误
"Syntax error at or near =" in that line..
I am writing a Fortran program in which one line is written like this
open(unit=un1,file=filenm,form='unformatted',buffered='yes',status='replace',buffercount=127)
I have defined
character*256 filenm.
un1=11
but still I am getting error
"Syntax error at or near =" in that line..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题在于
buffered='yes'
,它不是标准的 Fortran,而是某些供应商扩展,并且您的编译器无法识别它。我会删除它并删除buffercount=127
(在评论中提到)。现代编译器和操作系统允许通过其他方式控制这些东西(外部 I/O 缓冲)。例如,在gfortran中使用环境变量 https://gcc.gnu.org/ onlinedocs/gfortran/Runtime.html#Runtime
The problem lies in the
buffered='yes'
, which is not standard Fortran, but some vendor extension and your compiler does not recognize it. I would just delete it and also delete thebuffercount=127
(mentioned in the comment).Modern compilers and operating systems allow control of these things (external I/O buffering) by other means. For example, using environment variables in gfortran https://gcc.gnu.org/onlinedocs/gfortran/Runtime.html#Runtime