不知道你怎么弄的,反正我这没问题
[Fortran] 纯文本查看 复制代码 MODULE module_defi_Val
Integer :: iVal
Contains
Subroutine setValue()
Implicit None
iVal = 2
Return
End Subroutine setValue
End MODULE module_defi_Val
!*****************************************************************************!
MODULE module_defi_array
Use module_defi_Val
IMPLICIT NONE
REAL(kind=8),allocatable :: x(:)
CONTAINS
Subroutine allocateArray()
Implicit None
Allocate( x(iVal) )
x = 1
Return
End Subroutine allocateArray
End MODULE module_defi_array
!*****************************************************************************!
Program www_fcode_cn
Use module_defi_Val
Use module_defi_array
Implicit None
call setValue
call allocateArray
write(*,*) x
Stop
End Program www_fcode_cn |