rwesson/NEAT — pull request #20 by bwduncan (2012-05-29 16:20:39+00:00)
Title: Some fixes

Hi,

These patches tidy up a lot of compiler warnings and invalid memory accesses.

The first patch simply converts tabs to spaces and removes whitespace at the end of lines. This makes me happier.

The second patch initialises some variables before they are used. It also removes some variables which were unused. This silences some compiler warnings and therefore makes it easy to see important warnings! Compiling with -Wall should be more palatable and should be the default.

The third patch just removes some empty DO loops. There is almost certainly no performance impact.

The fourth patch rewrites the makefile to compile using the standard make variable names FC, LD and FFLAGS and to compile each source file to an object file so that compiling the project is quicker if you only change a few files.

The last patch is the most important. It fixes a couple of bugs. Firstly, where the number of lines being read from the input file was overestimated by one. This meant that the last entry in the array contained junk and the number of lines reported was one more than actually existed in the file. Secondly, the DO loop to find the max nlevs and ntemps was not properly initialised and therefore wasn't guaranteed to work.

Hope you find these useful.

Bruce