CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   Why I can't read one external file? (https://www.cfd-online.com/Forums/siemens/53734-why-i-cant-read-one-external-file.html)

Lee March 30, 2004 17:35

Why I can't read one external file?
 
Dear all,

I tried to read some external filw which includ the pressure data in the subroutine 'bcdefp.f'by using the command 'read', but I found I coulnd't read that external file and couldn't run the model, Star always gives a wrong message, like

list in:end of file -1 apparent state: unit 16 named ***file.dat last format:list io unit 16 is a sequential formatted external file Excution terminated

I put the external file in the same fold as bcdefp.f as well as in the folder in which .mdl etc. files are

So how can I solve this problem? I have to use that pressure data file and I am eager to solve that problem.

Thank you very much for your regards!

Lee


steve March 30, 2004 18:57

Re: Why I can't read one external file?
 
Either you forgot to use an "open" statement before your read or you are not reading the data with the same format its written in.

Lee March 30, 2004 19:14

Re: Why I can't read one external file?
 
Anyway, thank you very much, Steve!

But I have to point out that I really used the command 'open' to open that file and I used the same format to read it as the format that file was written in.

I don't know what's the reason to cause that problem.

Jörn Beilke March 31, 2004 00:58

Re: Why I can't read one external file?
 
Write a small fortran program which reads the file and prints the values on the screen. Once this is working put that coding in the subroutine.

dan April 1, 2004 05:18

Re: Why I can't read one external file?
 
but how to execute that subroutine in starcd? As per my impression only star subroutines which are defined by their names are executed in prostar.

yacine April 1, 2004 06:17

Re: Why I can't read one external file?
 
it sound like you have a small problem in reading you data reading. a simple, yet very powerfull tools for debugging is read few lines and print them on the sreen with:

write(*,*)

you can also use the command STOP

the error "ends..." you getting means that the Nbre of cells you trayng to read NCELL in the loop is bigger than the lines in your file (or some thing in this sence)


Steve April 1, 2004 07:45

Re: Why I can't read one external file?
 
What file unit did you use to open your file? Maybe it's one already used by STAR-CD.

Philip Jones April 2, 2004 12:25

Re: Why I can't read one external file?
 
I would be cautious in using low unit numbers. The safe units are 80 and above, 16 can be used by the code for various stuff

Philip


All times are GMT -4. The time now is 01:21.