|
[Sponsors] |
Fortran 'list-directed I/O syntax error' (KIVA 3V) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 28, 2009, 12:29 |
Fortran 'list-directed I/O syntax error' (KIVA 3V)
|
#1 |
New Member
Robert C
Join Date: Jun 2009
Location: London, UK
Posts: 16
Rep Power: 17 |
Hi all, I've been given KIVA 3V code to get familiar with.. Being relatively new to Fortran and CFD, it's been a challenge getting this to run on OS X (using ifort 11)
Anyway, I'm having problems getting kiva to read itape5, this is the specific error: Code:
forrtl: severe (59): list-directed I/O syntax error, unit 5, file /Users/rob/Desktop/kiva/kiva/itape5 Code:
read ( 5,*) id(1),(presi(n),n=1,nreg) write(12,*) ' presi ',(presi(n),n=1,nreg) read ( 5,*) id(1),(tempi(n),n=1,nreg) write(12,*) ' tempi ',(tempi(n),n=1,nreg) Code:
nreg 1 presi, 4.9e+6 tempi, 500.0 tkei, 0.1 scli, 0.0 Anyone have any ideas how to debug this? Thanks! |
|
June 28, 2009, 21:17 |
|
#2 |
New Member
Ananda Himansu
Join Date: Apr 2009
Location: Cleveland, Ohio, USA
Posts: 17
Rep Power: 17 |
It would appear that either (a) you put quotation marks (single or double) to delimit the words "nreg", "presi", "tempi", etc. in your input file itape5, assuming id(1) has been declared to be of type character, or (b) you change the read statement to a formatted read (instead of list-directed) and use the "a" format for the names. However, it is a mystery to me how you succeeded in reading the "nreg 1" line. Perhaps the commas play a role and id(1) is declared of type integer?
|
|
June 29, 2009, 18:04 |
|
#3 |
New Member
Robert C
Join Date: Jun 2009
Location: London, UK
Posts: 16
Rep Power: 17 |
Thanks for the response.. What's most interesting, is I cannot duplicate the problem outside of KIVA.
I've made a test program using relevant snippets from kiva.. The following program works: Code:
program readtest character *8 id(4) c integer nreg c double precision presi(10), tempi(2) common /scrhoi/ nreg common /scrhor/ er(3),presi(3),tempi(2) open(unit=5, file='test') open(unit=12,file='out_test') read ( 5,600) id(1),nreg read ( 5,*) id(1),(presi(n),n=1,nreg) write(12, *), ' presi ',(presi(n),n=1,nreg) read ( 5,*) id(1),(tempi(n),n=1,nreg) write(12, *) ' tempi ',(tempi(n),n=1,nreg) 600 format(a8,i5) end program readtest The program above has no problem reading the following file: Code:
nreg 1 presi, 4.9e+6 tempi, 500.0 tkei, 0.1 scli, 0.0 |
|
June 29, 2009, 20:41 |
|
#4 |
New Member
Ananda Himansu
Join Date: Apr 2009
Location: Cleveland, Ohio, USA
Posts: 17
Rep Power: 17 |
The fact that your mini-program "readtest.f" works and executes without error does not mean that it conforms to the Fortran standard. Notice that in your mini-program (and presumably in the KIVA read statement that you left out), the character string nreg is read using an "a" format in the format statement labeled 600. That is why KIVA does not bomb out on that line, but rather on the next line. When you run "readtest.f", try writing out id(1) after each read statement.
Try running your mini-program "readtest.f" on an altered input file "test" which contains the lines nreg 1 'presi', 4.9e+6 'tempi', 500.0 'tkei', 0.1 'scli', 0.0 |
|
June 30, 2009, 04:26 |
|
#5 |
New Member
Robert C
Join Date: Jun 2009
Location: London, UK
Posts: 16
Rep Power: 17 |
Ah, thanks a lot Ananda.. If only I would have listened to you yesterday!
Putting quotes around 'presi', etc got kiva working. Thanks again. |
|
June 30, 2009, 07:59 |
|
#6 |
New Member
Ananda Himansu
Join Date: Apr 2009
Location: Cleveland, Ohio, USA
Posts: 17
Rep Power: 17 |
You are welcome, Robert. Some compilers are forgiving, but the resulting non-conforming code is not portable to other compilers. However, this particular error was an input format error rather than a syntax error, and so I do not know whether setting a "strict conformance" flag on the compiler would have caused "readtest.f" to object to the original "test" input file.
|
|
May 28, 2011, 19:20 |
kiva 3V.2x
|
#7 |
New Member
habib
Join Date: May 2011
Posts: 5
Rep Power: 15 |
I'm looking for the kiva 3V.2x code for editing and I'm very gratful if i will receive it.
I work on internal combustion for optimization of chamber...thanx |
|
June 11, 2013, 13:09 |
|
#8 |
New Member
Javier
Join Date: Jun 2013
Posts: 1
Rep Power: 0 |
Hi Robert,
I'm having a problem with Kiva 3v, I had the code running and I made the first simulation with no problem... but now I want to do the next simulation and for that purpose I've modified some parameters in the ITAPE5 (such as rpm, fuel mass, etc.) and after that when I try to run the simulation this error appears... (I don't know why, I mean, I just changed a few numbers from the initial ITAPE5) "dofio: [1015] Unknown error logical unit 5, named 'itape5' lately: reading sequential formatted external IO part of last data: v 0.0 ^M|^J ca Abort (core dumped)" Can you please help me? Thanks |
|
Tags |
fortran, kiva |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Comparison between C/C++ and Fortran? | rick | Main CFD Forum | 45 | September 6, 2011 01:52 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |