首次使用linux版本的ifort遇到一个intent(IN) 问题
A dummy argument name is required in this context.integer ,intent(in) :: n就是这个intent
说的是属性说明,但是不知道为什么会报错
n 如果有 intent(IN) 属性,则必须是虚参。你这个n可能不是虚参 fcode 发表于 2014-7-15 10:30
n 如果有 intent(IN) 属性,则必须是虚参。你这个n可能不是虚参program x
real :: z = 10
type position
real :: x
real :: y
real :: z
end type position
type(position) :: xyz
xyz = position(1,2,3)
z = fun1(z)
write(*,*) z
contains
real function fun1(x)
real intent(in) :: x
fun1 = (x+xyz%z)/xyz%z
end function fun1
end program x
就是这么一段小程序,就是这个地方卡住了,其实已经遇到好几处这个问题的原因了,就是实参虚参不太明白 real intent(in) :: x
修改为
real ,intent(in) :: x
也就是加一个逗号 vvt 发表于 2014-7-15 10:43
real intent(in) :: x
修改为
real ,intent(in) :: x
太谢谢了,果然是这个问题啊
页:
[1]