[Fortran] 纯文本查看 复制代码
Program main
implicit none
integer::m=5
call dyaraayini(m)
end
Subroutine dyaraayini(n)
implicit none
integer n,i
real dya(n)
do i=1,n
dya(i)=0.0
end do
write(*,*)dya
call arraytest(dya,n)
write(*,*)dya
end
Subroutine arraytest(a,n)
implicit none
integer i,n
real,dimension(1)::a
! real,dimension(n)::a
do i=1,n
a(i)=1+i
end do
end
[Fortran] 纯文本查看 复制代码
Program main
implicit none
integer::m=5
call dyaraayini(m)
end
Subroutine dyaraayini(n)
implicit none
integer n,i
real dya(n)
do i=1,n
dya(i)=0.0
end do
write(*,*)dya
call arraytest(dya,n)
write(*,*)dya
end
Subroutine arraytest(a,n)
implicit none
integer i,n
real,dimension(1)::a
! real,dimension(n)::a
do i=1,n
a(i)=1+i
end do
end