Week 6 Questions


What is the maximum number of places in memory for one array.

Fortran places no bounds on this. You are only limited by the space on the computer, or the maximum size of the INTEGER variable that you are using as an array index.

When you are defining your reals (e.g. real a(100), b(100), ...), do the "a" and "b" have to be letters or can they be numbers or even something like a variable name?

The "a" and "b" can be any legal Fortran variable name. In Fortran 90 the only practical limitations are that the first character must be a letter of the alphabet (a-z, A-Z), and you can't expect Fortran to recognize any blanks in the name ("my var" is just "myvar" to Fortran, try "my_var" if you want separation).

When using Arrays, is it possible for the user to input the parameter for the dimension something like this:

real x,dim print *, 'Please input the number of dimension for the array' read *, x parameter (dim=x) real a(dim), b(dim), No. This violates Fortran's separation of non-executable and executable statements. The PARAMETER and REAL are non-executable and must be above the PRINT and READ. This restriction is what resulted in the creation of the ALLOCATE and associated statements.

I'm still a little confused about the loops.

You will get plenty of practice with them for the rest of the semester. If you stay confused for the next week or two, make an appointment to talk to me about DO loops.

General Computing

At the Hammond Workstation how do I get to Netscape?

At the command prompt in one of the XTerm windows, type "netscape &".

Class Procedures

Could your write some of the sample programs you have in C?

The simple answer is no, I can't due to workload. However, Willie indicated he would assist those interested in C examples. Have you checked the existing item on the class homepage giving C to Fortran comparisons? What I will attempt to do is install a copy of the Fortran to C converter (f2c), and automatically generate C equivalent code for each example. Since this is an automated process, I can't guarantee optimal C code.

What if your Group isn't able to get together to work on the program?

Use the subgroup idea that I suggested. Work in pairs, and if necessary pick one from each pair to meet together for the final program choices. You can also use E-mail and the ability to copy each others files to pass information around.

Is there somewhere we can get our Grades, other than finding out in class?

I keep grades posted on my door in 231 Sackett. I am also looking into an approved method called a restricted news group, but can not put them on the regular Web page.

Computational Solution Methods

Can you explain how to do the hw7.f again?

Take a look at the file I usually send out to emergency E-mail versions of your question.

This week I memorized the Taylor expansion formulas. Who was Taylor?

Brook Taylor was an English mathematician, born in 1685, died 1731. The Taylor expansion formula, (or Taylor's Theorem) was given in a 1715 publication called "Methodus Incrementorum Directa et Inversa". This work laid out the principles of the calculus of finite differences, and provided the first description of the motion of a vibrating string. He hung out with guys like Newton and Liebniz in the Royal Society, so was active during a fairly exciting time in the development of Mathematics and Physics.

How do you tie the iteration into the DO loop?

The best thing to do is to make the DO loop the iteration itself. The DO loop index is the iteration counter, and an IF test leaves the loop if convergence is obtained

do 100 it=1,itmax c c Stuff here associated with whatever iteration you are doing c if (abs(x-x0).lt.eps*abs(x)) go to 200 100 continue print *, ' Iteration failed to converge' 200 print *, ' Final value of x = ', x