Need help in doing a program in fortran77

  • Context: Comp Sci 
  • Thread starter Thread starter qadi77
  • Start date Start date
  • Tags Tags
    Fortran77 Program
Click For Summary
SUMMARY

The forum discussion centers on writing a FORTRAN 77 program to process hourly average air temperature data from the file 'JBWEA.DAT'. The program must output monthly minimum and maximum temperatures along with their occurrence times, as well as calculate and sort monthly mean daily temperatures. Key intrinsic functions to be utilized include MAXVAL, MINVAL, MAXLOC, and MINLOC for efficient data handling.

PREREQUISITES
  • Understanding of FORTRAN 77 programming syntax and structure
  • Familiarity with file I/O operations in FORTRAN
  • Knowledge of intrinsic functions in FORTRAN for data analysis
  • Basic concepts of arrays and loops in programming
NEXT STEPS
  • Study file handling in FORTRAN 77 for reading and writing data
  • Learn about intrinsic functions in FORTRAN, specifically MAXVAL and MINVAL
  • Research sorting algorithms applicable to arrays in FORTRAN
  • Explore examples of temperature data processing in FORTRAN
USEFUL FOR

This discussion is beneficial for FORTRAN developers, students learning FORTRAN 77, and anyone interested in data processing and analysis of temperature datasets.

qadi77
Messages
1
Reaction score
0
I need to do this program, I'll be greatful for anyone 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 occurrence.
(b) Monthly mean daily air temperatures, sorted in decreasing mean daily air temperatures.
 
Physics news on Phys.org
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?
 
(Merged two threads with same question)
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
19K