Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-02-2004, 03:59 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 20

Rep: Reputation: 0
g77 Fortran - run time error (fmt: read unexpected character)


I am working with a set of Fortran programs which compile and work well in VMS, UNIX and Windows (using Compaq Visual Fortran compiler). Unfortunately, when I compile it in Linux v. 9.0 using g77, it gives me the following run time error:

fmt: read unexpected character
apparent state: unit 70 named icp.pdt
last format: (1P, 5E15.4)
lately reading sequential formatted external IO

I have tried the following:

1. Changed the optimization from -O4 to -O2:

The program proceeds further but quits after a longer time.

2. Changed to debug mode (with -g option):

Still no change (gives the same output.

3. Included -fno-unroll-loops in the compile option

No effect.

I am using the following compile options:

-ffast-math -fargument-noalias -fno-automatic -finit-local-zero -fno-globals -fno-unroll-loops

I did do a search on this Forum as well as in Google. The general response is that this is a result of g77 compiled codes not being able to read external unformatted input. But, the code should be able to read it's own unformatted outputs.

Any help, hint or pointers would be greatly appreciated.

Thanks in advance for your time and help,

Old 08-16-2006, 07:07 AM   #2
LQ Newbie
Registered: Aug 2006
Posts: 25
Blog Entries: 1

Rep: Reputation: 18
Is the code actually F77, or is the compaq compiler nearer Fortran 95, in which case you want to compile with either the gfortran or g95 compilers / libraries. The debugging flag (-g) won't have any effect until you run your program under gdb, at which point you will be able to catch the error and step through the code to find where the problem is.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
fortran debugging question with g77 and gdb miasmak Programming 1 08-16-2006 07:03 AM
Fortran compiler gcc-g77 installation problem refp16 Linux - Software 6 11-26-2005 12:49 PM
compile( gcc-g77) fortran with fedora core 3 gambato79 Programming 1 05-06-2005 12:49 PM
G77 Fortran included in Fedora 2 ? aeslin Linux - Software 1 11-08-2004 07:27 AM
Need help defining Fortran 77 input/output streams using g77! Gethyn Programming 1 08-14-2003 12:42 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration