Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Fortran help

Status
Not open for further replies.

73NOVA

Technical User
Jul 30, 2008
3
US
I am using GNU's g77 compiler to ressurect an old Fortran 77 program. When I try to compile it I receive the following error(s):


------------------------------------------------------------

fltsat.f: In block-data `_BLOCK_DATA__':
fltsat.f:5:
include BLKDAT.CMN
^
Invalid form for INCLUDE statement at (^)
fltsat.f:6:
include CMNDNO.CMN
^
Invalid form for INCLUDE statement at (^)
fltsat.f:7:
include INITL.CMN
^
-----------------------------------------------------

Any idea on why it doesn't like the .cmn extension???
Thank you
 
Put the include files in primes
Code:
      include 'CMNDNO.CMN'
 
That worked to remove that warning/error... now I am getting one talking about Padding. So I understand that it is saying there needs to be 3bytes (24bits) of 'padding' before 'blkovr' in the common line... but what exactly does this mean? I can not find anything on it in the pdf programmers guide that I have... or through google.
Again, the error is presented below:

---------------------------------------------------------
KEYBOARD.CMN:5: warning:
common /KEYBOARD/ AUTOSAFE,BELL,BLKOVR,BLOCK
^
Padding of 3 bytes required before `blkovr' in common b
consider reordering members, largest-type-size first
---------------------------------------------------------
 
This is probably something to do with alignment. It is something like this. Say you have a common block declaration like
Code:
      REAL aaa
      INTEGER bbb
      CHARACTER*1 ccc, ddd
      COMMON /eek/ ddd, aaa, ccc, bbb
This will give the same sort of error because ccc and ddd only takes up 1 byte and both aaa and bbb need to begin on a word boundary.

To fix it, rearrange the ones which need to go on word boundaries first
Code:
      COMMON /eek/ aaa, bbb, ccc, ddd

You need to look at your declarations to see which ones need to go first. At a guess, if you put BELL last, it will fix the problem. You need to do this in all the common blocks where BELL occurs.
 
I ended up getting rid of all but one of those warnings, it's now stating:

************************************************************
CMNDNO.CMN:5: warning:
common /CMNDNO/AVCSAD,AVCSD,BLOCK,CREN,CWCG,EPOR,ILLCMD,KD,
^
Initial padding for common block `cmndno' is 1 byte at (^) -- consider reordering members, largest-type-size first
************************************************************

The problem I am now having is that CMNDNO only appears twice as stated above. I don't know how I would reorder this. Any ideas?

Also, I am getting a warning that my "SAVEIT" is there anyway of using an option to ignore the warning and allow it to compile?

************************************************************
SAVEIT.CMN:3: warning:
common /SAVEIT/ ISAV,NVARS,SAVNAMS(50),SAVDAT(50000),
^
Initialization of large (200572-unit) aggregate area `saveit' at (^) currently very slow and takes lots of memory during g77 compile -- to be improved in 0.6
************************************************************
 
Problem 1:
What it means is that the stuff is word aligned so if you have some combination like

byte, word, byte, double word

You can arrange it like

word, double word, byte, byte

or, as recommended

double word, word, byte, byte

Problem 2
Not much you can do about this. 50000 reals takes up appx 200K. You could try using gfortran or g95 to compile it. They are better F77 compilers and may not complain as much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top