It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
For university I have to write a Fortan 90 programm for practicing, I know how to make the calculation but I don't know how to read the values from the file (not a text file) , the script is hard to understand in that point And I'm unable to contact our prof about it.

The full task is this:
In the file find several shots of measurements
written using the following scheme

Date

#_of_Points_per_Shot #_of_Shots

Temperature

x(1) y(1)

x(2) y(2)

...

x(#_of_Points_per_Shot) y(#_of_Points_per_Shot)

Temperature

x(1) y(1)

x(2) y(2)

...

x(#_of_Points_per_Shot) y(#_of_Points_per_Shot)

Temperature

......

Please determine the respective averages of the y-values of each of the shots.
Post edited May 08, 2016 by JinKazaragi
When I was young, about 8 my Dad bought us a ZX81. Once he realised I had an interest and aptitude in computers he tried to nurture it. One of the things he was able to acquire was a set of 5 Fortran manuals. As a truck driver I have no idea where he got these from.

Anyway these where massive leather bound volumes, that would have been happy to be placed next to the Necronomicon or King in Yellow.

Unfortuantely I don't remember its contents.
It isn't really our place to do homework and FORTRAN is a bit old, even for GOG. The oldest game on GOG is Alkabeth, released in 1980, and Fortran 90 is as old as I am. Not that the latest FORTRAN standard is much newer, being over 8 years old at this point.

Is there even a market for FORTRAN in Germany? I thought international standards disallowed the use of archaic machine and code.
I might have been able to help with Pascal, but even there I'd have to jog my memory.

My big brother probably knew COBOL and FORTRAN, but probably he has forgotten them already as well.
avatar
Darvond: It isn't really our place to do homework and FORTRAN is a bit old, even for GOG. The oldest game on GOG is Alkabeth, released in 1980, and Fortran 90 is as old as I am. Not that the latest FORTRAN standard is much newer, being over 8 years old at this point.

Is there even a market for FORTRAN in Germany? I thought international standards disallowed the use of archaic machine and code.
You would be disturbed to know how many ancient systems are critical to most banking and government groups.
avatar
mechmouse: You would be disturbed to know how many ancient systems are critical to most banking and government groups.
Bu-Bu-But Germany, land of efficiency and strict standards?
avatar
Darvond: It isn't really our place to do homework and FORTRAN is a bit old, even for GOG. The oldest game on GOG is Alkabeth, released in 1980, and Fortran 90 is as old as I am. Not that the latest FORTRAN standard is much newer, being over 8 years old at this point.

Is there even a market for FORTRAN in Germany? I thought international standards disallowed the use of archaic machine and code.
This is the only forum I'm a member of I could think of where I might find someone who could help me.

And of course I don't want a complete solution I only want to know how to get the values into the variables one by one without choosing them manually so I can use a loop which makes the whole calculation automatically, the exercise is only the main reason for my question.

FORTRAN is still often used by physicists because it's easy to make highly complex calculations with it at a rather high speed which is why we have to learn it.
avatar
mechmouse: You would be disturbed to know how many ancient systems are critical to most banking and government groups.
avatar
Darvond: Bu-Bu-But Germany, land of efficiency and strict standards?
If it ain't broke, don't fix it. Specially when the guy that made it died of old age 10 years ago!
avatar
mechmouse: If it ain't broke, don't fix it. Specially when the guy that made it died of old age 10 years ago!
But that machine uses a power connector and rating that hasn't been made in 15+ years and will be unserviceable if one of the many moving parts breaks! Not to mention, that replacing it would probably really cut down on the power bill and other expenses. Think of the long term investment!
I'm not a FORTRAN programmer myself, but this sounds like such an entry-level assignment that I'd be surprised if you couldn't find everything you need to know on Google within about 15 minutes. Look for some I/O tutorials and Stack Overflow discussions.

Searching for "fortran 90 read from file" gave me this page as the first result. You need to use the open() and read() functions.
avatar
Darvond: It isn't really our place to do homework and FORTRAN is a bit old, even for GOG. The oldest game on GOG is Alkabeth, released in 1980, and Fortran 90 is as old as I am. Not that the latest FORTRAN standard is much newer, being over 8 years old at this point.

Is there even a market for FORTRAN in Germany? I thought international standards disallowed the use of archaic machine and code.
avatar
JinKazaragi: This is the only forum I'm a member of I could think of where I might find someone who could help me.

And of course I don't want a complete solution I only want to know how to get the values into the variables one by one without choosing them manually so I can use a loop which makes the whole calculation automatically, the exercise is only the main reason for my question.

FORTRAN is still often used by physicists because it's easy to make highly complex calculations with it at a rather high speed which is why we have to learn it.
A quick google shows plenty of tutorials, manuals etc. You will probably find communities out there which still use it. Afraid I have not even heard of the language in over 25 years, even hardcore users moved of of it onto matrix languages. Try SAS IML for instance.
Here's a tutorial on reading / writing files: [url=http://www.math.hawaii.edu/~hile/fortran/fort7.htm]link[/url].

You should really learn to do this by yourself, unless you're preparing for a career in type theory.
avatar
hyperagathon: Here's a tutorial on reading / writing files: [url=http://www.math.hawaii.edu/~hile/fortran/fort7.htm]link[/url].

You should really learn to do this by yourself, unless you're preparing for a career in type theory.
Thanks for the link, I was looking for something like that.
Sometimes I seem to be too stupid to find a good tutorial.