主题:紧急求助:fortan动态数组出错。
vv是定义了一个动态数组。。。如下。其中的数据都合理的定义了 不是数据定义的问题
subroutine CONV_YITA()
integer*4::i,j
...
real*8,allocatable,dimension(:,:)::vv
...
call conv_schemes_po(i,jbeg+3,jend-3,methody(1,1))
...
return
contains
subroutine conv_schemes_po(i1,jbeg1,jend1,flag1)
implicit none
integer*4::jbeg1,jend1,flag1,i1
integer*4::m,kk,slbeg,slend,j1
real*8,dimension(1:4)::alpha
if(flag1.eq.301)then
slbeg=-2; slend=2
elseif(flag1.eq.303)then
slbeg=-3; slend=3
elseif(flag1.eq.305)then
slbeg=-4; slend=4
elseif(flag1.eq.411)then
slbeg=-1; slend=2
elseif(flag1.eq.413)then
slbeg=0; slend=2
elseif(flag1.eq.415)then
slbeg=-2; slend=0
elseif(flag1.eq.417)then
slbeg=-2; slend=1
elseif(flag1.eq.-1)then
return
endif
print*,"before",i1,jbeg1,jend1,flag1,slbeg,slend
allocate(vv(1:4,slbeg:slend))
print*,"after",i1,jbeg1,jend1,flag1,slbeg,slend
...
deallocate(vv)
return
endsubroutine
endsubroutine CONV_YITA
结果却是第一行打印可以打出结果 第二个print却打不出结果。
说什么 acess violation................