主题:求助~~IVF+IMSL 变量k赋值以后,发现运行中一直在变啊?
在do之前我赋了值的啊 ,怎么看不见了啊? 用鼠标选择一下就可以看到了
program main
include 'link_fnl_shared.h'
use imsl_libraries
implicit none
integer:: i,j,m,SARL,ct
real:: R(100000),Rstar(100000),Y,x,varR,meanR,Rrank,k,Z,ARL,limit,func
k=0.5
ct=ct+1
m=5000
SARL=0
limit=3
do j=1,m
i=0
Z=0
do while(Z<limit)
call drnnor(1,x)
i=i+1
R(i)=x
Rrank=count(R(1:i)<x)+1
meanR=(i+1)/2.0
if(i==1)then
varR=0
Rstar(1)=0
else
varR=(i+1)*(i-1)/12.0
Rstar(i)=(Rrank-meanR)/varR**0.5
end if
Z=max(0.0,Z+Rstar(i)-k)
end do
SARL=SARL+i
write(*,*)k
end do
ARL=SARL/real(m)
func=ARL-400
write(*,*)ct,ARL,func
stop
end
program main
include 'link_fnl_shared.h'
use imsl_libraries
implicit none
integer:: i,j,m,SARL,ct
real:: R(100000),Rstar(100000),Y,x,varR,meanR,Rrank,k,Z,ARL,limit,func
k=0.5
ct=ct+1
m=5000
SARL=0
limit=3
do j=1,m
i=0
Z=0
do while(Z<limit)
call drnnor(1,x)
i=i+1
R(i)=x
Rrank=count(R(1:i)<x)+1
meanR=(i+1)/2.0
if(i==1)then
varR=0
Rstar(1)=0
else
varR=(i+1)*(i-1)/12.0
Rstar(i)=(Rrank-meanR)/varR**0.5
end if
Z=max(0.0,Z+Rstar(i)-k)
end do
SARL=SARL+i
write(*,*)k
end do
ARL=SARL/real(m)
func=ARL-400
write(*,*)ct,ARL,func
stop
end