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

Unit number in open statement?

harry27606
Beginner
617 Views
Hello, everyone. My name is Harry Kim, and I am working on modifying a pre-made Fortran Program. I got stuck on 'unit number' in an open statement for 3 days.
in my source file... I found a open statement like below.
---------------------------
c define unit number
item = 14
c open file containing temperature data
open(item,file=prefix(:l_prfx)//'.tem',status='old')
---------------------------
I am trying to make a new data file (*.chm) and read data the same way as above.I made new variables (ichm) for new unit number, andwrotethe same. However, my programcannot read my new data file.
WhatI want todo nowis tocheck the unit number of my new variable (ichm) and designate it before the open statement.
I foundsome other unit numbers...
item = 14
ibcvs = 15
isoi = 16
However,I cannot find unit 1~13. So... I just tried 'ichm = 17'and'ichm = 18', but there was no difference.
Please let me know if anyonehas any suggestions for this problem. Thanks.

Message Edited by Harry27606 on 07-07-2004 01:14 AM

0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
617 Views
Unit number will not make any difference, as long as it is unique.
The error most likely lies in discrepancy of the format of the actual file and the way you're reading it. What is the error message?
Jugoslav
0 Kudos
harry27606
Beginner
617 Views
As you mentioned, there was no error. The problem is that my program doesn't read my data file. Mmm... Then, there is no problem on my unit number.
O.K.! I will check my source file again. Thank you, Jugoslav.
0 Kudos
Reply