Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Printing 在Fortran中打印包含字符和数字的字符串时出错_Printing_Fortran - Fatal编程技术网

Printing 在Fortran中打印包含字符和数字的字符串时出错

Printing 在Fortran中打印包含字符和数字的字符串时出错,printing,fortran,Printing,Fortran,我不熟悉Fortran。我试图打印一行有一些单词和数字。我为此键入以下命令- integer i0lcan integer i0l integer i0rec real r1supdomcan(n0l) integer i0lcan if(i2lcan(i0l,1).ne.0)then do i0rec=1,n0rec i0lcan=i2lcan(i0l,i0rec

我不熟悉Fortran。我试图打印一行有一些单词和数字。我为此键入以下命令-

integer           i0lcan
integer           i0l
integer           i0rec
real              r1supdomcan(n0l)
integer           i0lcan 
if(i2lcan(i0l,1).ne.0)then
    do i0rec=1,n0rec
        i0lcan=i2lcan(i0l,i0rec)
        if(i0lcan.ne.0)then
            call calc_supcan(i0lcan,demdom(i0lcan),
 $          rivout(i0l),envflw(i0l),
 $          supdomcan(i0lcan))

print *, 'calculate_humact at the grid: ', supdomcan(i0lcan), 'supplied from the grid no: ', i0lcan
这会产生一个错误,该错误为
error:PRINT语句(1)

但是,如果我将命令保持为-

print*,“计算网格处的humact:”,supdomcan(i0lcan)


这背后的原因是什么?

你的电话线太长了。我想我们可能有一个复制品,但我没有找到一个好的

固定格式要求行仅使用72个字符。行中的其他字符将被丢弃


很遗憾,您显示的代码没有正确显示列。

请显示更完整的代码,请参阅和。我们应该能够自己尝试你的代码。实际上原始代码有700多行,我正在尝试打印中间变量。我需要添加哪些具体细节?请做一个详细说明。请阅读链接。编辑问题我们真的至少需要你的变量声明。虽然我最初怀疑你的电话线太长,但很有可能。但是,在复制代码时,请确保正确显示使用固定格式时使用的列。此外,始终显示更完整的错误输出。不是还有别的吗?关于行截断的一些事情?减少行中的字符解决了这个问题。但是没有办法打印超过72个字符吗?您可以在下一行继续该语句。查看如何使用代码示例中的
$
字符继续调用语句。第六列中的任何非空字符都表示行继续。或者,您可以停止使用固定格式源,转而使用新的(1990年引入的)自由格式,该格式允许每行最多132个字符