Assignment 2.  Due Monday October 10.

1.  copy, compile and run the program prog1.f found in my public directory ~prdaves/public.  Use dbx and the "catch fpe" command to see why this program doesn't run.

2.  copy, compile and run the program prog2.f found in my public directory.   Again, use dbx to find why this program doesn't work.  Is there something that bothers you about what you found?  (For example, why didn't it bomb earlier?!)   Note--you don't need to use "catch fpe" since it isn't a floating point exception.  Use the "print" and "list" command to examine the values of the variables when it bombs.

3.  Recompile prog2.f using the compilecheck command.  This uses the fortran 77 compiler with the -C option.  Now run it, and debug it under dbx.

4.  Compile prog3.f and run it.  prog3.f calculates the OLS alpha and beta coefficients for a series of numbers that are contained in a datafile that you specify. There is a file on my /public directory that has data for you.  It is cleverly named betadata1.  prog3.f doesn't work properly because of a logic error (hint:  the subroutine works fine).  Find the logic error and fix it.  dbx will help, as will compilecheck. 

Note:  You will probably want to check the logic of the subroutine yourself to make sure that it really does calculate beta and alpha.  For your information, a formula for the alpha and beta in the ordinary least squares regression of y = alpha + beta*x is

5.  Compile prog4.f and run it.  prog4.f also calculates the OLS alpha and beta coefficients for a series of numbers that are contained in a datafile that you specify.  You will be using betadat1, betadata2, and betadata3.  Use the program to calculate beta for each of the datasets.  This program has a two different logic errors in it.  Compilecheck will help along with dbx.  Find the errors and fix them.