这个简单的代码有问题,给出了下面的错误。不知何故,它是说与Intent (in)属性有冲突。
gfortran -o build/lib/larsa.o -c -ffree-form -g -J./build/lib lib/larsa.f
lib/larsa.f:2701.8:
sep, sty, shr &
1
Error: PROCEDURE attribute conflicts with INTENT attribute in 'sep' at (1)
lib/larsa.f:2710.17:
If (Len_trim (sep) > 0) Then
1
Error: 'string' argument of 'len_trim' intrinsic at (1) must be CHARACTER这是子程序
Subroutine write_separator_new &
( &
sep, sty, shr &
)
Character (len=*), Intent(in) :: sep, sty
Integer, Intent(in), Optional :: shr
Character (len=65) :: a, fmt
If (Len_trim (sep) > 0) Then
a = Repeat (sep(1), 60)
Else
Write (*,*) ""
End If
End Subroutine write_separator_new发布于 2014-12-02 15:43:27
字符串索引需要:
a = Repeat (sep(1:1), 60)编译器假定sep是一个函数,因为您将它作为函数使用,而不是作为字符串使用。
https://stackoverflow.com/questions/27253081
复制相似问题