<!-- hamlet
<!-- copytar
examples/                                                                                              755    1107     770            0  5553355426   5721                                                                                                                                                                                                                                                                                                                                                                      examples/swap1.f                                                                                       644    1107     770         1044  5506142032   7170                                                                                                                                                                                                                                                                                                                                                                      C Created:  Joe Zachary, October 19, 1992
C Modified:


      SUBROUTINE SWAP (X, Y)
      IMPLICIT NONE
      INTEGER X, Y, Z

      Z = X
      X = Y
      Y = Z
      RETURN
      END



      PROGRAM TEST
      IMPLICIT NONE
      INTEGER A
      INTEGER B

      A = 1
      B = 2
      PRINT *, 'The value of A before the call is ', A
      PRINT *, 'The value of B before the call is ', B
      CALL SWAP(A, B)
      PRINT *, 'The value of A after the call is ', A
      PRINT *, 'The value of B after the call is ', B

      STOP
      END
   8I  cs353    o  cs364    7  cs365  	   !  cs366 Az   N>  cs367      7  cs376 43     cs431 n1    >  cs451 rt  0 6G  cs677  	  @ d>  cs506 L  P o+  cs507 d  ` 	d3  cs508 4  p z  cs509 n1   
X  cs511 rt   n  cs531  	   D  cs537    C  cs539     D  cs541    8  cs542      cs546 ri    ɥ  cs547 n2    d%  cs100 rt   !e  cs561      *  cs56examples/quadratic.f                                                                                   644    1107     770         1523  5506142032  10114                                                                                                                                                                                                                                                                                                                                                                      C Created:  Joe Zachary, October 19, 1992
C Modified:


C The arguments "A", "B", and "C" are the coefficients of a quadratic
C equation.  We require that A be nonzero and that the discriminant formed
C from A, B, and C be nonnegative.  The two solutions to the quadratic
C equations are assigned to RES1 and RES2, and A, B, C are not changed.

      SUBROUTINE QUAD (A, B, C, RES1, RES2)
      IMPLICIT NONE
      REAL A, B, C, RES1, RES2

C Your code goes here

      END


C This test out the QUAD subroutine

      PROGRAM TEST
      IMPLICIT NONE
      REAL A, B, C, ANS1, ANS2

      PRINT *, 'Please enter the coefficients of a quadratic'
      PRINT *, 'equation that has real roots'
      READ *, A, B, C
      CALL QUAD(A, B, C, ANS1, ANS2)
      PRINT *, 'One root is ', ANS1
      PRINT *, 'The other root is ', ANS2

      STOP
      END
 D  cs537    C  cs539     D  cs541    8  cs542      cs546 ri    ɥ  cs547 n2    d%  cs100 rt   !e  cs561      *  cs56examples/subroutine.f                                                                                  644    1107     770          771  5506142032  10322                                                                                                                                                                                                                                                                                                                                                                      C An example of a simple subroutine

C Created:  Joe Zachary, October 18. 1992
C Modified:


C This subroutine prints out the number N 5 times.

      SUBROUTINE FIVE (NUMBER)
      IMPLICIT NONE
      REAL NUMBER

      PRINT *, NUMBER, NUMBER, NUMBER, NUMBER, NUMBER
      RETURN

      END


C A main program to test out the subroutine

      PROGRAM TEST
      IMPLICIT NONE
      REAL NUMBER

      PRINT *, 'Please enter a number:'
      READ *, NUMBER
      CALL FIVE(NUMBER)

      STOP
      END
outine
examples/param.f                                                                                       644    1107     770         1250  5506142032   7234                                                                                                                                                                                                                                                                                                                                                                      C This illustrates how parameters are passed in Fortran

C Created:  Joe Zachary, October 19, 1992
C Modified:

C This subroutine assigns 10 to both of its arguments

      SUBROUTINE EXAMPLE (X, Y)
      IMPLICIT NONE
      INTEGER X, Y

      X = 10
      Y = 10

      RETURN
      END


C This tests out the subroutine above

      PROGRAM TEST
      IMPLICIT NONE
      INTEGER A, B

      A = 5
      B = 5
      PRINT *, 'The value of A before the call is ', A
      PRINT *, 'The value of B before the call is ', B
      CALL EXAMPLE(A, B+2)
      PRINT *, 'The value of A after the call is ', A
      PRINT *, 'The value of B after the call is ', B

      STOP
      END
real roots'
      READ *, A, B, C
      CALL QUAD(A, B, C, ANS1, ANS2)
      PRINT *, 'One root is ', ANS1
      PRINT *, 'The other root is ', ANS2

      STOP
      END
 D  cs537    C  cs539     D  cs541    8  cs542      cs546 ri    ɥ  cs547 n2    d%  cs100 rt   !e  cs561      *  cs56                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                