Thread
:
NEC2 translation to C
View Single Post
#
6
February 5th 04, 11:58 AM
Maurizio
Posts: n/a
(Neoklis) wrote in message . com...
Robert Spooner wrote in message ...
I looked at the URL, and you've done a lot of work to update the code.
That is commendable, and you deserve thanks from the amateur community.
You certainly have my thanks. I'm curious to know how much regression
testing you've done.
Hi Bob,
Thanks for the nice words. I tested the translation as much as I could
by comparing my version of program flow with the original source. It was
possible this way to spot a lot of bugs, most of them related to
"off-by-one" errors since fortran uses indices from 1 - n while C from
0 - (n-1). Also untangling GOTO's required a lot of changes mainly in
"spaghetti" sections and these were also prone to errors.
Eventually I debugged the code as far as was possible by constructing
input files that would hopefully put NEC2 through all possible paths
(there are about 1275 if conditionals and about 450 do/while loops!)
and comparing the output with the original fortran code. I then tried
a large number of input files found on the internet and compared outputs.
I had very good agreement in all my tests but I am sure that some
combination in an input file will trigger off hidden bugs.
73's "Nick" 5B4AZ
Hi Nick,
you have made most of the work made by a New Zeland company that is
selling Supernec.
For all using Matlab, as me, your work is very interesting since doing
some work it is possible to use the highly optimized Matlab routines
to make the hard matrix work of the program. Furthermore, it is also
possible to use the visualization capabilities of the same program to
see the results (or the inputs).
Matlab code can be compiled with other C or even Fortran codes.
Thanks then!
Reply With Quote