我正在尝试编写代码并定义一个我需要运行 MRQMIN 子例程的函数
program mrqmin
!ifort mrqmin.f90 module_cosmo.o gaussj.o covsrt.o nrtype.o nrutil.o nr.o -o mrqmin
implicit none
integer i,b,ok
double precision,dimension(:),allocatable :: a,Nrow,iz,Nbin,fi,fiStdDev,fiAvr,Magbin,zup
double precision,dimension(:),allocatable :: fiStdDev2,RfiStdDev2,fi_expected,DFI,CHISQ
double precision fi_star,alpha,M_star
open(1,file='new.asc')
b=14
! Ln10=2.3025
A=0.4*2.3025
do I=1,b
read (1,*) Nrow(I),iz(I),Nbin(I),fi(I),fiStdDev(I),fiAvr(I),Magbin(I),zup(I)
fiStdDev2(I)=fiStdDev(I)*fiStdDev(I)
RfiStdDev2(I)=1/fiStdDev2(I)
write(*,*)fiStdDev2(I),RfiStdDev2(I)
fi_expected(I)=A*fi_star*10**(0.4*(alpha+1)*(M_star-Magbin(I)))*exp(-10**(0.4*(M_star-Magbin(I))))
DFI(I)=fi_expected(I)-FI(I)
CHISQ(I)=DFI(I)*DFI(I)*RfiStdDev2(I)
end do
deallocate(a,Nrow,iz,Nbin,fi,fiStdDev,fiAvr,Magbin,zup,fiStdDev2,RfiStdDev2,fi_expected,CHISQ,DFI)
end program mrqmin
但我收到错误:数组表达式的形状不符合。[FI_EXPECTED]
如果我在其他代码中使用了具有相同形状的这个函数但我没有遇到问题,我可以理解我的错误在哪里?