代码:
double precision maxstress(w)
real, dimension(:), allocatable, save :: han(w)
integer jang(w)
do i=1,nblock
if(maxstress(i) . gt. 1000) then
jang(i) =1
han(i) = han(i) + 1
else
jang(i) =0
endif
write(*,*) "jang", i, jang(i)
write(*,*) "han", i, han(i)
enddo
给出错误信息:
findnode2.for(47): error #6646: ALLOCATABLE or POINTER attribute dictates a deferred-shape-array [HAN]
real, dimension(:), allocatable, save :: han(w)
-----------------------------------------------^
从这段代码中,我需要制作静态变量han
,但会出现错误 #6646。
我需要做什么?