顶顶⁵²⁰� 发表于 2019-10-28 22:08:11

初学者 有个问题想请教一下

module global
implicit none
contains
   subroutine fun(a)
    real a(:,:)
    a = 3
   End subroutine
end module

Program www_fcode_cn
Implicit None
real a(3,2)
useglobal
Write (*, '(6f3.0)') a
end program
错误
Error: USE statement at (1) cannot follow data declaration statement at (2)
提示错误在use上 改了好久不知道怎么办呢

fcode 发表于 2019-10-28 22:40:36

use 语句要在程序单元的最上面


module global
implicit none
contains
   subroutine fun(a)
    real a(:,:)
    a = 3
   End subroutine
end module

Program www_fcode_cn
useglobal
Implicit None
real a(3,2)
Write (*, '(6f3.0)') a
end program

顶顶⁵²⁰� 发表于 2019-10-29 11:54:55

fcode 发表于 2019-10-28 22:40
use 语句要在程序单元的最上面




谢谢:-lol
页: [1]
查看完整版本: 初学者 有个问题想请教一下