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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how compile this .for program ion windows seven 2

Status
Not open for further replies.

ppippus

Programmer
Mar 20, 2012
8
IT
Hi for everyone

I have a problem to compile this program (attachement)
I have tried with g77 on windows seven but this compuiler does not work....
The platform indicated for this software (1971)are:
Platform: CDC, Scope, FTN4 (60 bit single precision)

can you help me to compile this program?

thanks

ppippus
 
It seems, thet posting the whole source (cca 45 kB) isn't possible :-(
 
I replaced the formatted read in SUBROUTINE LOAD with unformatted
read:
Code:
C     READ (5,1004) (AC(I),I=1,NUCAR)
      read (5,*) (AC(I),I=1,NUCAR)

Both reads are formatted, but the latter is list directed formatting, that is the prog selects a proper format for the datatype in the list.

A human would not be able to read a printout of an unformatted file.

Norbert



The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Ok gummibaer,
But would you know, how to place the numbers in a file if one wants to use the above specified format 1004 ?
 
No, no, reading these data in list directed input as you proposed is the perfect thing to do. In fact, explicit input formatting does not make much sense to me - this is a thing of the past - except maybe in some cases with character strings.

I would be very thankful, if someone could explain how the above numbers should be formatted in a text file, so we would be able to read them with the above formatted read statement.

But if you want to use explicit input formats then

(1) make sure you specify the field width with a bigger number than actual digits are present in the inputfile. Then Fortran adapts the field width to the numbers in the file.

(2) Set the number of fractional digits to 0. Fortran adapts the number of decimal digits to the actual position oof the dot. But if there is no dot present in the input the results can be confusing. Then Fortran sets the number of decimal digits to the number given in the format.
12345 in a format f10.3 would read as 12.345
12345. in a format f10.3 would read as 12345.0
1.2345 in the same format would read 1.2345

(3) You should place the format in inner brackets so that fortran repeats this format as often as items are in the inputlist.

So the format would be

1004 format ((f20.0))

or including it in the read statement

read (5, '((f20.0))') (AC(I),I=1,NUCAR)

But having this done and having spent some brain you achieved what you get more easily avoiding a lot of possible pitfalls by coding

read (5, *) (AC(I),I=1,NUCAR)


Norbert

The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top