本帖最后由 hang719 于 2014-10-31 15:30 编辑  
 
我写了个简化版的。 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode module  Test
    implicit none
    integer::n
contains
subroutine Set_n
    implicit none
    n=3
end subroutine
subroutine  Allocate_memory
    implicit none
    real(kind=8),allocatable::array(:)
    
    allocate(array(n))
    
    array(:)=1.0
    
    write(*,*)   array(1),array(2),array(3)
    
end subroutine
end module
program main
    use Test
    implicit none
    call Set_n
    call Allocate_memory
    
end program
 
 
断点设置在这里,这个是调试显示结果,数组显示undefined pointed/array。 
 
 
 
但是输出结果是对的。 
 
 
 
 
 
 |