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
vvt 发表于 2014-7-15 10:43
real intent(in) :: x
修改为
real ,intent(in) :: x
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |