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

forrtl: severe (29): file not found, unit 89 ?! How to solve this error?

changks888
Beginner
7,800 Views

It seems the modified Makefile works right now. However, it generates another question/error message.

What is those two lines mean? What will be the direction to solve it? The original code just ransuccessfully under Compaq Fortran Compiler, but I encountered several problems in Intel fortran Compiler. Is that possible the FFLAG in Makefile causes this error?

Thanks.

forrtl: No such file or directory
forrtl: severe (29): file not found, unit 89, file /Users/cks/CNCLASS/fort.89


===I post the process and error message as below=========

kuo-hsien-changs-macbook-pro:CNCLASS cks$ make
ifort -O0 -real_size 64 -integer_size 64 -save -c Allometry.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c aprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c canadd.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c canalb.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c canvap.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c carbon.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c cgrow.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c chkwat.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c cianda.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classa.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classb.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classd.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classg.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classi.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classs.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classt.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c classw.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c commondat.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c cwcalc.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c diasurf.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c drcoef.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c flxsurfz.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c gatprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c gralb.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c grdran.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c grinfl.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c icebal.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c photosyn.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c precision.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c qsat.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c sldiag.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c sninfl.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c snoadd.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c snoalba.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c snoalbw.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c snovap.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c stomata.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c stomata_col.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c subcan.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tfreez.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tmcalc.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tmelt.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tnpost.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tnprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c trim_name.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tsolvc.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tsolve.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tspost.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c tsprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c twcalc.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c VegDyn.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c vjtmp.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c watrof.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c wend.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c wfill.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c wflow.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c wprep.F90
ifort -O0 -real_size 64 -integer_size 64 -save -c xit.F90
ifort -o runclass -O0 -real_size 64 -integer_size 64 -save Allometry.o aprep.o canadd.o canalb.o canvap.o carbon.o cgrow.o chkwat.o cianda.o classa.o classb.o classd.o classg.o classi.o classs.o classt.o classw.o commondat.o cwcalc.o diasurf.o drcoef.o flxsurfz.o gatprep.o gralb.o grdran.o grinfl.o icebal.o photosyn.o precision.o qsat.o sldiag.o sninfl.o snoadd.o snoalba.o snoalbw.o snovap.o stomata.o stomata_col.o subcan.o tfreez.o tmcalc.o tmelt.o tnpost.o tnprep.o tprep.o trim_name.o tsolvc.o tsolve.o tspost.o tsprep.o twcalc.o VegDyn.o vjtmp.o watrof.o wend.o wfill.o wflow.o wprep.o xit.o runclass.F90
kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass
1990 89
forrtl: No such file or directory
forrtl: severe (29): file not found, unit 89, file /Users/cks/CNCLASS/fort.89

Image PC Routine Line Source
runclass 000000010010A331 Unknown Unknown Unknown
runclass 00000001001093F4 Unknown Unknown Unknown
runclass 00000001000D4763 Unknown Unknown Unknown
runclass 000000010009ECCF Unknown Unknown Unknown
runclass 000000010009E47C Unknown Unknown Unknown
runclass 00000001000BC549 Unknown Unknown Unknown
runclass 0000000100074E89 Unknown Unknown Unknown
runclass 0000000100000B5C Unknown Unknown Unknown
runclass 0000000100000AF4 Unknown Unknown Unknown
kuo-hsien-changs-macbook-pro:CNCLASS cks$ ls fort*
fort.100
kuo-hsien-changs-macbook-pro:CNCLASS cks$


0 Kudos
6 Replies
TimP
Honored Contributor III
7,800 Views


kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass
1990 89
forrtl: No such file or directory
forrtl: severe (29): file not found, unit 89, file /Users/cks/CNCLASS/fort.89

I hope you are able to look at your own source code. My guess is that you fail to use OPEN to create the file for unit 89 , instead depending on the compiler run time to create a file, in a non-portable style of 35 years ago. Then you assume that a file will be created with the default naming convention of some past compiler, and you fail to use iostat to help your program to display a diagnosis. Even in that style, without help from the programmer, the user may have difficulty understanding the error when the program attempts to read from a non-existent file, the run time creates an empty file, and the read still fails. I don't believe there are compile command line flags to fix this.

0 Kudos
changks888
Beginner
7,800 Views
Quoting - tim18

I hope you are able to look at your own source code. My guess is that you fail to use OPEN to create the file for unit 89 , instead depending on the compiler run time to create a file, in a non-portable style of 35 years ago. Then you assume that a file will be created with the default naming convention of some past compiler, and you fail to use iostat to help your program to display a diagnosis. Even in that style, without help from the programmer, the user may have difficulty understanding the error when the program attempts to read from a non-existent file, the run time creates an empty file, and the read still fails. I don't believe there are compile command line flags to fix this.

Thanks Tim. You already point out the difficulty I suffered to run the whole program, such as the different user compiler, the background of programmer and users, and to understand the error. I have to think about any possibilities to make it works in this computer.

I look at the source code and only the main program entitled "runclass" has the "OPEN" setting and the unit number did not have 89 and even 100 which is thefort.100 crated after running "runclass".

kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass
1990 89
forrtl: No such file or directory
forrtl: severe (29): file not found, unit 89, file /Users/cks/CNCLASS/ fort.89

Is that possible that the I/O causes this problem?

In previous trials, I got this error message as below. The program seems to run. Because the error message was "forrtl: severe (174): SIGSEGV, segmentation fault occurred" so that I back to modify the Makefile. After solving this error, another error "file notfound, unit 89" came out. Based on youprogramming experiences, please feel free to advice more. It seems almost there, but I really need some helps. Thanks.

:
:
0
soil water balance error @ 1990 365 23 0
snow layer energy balance error @ 1990 365 23
30
1st soil layer energy balance error @ 1990 365 23
30
2nd soil layer energy balance error @ 1990 365 23
30
3rd soil layer energy balance error @ 1990 365 23
30
soil water balance error @ 1990 365 23 30
forrtl: severe (174): SIGSEGV, segmentation fault occurred

0 Kudos
Steven_L_Intel1
Employee
7,800 Views

To expand on what Tim said, the program is attempting to read from unit 89 but has not opened a file on that unit. What happens then is that a default filename of fort.89 is constructed and Fortran tries to open that file. It was not found.

To solve this, you will have to understand what the program is trying to do at this point and see where it should have opened unit 89. It's possible that the program was intended to be run with an environment variable defined to point to the input file, but that seems unlikely to me.

0 Kudos
changks888
Beginner
7,800 Views

To expand on what Tim said, the program is attempting to read from unit 89 but has not opened a file on that unit. What happens then is that a default filename of fort.89 is constructed and Fortran tries to open that file. It was not found.

To solve this, you will have to understand what the program is trying to do at this point and see where it should have opened unit 89. It's possible that the program was intended to be run with an environment variable defined to point to the input file, but that seems unlikely to me.

Hi Steve,

I was looking into the source code, but I did not find any open commend with unit 89. I also use the searching tool to go through each line contains "unit", however the unit "89" did not exist. One of users ran this code long time ago suggested that to check the Intel Fortran Compiler setting, because the source code itself output some error files but may not explicitly open it in the main program(runclass). I'm just wondering the Intel Fortran Setting might be the problem. The source code was designed under Compaq Fortran Compiler. How to set up a proper compiler environment for this source code?

Thanks again.

If Makefile contains "FFLAGS= -fp -i64 -real_size 64 -integer_size 64 -nosave", then the error message was:

kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass

1990 45

starting year .... 1990

forrtl: severe (174): SIGSEGV, segmentation fault occurred

Image PC Routine Line Source

runclass 000000010005FA57 Unknown Unknown Unknown

runclass 000000010005ECD0 Unknown Unknown Unknown

runclass 0000000100000ABC Unknown Unknown Unknown

runclass 0000000100000A54 Unknown Unknown Unknown

kuo-hsien-changs-macbook-pro:CNCLASS cks$

If the Makefile did not contains any flags, the the error message was:

kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass

1990 41

starting year .... 1990

1st soil layer energy balance error @ 1990 1 0

0

2nd soil layer energy balance error @ 1990 1 0

0

3rd soil layer energy balance error @ 1990 1 0

0

soil water balance error @ 1990 1 0 0

:

:

1st soil layer energy balance error @ 1990 365 23

30

2nd soil layer energy balance error @ 1990 365 23

30

3rd soil layer energy balance error @ 1990 365 23

30

soil water balance error @ 1990 365 23 30

forrtl: severe (174): SIGSEGV, segmentation fault occurred

Image PC Routine Line Source

runclass 000000010005EAC7 Unknown Unknown Unknown

runclass 000000010005DDA9 Unknown Unknown Unknown

runclass 00000001000009BC Unknown Unknown Unknown

runclass 0000000100000954 Unknown Unknown Unknown

kuo-hsien-changs-macbook-pro:CNCLASS cks$

with FFLAGS (FFLAGS= -O0 -real_size 64 -integer_size 64 -save)

kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass

1990 89

forrtl: No such file or directory

forrtl: severe (29): file not found, unit 89, file /Users/cks/CNCLASS/fort.89

Image PC Routine Line Source

runclass 000000010010A331 Unknown Unknown Unknown

runclass 00000001001093F4 Unknown Unknown Unknown

runclass 00000001000D4763 Unknown Unknown Unknown

runclass 000000010009ECCF Unknown Unknown Unknown

runclass 000000010009E47C Unknown Unknown Unknown

runclass 00000001000BC549 Unknown Unknown Unknown

runclass 0000000100074E89 Unknown Unknown Unknown

runclass 0000000100000B5C Unknown Unknown Unknown

runclass 0000000100000AF4 Unknown Unknown Unknown

kuo-hsien-changs-macbook-pro:CNCLASS cks$

0 Kudos
TimP
Honored Contributor III
7,800 Views

READ(89,....) is the same as READ(unit=89,....); likewise with WRITE and PRINT. We suggested that your problem stemmed from omission of an OPEN for unit 89.

0 Kudos
changks888
Beginner
7,800 Views
Quoting - tim18

READ(89,....) is the same as READ(unit=89,....); likewise with WRITE and PRINT. We suggested that your problem stemmed from omission of an OPEN for unit 89.

Dear all,

It works, if I did not use the the spinup option.(I guess.)

If I use the spinup up option, it will show the error message,forrtl: severe (174): SIGSEGV, segmentation fault occurred.


kuo-hsien-changs-macbook-pro:CNCLASS cks$ ./runclass
starting year .... 2002
starting year .... 2003
starting year .... 2004
starting year .... 2005
starting year .... 2006
starting year .... 2007

kuo-hsien-changs-macbook-pro:CNCLASS cks$

In the source code, program uses the rand() function to randomly choose the meteorological files for rewinding files.

:

:

!-----pre-running meteorological data

open(unit=41,file="TP39_met03_class.dat")

open(unit=42,file="TP39_met04_class.dat")

open(unit=43,file="TP39_met05_class.dat")

open(unit=44,file="TP39_met06_class.dat")

open(unit=45,file="TP39_met07_class.dat")

:

:

idfile = 40+int(rand()*4+1) !open file id = 41,42

rewind(unit=idfile) !rewinding the file to the first line

print *,iyear,idfile !for checking purpose

endif

I guess that might be the reason based on the following link. What do you think? Please advice me! Thanks.

http://software.intel.com/en-us/articles/intel-fortran-compiler-using-rand-and-random-portability-functions-avoid-segv

0 Kudos
Reply