Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

forrtl: severe (29): file not found

milenko1976
Beginner
3,473 Views
I have problem because it can not find file:
forrtl: severe (29): file not found, unit 8, file /home/milenko/mt2ddib/fort.8

program main
c
include 'params.dat'
c
integer*2 iho2,imi2,ise2,ihu2
character fexpdat*200,fmodel*200,yesno*1
logical*4 laccept,scam_accept
c
c
open(2,file='fexp.dat',status='unknown')
open(8,file='fmodel.dat',status='unknown')
c
read(8,*)n,m,ma
n1=n-1
m1=m-1
read(8,*)(sy(i),i=1,n1)
read(8,*)(sz(i),i=1,m1)
Why?
0 Kudos
4 Replies
Kevin_D_Intel
Employee
3,473 Views

Can you post "ifort -V" output to show us which compiler you have?

Where is fmodel.dat relative to the executable?

0 Kudos
mecej4
Honored Contributor III
3,473 Views
I don't think that you have shown the relevant part of the source code.

The I/O error message indicates that a read from unit-8 with an implicit OPEN (since the name is fort.8, rather than model.dat) was attempted before the file was opened.

Can you explain the reasons for opening an input file with status='unknown'? Do you know the consequences of doing so?
0 Kudos
milenko1976
Beginner
3,473 Views
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
I tried also with status='old' get the same problems.I have used unknown with my previous program without any problems,then just followed here same way.I am now putting wholw programme:
program main
include 'params.dat'
integer*2 iho2,imi2,ise2,ihu2
character fexpdat*200,fmodel*200,yesno*1
logical*4 laccept,scam_accept
c
open(2,file='fexp.dat',status='unknown')
open(8,file='fmodel.dat',status='unknown')
c
read(8,*)n,m,ma
n1=n-1
m1=m-1
read(8,*)(sy(i),i=1,n1)
read(8,*)(sz(i),i=1,m1)
syy(1)=0.
do i=1,n1
syy(i+1)=syy(i)+sy(i)
enddo
szz(ma)=0.
do i=ma,m1
szz(i+1)=szz(i)+sz(i)
enddo
do i=ma-1,1,-1
szz(i)=szz(i+1)-sz(i)
enddo
do i=1,ma-1
do j=1,n1
ic(i,j)=1
enddo
enddo
do i=ma,m1
read(8,*)(ic(i,j),j=1,n1)
enddo
icd=1
res(icd)=-1.
cond(icd)=0.
ivar(icd)=0
read(8,*)nc
nc=nc+1
do i=2,nc
read(8,*)icd,res(icd),ivar(icd)
if(res(icd).le.0.)then
cond(icd)=0.
else
cond(icd)=1./res(icd)
endif
enddo
close(8)
c
read(2,*)np
read(2,*)(per(i),i=1,np)

c
call solve_mt2d_direct
c
stop
end
c
c
0 Kudos
Kevin_D_Intel
Employee
3,473 Views

That is still not the complete program but the situation is as mecej4 described earlier.

I verified with a smaller test case that the compiler you have functions properly and as mecej4 suggested. Somehow within the actual source you compiled unit 8 is not opened and associated with model.dat, therefore, the I/O runtime defaults to looking for fort.8. You might double check that you actually compiled the same source that you showed here.

You could also place an INQUIRE statement at various positions within the program you showed and inquire by filename model.dat with the OPENED specifier or unit number8with the NAME specifier.

0 Kudos
Reply