Homework: Fortran II

  < Previous  Next >

Due Date

See the calendar for due date.

Description:

Write a short Fortran program to calculate the sum of inverses of i, for i 1 to 109 (i.e., 1x109) and the sum of the inverses of i for i 109 to 1 using both single precision (4 bytes) and double precision (8 bytes). What are the results for each case:
  1. Single precision, forward sum
  2. Single precision, reverse sum
  3. Double precision, forward sum
  4. Double precision, reverse sum

Rubric:

Points       Item
----------   --------------------------------------------------------------
_____ /  4   Fortran code
_____ /  4   Correct output
_____ /  2   Brief explanation
             
_____ / 10   Total

_____  Approximate number of hours spent
      

Submission

Submit the the results of each case and a brief description of the results into the appropriate folder in the dropbox for COMS 6100 at https://elearn.mtsu.edu:
  1. Fortran source code
  2. Plain-text output of the program running (e.g., redirect the output of the program using ">")
  3. A brief explanation of the results
  4. Completed rubric (estimates for each line including hours spent)

Hints:

  1. To use the correct kind values, use the following to define the kinds needed to work this problem:
    ! for the integer variables used in the counter
    integer, parameter :: ikind = selected_int_kind(9)
    
    ! for the single precision real variable
    integer, parameter :: sgle = selected_real_kind(6,37)
    	
    ! for the double precision real variable
    integer, parameter :: dble = selected_real_kind(15,307)
  2. Does your output (answers) make sense?