PDA

View Full Version : need help in doing a program in fortran77


qadi77
Sep1-09, 02:07 PM
I need to do this program, I'll be greatful for any one that can help me. the program is as this:

The following data are obtained from the file ‘JBWEA.DAT’. It contains the twenty-four hourly average air temperatures for the months of January through December, recorded at an airport.

Hour Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1 23.0 22.7 23.7 23.9 24.1 24.9 23.9 23.7 23.9 23.9 24.2 23.7
2 22.9 22.4 23.4 23.8 23.9 24.7 23.7 23.5 23.7 23.7 24.1 23.5
3 22.8 22.2 23.3 23.6 23.7 24.5 23.4 23.3 23.5 23.6 23.9 23.5
4 22.6 22.0 23.0 23.5 23.5 24.3 23.2 23.1 23.3 23.4 23.7 23.4
5 22.5 21.8 22.9 23.3 23.4 24.2 23.0 23.0 23.2 23.3 23.6 23.3
6 22.5 21.6 22.7 23.2 23.3 24.0 23.0 22.9 23.1 23.1 23.5 23.3
7 22.6 21.9 23.2 23.8 24.1 24.6 23.5 23.3 23.6 23.9 24.3 23.9
8 24.1 24.3 25.4 26.0 26.3 26.8 25.5 25.2 25.5 26.3 26.1 25.3
9 25.7 27.0 28.1 28.5 28.6 28.8 27.8 27.7 27.9 28.8 28.1 27.2
10 26.6 28.9 29.7 30.0 29.9 30.2 29.2 29.0 29.5 30.1 29.2 28.2
11 27.5 30.1 30.7 31.1 30.5 31.1 29.6 29.3 30.1 30.7 30.0 29.0
12 27.9 31.0 31.4 31.3 30.4 31.3 30.0 29.7 30.3 30.6 30.5 29.7

Note: Hour 1 = 1 AM, 2 = 2 AM,………………, 24 = midnight.

Write a FORTRAN program that reads the above data from the file ‘JBWEA.DAT’ and write the following outputs to an output file ‘JBWEA.RES’

(a) Monthly minimum and maximum air temperatures, and their time of occurance.
(b) Monthly mean daily air temperatures, sorted in decreasing mean daily air temperatures.

minger
Sep1-09, 02:27 PM
Just read the data into an array. From there a) can be done by using intrinsic functions, MAXVAL,MINVAL,MAXLOC, and MINLOC.

For the second part, calculate the mean for each month, then loop through printing the maximum value left.

Where exactly are you stuck?

berkeman
Sep1-09, 03:41 PM
(Merged two threads with same question)