fortran - Error in compiling: Can't open module file -
i have code:
program xfit ! driver routine fit use nrtype; use nrutil use nr use ran_state, : ran_seed implicit none integer(i4b), parameter :: npt=100 real(sp), parameter :: spread=0.5_sp integer(i4b) :: mwt real(sp) :: a,b,chi2,q,siga,sigb real(sp), dimension(npt) :: harvest,sig,x,y call ran_seed(sequence=731) x(:)=arth(0.1_sp,0.1_sp,npt) call gasdev(harvest) y(:)=-2.0_sp*x(:)+1.0_sp+spread*harvest sig(:)=spread mwt=0,1 if (mwt == 0) write(*,'(//1x,a)') 'ignoring standard deviation' call fit(x,y,a,b,siga,sigb,chi2,q) else write(*,'(//1x,a)') 'including standard deviation' call fit(x,y,a,b,siga,sigb,chi2,q,sig) end if write(*,'(1x,t5,a,f9.6,t24,a,f9.6)') 'a = ',a,'uncertainty: ',& siga write(*,'(1x,t5,a,f9.6,t24,a,f9.6)') 'b = ',b,'uncertainty: ',& sigb write(*,'(1x,t5,a,4x,f10.6)') 'chi-squared: ',chi2 write(*,'(1x,t5,a,f10.6)') 'goodness-of-fit: ',q end end program xfit
but when compile following error
use ran_state, : ran_seed 1 fatal error: can't open module file 'ran_state.mod' reading @ (1): no such file or directory
could please tell me how can solve it?
i've seen same error when built this:
gfortran test.f90 -o test.exe
use modulename
1
fatal error: can't open module file 'modulename.mod' reading @ (1): no such file or directory
say modulename.mod @ /usr/local/include
and dependencies @ /usr/local/lib
you can make errors go away the following:
gfortran test.f90 -o test.exe -i/usr/local/include -l/usr/local/lib
Comments
Post a Comment