无法识别的令牌“&"在固定的Fortran延续行中 [英] Unrecognized token '&' in Fixed Fortran continuation lines

查看:159
本文介绍了无法识别的令牌“&"在固定的Fortran延续行中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编辑使用固定格式 Fortran的旧项目,并使用 IVF编译器进行编译.我当前遇到的问题是列表中的续行:

I am editing an old project that uses fixed form Fortran and compiling with IVF compiler. The current issue I have is with continuation lines in a list:

format(//,  10x,'*******************************************',/, &
     10x,'* DIAGONALS OF THE RESIDUAL COV. MATRIX   *',/,  &
     10x,'*******************************************',//,  &
     2x,'MEASUREMENT',7X,'  RESIDUAL COVARIANCE', /)

由于某种原因,&"号对我不起作用,并且我不断收到错误消息:

For some reason, the ampersand is not working for me and I keep getting the error:

无法识别的令牌&"跳过

unrecognized token '&' skipped

对于较小的线,增加固定格式的线长并使两条线合为一条,但是在某些情况下,这些线太大.该代码大约在15年前以固定格式Fortran编写,但是我不熟悉Fortran以及新的编译器和设置如何影响代码.

For smaller lines, increasing the fixed form line length and making the two lines one worked but there are instances where the lines are too large for this. The code was written around 15 years ago and in fixed form Fortran but I am unfamiliar with Fortran and how the new compiler and settings affect the code.

转换为自由格式会导致其他格式的一系列错误,并且代码似乎没有损坏,因此我认为不必转换为自由格式.我尝试了其他缩进方法,例如在行尾和下一行开始处使用和符号星号斜线其他论坛建议使用的地方,并且会产生错误:

Converting to free form causes a series of errors with other formatting and the code does not seem broken so I do not think converting to free form is necessary. I have tried other methods of indenting, such as an ampersand at the end of a line and at the beginning of next, an asterisk, and a slash that other forums suggested using and they produce the error:

错误#5082:语法错误,当期望一个错误时发现END-OF-STATEMENT 的: )...

error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ...

我是否缺少某种格式设置,或者可以编辑一些设置来解决这些错误?

Is there some sort of formatting I am missing or is there any settings I could edit to fix these errors?

感谢加文

推荐答案

在固定格式的Fortran中,您将在下一行的第6列中继续输入一行任何字符,而不是&在第一行的末尾.试试:

In fixed form Fortran, you continue a line with any character in column 6 of the next line, not an & at the end of the 1st line. Try:

      format(//,  10x,'*******************************************',/,
     c  10x,'* DIAGONALS OF THE RESIDUAL COV. MATRIX   *',/,
     c  10x,'*******************************************',//,
     c  2x,'MEASUREMENT',7X,'  RESIDUAL COVARIANCE', /)

这篇关于无法识别的令牌“&"在固定的Fortran延续行中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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