CS3911 Reading List: Week 1

Textbook Material
None
The set of slides used in class is available in the common directory with filename F90-Basics.pdf.
If you wish to print these slides, print them double-sided and print as many slides as possible on the same page. Let us save a tree!

Programming Material
  • Each of you have an account on the CS machines now. Go to a CS Lab and find a machine. You may use any editor to enter a Fortran 90 programs. Your program file can have any valid Unix file name ended with .f90. Thus, the following is a list of good file names: prog1.f90, practice.f90, myFortran.f90 and funny.f90.
  • Then, use the following command to compile your Fortran 90 program:
    f90 practice.f90 -o practice
    This command calls up the Fortran 90 compiler to compile your Fortran 90 program practice.f90 to an executable file practice. To run your program, use the following command:
    practice
    The computer will load your program into memory and run it.
  • There are many complete Fortran 90 programs available at the Fortran 90 Tutorial site. You may download some of them and practice the compilation and execution process to make sure you will have no difficulty in doing your exercises in the near future.
  • There is a CS Lab FAQ list available here.

Some Very Simple Fortran 90 Practice
  1. Suppose I, J, K, L, M and N are INTEGER variables. Suppose the input consists of the following lines:
    1 3 5
    7 9 11
    13 15 17
    19 21 23
    25 27 29
    • What is the result of the following?
      READ(*,*) I, J
      READ(*,*) K, L, M, N
    • What is the result of the following?
      READ(*,*) I
      READ(*,*)
      READ(*,*) J, K
      READ(*,*)
      READ(*,*) L, M, N
    • What is the result of the following?
      READ(*,*) I, J, K, L
      READ(*,*)
      READ(*,*)
      READ(*,*) M, N
    • What is the result of the following?
      READ(*,*) I, J, K, L
      READ(*,*) I, M, M
      READ(*,*) N

  2. Calculate the result of each of the following Fortran 90 expressions.
    • 4**1/2*3/2
    • 4**(1/2)*3/2
    • 4**2**3
    • (4**2)**3
    • 4**(2**3)

  3. Let X be a REAL variable initialized to some value. How do you compute its cubic root?
  4. Let X and Y be two INTEGER or REAL variables initialized to some non-zero values. How do you compute the quotient of dividing X by Y? How do you compute the remainder of dividing X by Y?