NOTES concerning the modification of ORBITING SOLAR ARRAY SIMULATION MODEL

The goal of this effort is to transform this program that predates the
Fortran77 standard into modern Fortran. 

The original program from COSMIC was run through Tidy (included on this
CD-ROM). This puts all the statement numbers in increasing order, indents
all the DO loops and IF blocks, and modifies the case of the instructions.
There are several options in Tidy, and I prefer that the variables be in
lower case and the Fortran commands be in upper case. You may prefer something
else. Next the source code was run through Convert to use ! for comments
and to have free-format source. 

Next, I moved all the subroutines into a module that preceeds the main 
program and declared the type of all variables. This sounds painful, but it
really goes rather fast. The idea is to use the compiler to find the variables
that are implicitly typed. I like to put the type and dimension on the same
instruction so you only have to look in one place for this info.

The next big step is to declare the intent of all the subroutine arguments.
I like to declare them all as IN and let the compiler tell me where I am
wrong. Then I change the flagged ones to OUT. If the compiler still complains,
I change them to IN OUT. At some point, you really need to look at each
one with some care and be sure you are right about the intent. 

At this point, I like to try to compile with Elf90. This will generate 
hundreds, maybe thousands of error messages. I like to knock off as many 
as I can, although many of these old programs require too much work to put
them into full compliance with Elf or F.

At this point, I also like to declare each of the procedures in the module
as either Public or Private. This makes it easy to remember which ones are
called by the main program and which are only used by module procedures.
Again, the compiler is your best friend here, pointing out if you have a
procedure improperly declared. For bigger programs, you should make up a 
hierarchy of modules, each with the public data and procedure that interact
with the rest of the program and the private data and procedures that will
only be used internally. The Visual Analyzer that is part of the Lahey F95
package is quite useful here in identifying which procedures are used where.
You don't need to write a lot of INTERFACE coding, because the module
structure really does it for you. And you know at compile time that if
the subroutine has seven arguments of various types, the corresponding CALL
statement has seven arguments of exactly the right type. If I had just had 
this 40 years ago, would I have been happy.

I have have spent too much time with the Fortran and not enough with the
engineering aspects of this program. There were no sample cases supplied 
with the original distribution, so I just made some up. But I don't know
if my values for some of these parameters are realistic. And the built-in
values for solar cell properties probably reflect 1970 state of the art.

So here is a project for somone: Bring the data and sample cases up to date
for modern technology. And while we are at it, why don't we get the whole 
program into SI units. As it is, all the electric power terms are in watts
and joules and the thermodynamic terms are in BTUs and deg Rankine so you 
are constantly multiplying or dividing by 3412.76 and it really seems wierd
to express the mass of the sun in pounds force as if it were in a
gravitational field corresponding to the surface of the earth. 

Any volunteers?
