!  More examples in Fortran 90
!   

         PROGRAM circle
         IMPLICIT NONE
         ! This program calculates the equation of a circle passing
         ! through three points
         ! Variable declarations
        REAL :: x1,y1,x2,y2,x3,y3,a,b,r
         ! Step 1
        PRINT *, "Please type the coordinates of three points"
        PRINT *, "in the order x1,y1,x2,y2,x3,y3"  
        READ *, x1,y1,x2,y2,x3,y3   !  Read the three points
         ! Step 2
        CALL calculate_circle(x1,y1,x2,y2,x3,y3,a,b,r)
        !  calculate_circle is a subroutine that is not included
         ! Step 3
        PRINT *, "The center of the circle through these points is &
                &(",a,",",b,")"
        PRINT *, "Its radius is", r
        
       END PROGRAM circle

       PROGRAM  C_to_F
       IMPLICIT NONE
       REAL :: temp_c, temp_f
       PRINT *, "What is the Celsius temperature? "
       READ * , temp_c
       ! Convert to farenheit
          temp_f = 9.0*temp_c/5.0 + 32.0
       PRINT *, temp_c, "C= ",temp_f,"F"
       END PROGRAM C_to_F
       ! Output of program
       !  What is the Celsius temperature? 
       ! 30
       ! 30.0 C=  86.0 F



       PROGRAM test_fun
        IMPLICIT NONE
        REAL :: x, y, cube_root
        PRINT *, "What is the value of x (greater than 0)"
        READ *, x
        y= cube_root(x)
        PRINT *, "The cube root of x is", y
       END PROGRAM test_fun

       REAL FUNCTION cube_root(x)
         IMPLICIT NONE
       ! Dummy declaration of x
       !  x will not be changed by function
         REAL, INTENT(IN) :: x
         ! Local variable declaration
         REAL :: log_x
         !
         log_x=LOG(x)
         cube_root = EXP(log_x/3.0)

        END FUNCTION cube_root

       !  Declaration of arrays
       REAL, DIMENSION(50) :: a,b,c
       ! or
       REAL, DIMENSION(11:60) :: a,b,c
       REAL, DIMENSION(-9:10) :: a,b,c
       !  Within a program
       !
       REAL, DIMENSION(20): a,b,c,d
        .
        .
        .
        a=c*d   ! Fortran 90 processing
        .
        .
        DO i=1,20        ! Fortran 77 style
         b(i)=c(i)*d(i)  ! array manipulation
        END DO       
!  This program shows how to perform some matrix operations
!
        PROGRAM vectors_and_matrices
           IMPLICIT NONE
           INTEGER, DIMENSION(2,3) :: matrix_a
           INTEGER, DIMENSION(3,2) :: matrix_a
           INTEGER, DIMENSION(2,2) :: matrix_ab
           INTEGER, DIMENSION(2) :: vector_c= (/1,2/)
           INTEGER, DIMENSION(3) :; vector_bc
!       Initialize matrix_a
          matrix_a(1,1)=1     ! matrix_a is the matrix
          matrix_a(1,2)=2     ! [1 2 3]
          matrix_a(1,3)=3     1 [2 3 4]
          matrix_a(2,1)=2
          matrix_a(2,2)=3
          matrix_a(2,3)=4
!       set matrix_b as the transpose of matrix_a
          matrix_b = TRANSPOSE(matrix_a)
         ! matrix_b is now the matrix  [1 2]
         !                             [2 3]
         !                             [3 4]
         ! calculate matrix products
         matrix_ab = MATMUL(matrix_a,matrix_b)
         ! matrix_ab is now the matrix: [14 20] 
         !                              [20 29]
         vector_bc=MATMUL(matrix_b,vector_c)
         ! vector_bc is now the vector: [5 8 11]
!
        END PROGRAM vectors_and_matrices
! 
! MATMUL Matrix product of two matrices, or a matrix and a vector
! DOT_PRODUCT Scalar (dot) product of two vectors
! TRANSPOSE  transpose of a matrix
! MAXVAL  Maximum value of all the elements of an array
! MINVAL  Minimum value of all the elements of an array
! PRODUCT product of all the elements of an array, or of all the elements
!         along a specified dimension of an array
! SUM  Sum of all the elements of an array, or of all the elementes along
!        a specified dimension of an array
!
!  Some UNIX commands 
!  ls   list all the files in your home directory
!  cp file1 file2    copies file1 to file2
!  mv file1 file2    moves file1 to file2
!  rm file1   removes file1 from directory
!  pico  a simple editor. Similar to the pine editor

