【发布时间】:2018-01-09 17:13:20
【问题描述】:
我想知道下面的代码是否合法:
module my_mod
contains
subroutine my_outer_sub(a)
integer, intent(in) :: a
call my_inner_sub()
contains
subroutine my_inner_sub()
a=3 ! this compiles and runs!
end subroutine my_inner_sub
end subroutine my_outer_sub
end module my_mod
我使用 PGI 17.4 编译了代码。我一直在模块子例程中使用包含子例程,现在我想知道这个方案是否合适?
【问题讨论】:
标签: module fortran contains subroutine