Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 3rd 04, 02:37 PM
Neoklis
 
Posts: n/a
Default NEC2 translation to C

Hi all,

I have just completed a translation of NEC2 from fortran to C which
was done "manually" and thus has no dependency on f2c and similar auto
translators. I have also incorporated changes to the source code so
that built-in limitations are removed as far as possible and the use
of file storage for solving complex structures is not needed.

More info and source/binary packages form the nec2 archives:

http://www.qsl.net/wb6tpu/swindex.html

Please note my email address is: neoklisk-AT-cytanet-DOT-com-DOT-cy

Best regards

Neoklis - 5B4AZ
  #2   Report Post  
Old February 3rd 04, 05:58 PM
Richard Clark
 
Posts: n/a
Default

On 3 Feb 2004 06:37:38 -0800, (Neoklis) wrote:

Hi all,

I have just completed a translation of NEC2 from fortran to C which
was done "manually" and thus has no dependency on f2c and similar auto
translators. I have also incorporated changes to the source code so
that built-in limitations are removed as far as possible and the use
of file storage for solving complex structures is not needed.

More info and source/binary packages form the nec2 archives:

http://www.qsl.net/wb6tpu/swindex.html

Please note my email address is: neoklisk-AT-cytanet-DOT-com-DOT-cy

Best regards

Neoklis - 5B4AZ


Hi Neoklis,

This is a very clear and readable source. Good work. I am especially
impressed by your comment:
"All GO TO constructs have been removed (all 961 of them!) and
'spaghetti' code sections untangled as far as was possible to the
author."

How long did this take?

73's
Richard Clark, KB7QHC
  #3   Report Post  
Old February 3rd 04, 06:13 PM
Robert Spooner
 
Posts: n/a
Default

Neoklis wrote:
Hi all,

I have just completed a translation of NEC2 from fortran to C which
was done "manually" ...


Neoklis,

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.

73,
Bob AD3K
--
Robert L. Spooner
Registered Professional Engineer
Associate Research Engineer
Intelligent Control Systems Department

Applied Research Laboratory Phone: (814) 863-4120
The Pennsylvania State University FAX: (814) 863-7841
P. O. Box 30
State College, PA 16804-0030

  #5   Report Post  
Old February 4th 04, 05:33 AM
Neoklis
 
Posts: n/a
Default

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


  #6   Report Post  
Old February 4th 04, 01:57 PM
Peter O. Brackett
 
Posts: n/a
Default

Richard:

[snip]
This is a very clear and readable source. Good work. I am especially
impressed by your comment:
"All GO TO constructs have been removed (all 961 of them!) and
'spaghetti' code sections untangled as far as was possible to the
author."

How long did this take?

73's
Richard Clark, KB7QHC

[snip]

From Fortran to C, what a waste of coding time... and how many errors
were introduced in the translation? Heh, heh. :-)

Many would feel... What a crime?

What's wrong with perfectly good Fortran?

BTW... there's nothing wrong with "GOTO"s that aren't readily fixed with
simple matching "COMEFROM" statements!

Rest in Peace E. Djkystra!

;-)

--
Peter K1PO
Indialantic By-the-Sea, FL.


  #7   Report Post  
Old February 4th 04, 02:52 PM
W4JLE
 
Posts: n/a
Default

would you care to compare the number of platforms that have a C compiler Vs
a FORTRAN compiler?

The code is much more portable in C.

He has done the amateur community a real service and is to be commended.
Your inane comments to the contrary.


"Peter O. Brackett" wrote in message
ink.net...
From Fortran to C, what a waste of coding time... and how many errors
were introduced in the translation? Heh, heh. :-)

Many would feel... What a crime?

What's wrong with perfectly good Fortran?

BTW... there's nothing wrong with "GOTO"s that aren't readily fixed with
simple matching "COMEFROM" statements!

Rest in Peace E. Djkystra!

;-)

--
Peter K1PO
Indialantic By-the-Sea, FL.




  #8   Report Post  
Old February 4th 04, 03:01 PM
Andy Cowley
 
Posts: n/a
Default

Peter O. Brackett wrote:


From Fortran to C, what a waste of coding time... and how many errors
were introduced in the translation? Heh, heh. :-)

And how many were fixed? From what he says about his
test results, very, very few errors were introduced.

Many would feel... What a crime?

Many more might feel "What crime?".

What's wrong with perfectly good Fortran?

Same thing that's wrong with a perfectly good boil on your ass. 8-)

BTW... there's nothing wrong with "GOTO"s that aren't readily fixed with
simple matching "COMEFROM" statements!


Try Cobol. The 'ALTER' statement was a computed come-from!
Fortran programmers can only dream of the job security that
flowed from that.

Rest in Peace E. Djkystra!

A good Fortran programmer can write Fortran in any language. ;-)
What Neoklis has done seems to avoid that pitfall. If he has made
all that NEC2 spaghetti more comprehensible to mere mortals then
he's done us all a really big favour.

vy 73

Andy, M1EBV
  #9   Report Post  
Old February 4th 04, 07:06 PM
Dave Platt
 
Posts: n/a
Default

In article . net,
Peter O. Brackett wrote:

From Fortran to C, what a waste of coding time... and how many errors
were introduced in the translation? Heh, heh. :-)


"Make your peace with FORTRAN, for it is as perennial as crabgrass."

Many would feel... What a crime?

What's wrong with perfectly good Fortran?

BTW... there's nothing wrong with "GOTO"s that aren't readily fixed with
simple matching "COMEFROM" statements!


Heh. Real programmers used Assigned GOTO statements (or the even
studlier COBOL "ALTER" verb).

(grin, duck, run away very very fast....)

--
Dave Platt AE6EO
Hosting the Jade Warrior home page: http://www.radagast.org/jade-warrior
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!
  #10   Report Post  
Old February 4th 04, 09:45 PM
Peter O. Brackett
 
Posts: n/a
Default


"Neoklis" wrote in message
om...
Hi all,

I have just completed a translation of NEC2 from fortran to C which
was done "manually" and thus has no dependency on f2c and similar auto
translators. I have also incorporated changes to the source code so
that built-in limitations are removed as far as possible and the use
of file storage for solving complex structures is not needed.

More info and source/binary packages form the nec2 archives:

http://www.qsl.net/wb6tpu/swindex.html

Please note my email address is: neoklisk-AT-cytanet-DOT-com-DOT-cy

Best regards

Neoklis - 5B4AZ



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting NEC2 Fortran->C, need help Neoklis Antenna 0 September 26th 03 05:31 PM
Porting NEC2 Fortran->C, need help Neoklis Antenna 0 September 26th 03 12:20 PM


All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 RadioBanter.
The comments are property of their posters.
 

About Us

"It's about Radio"

 

Copyright © 2017