View Single Post
  #2   Report Post  
Old October 29th 06, 10:29 PM posted to rec.radio.amateur.antenna
Frank's Frank's is offline
external usenet poster
 
First recorded activity by RadioBanter: Jul 2006
Posts: 56
Default Possible NEC2 bug

"neok" wrote in message
oups.com...
Hi,

I believe I have come across a possible bug in the original
NEC2 (nec2dx.f) program. It shows up in nec2c, my translation
of NEC2 from FORTRAN to C, as a segmentation fault when
running in Linux. In the original nec2dx.f it shows up as
an Array bounds violation fault if compiled with
gfortan -fbounds-check. In both cases of course the
programs crash. This happens when an input file specifying
a wire segment in contact with a patch and with the extended
thin-wire kernel (EK card) enabled:

CM --- NEC2 Input File created by xnec2c 0.9-beta ---
CE --- End Comments ---
GW 1 8 0.0 0.0 0.0 0.0 0.0 1.0 .003
SM 3 3 0.5 0.5 0.0 0.5 -0.5 0.0 0.0
SC 0 0 -0.5 -0.5 0.0 0.0 0.0 0.0 0.0
GE 0 0 0 0 0 0 0 0 0
EX 0 1 1 0 1.0 0.0 0.0 0.0 0.0 0.0
EK 0
FR 0 11 0 0 50.0 5.0 0.0 0.0 0.0 0.0
XQ 0 0 0 0 0 0 0 0 0 0
EN 0 0 0 0 0 0 0 0 0 0

The fault is due to an "illegal" value in the connections array
ICON2 where ICON2(1) in subroutine CMWW has a value of 10001.
This signals a connection of wire segment 1 to a patch and this
value is later used as an index to ICON2 itself causing an array
bounds violation, since ICON2 is dimensioned as 2*MAXSEG and
MAXSEG=1500 in this NEC2 version.

I don't think I am qualified enough to fix this bug so I wonder
if there is still an "official" maintainer of NEC2 and whether
it is possible to contact him with the above bug report.


A quick check of the NEC 2 manual indicates the SC card
does not appear to be supported. It does not run with
my NEC2 program, but works fine in NEC4.

I am sure Gerry Burke at LLNL would be glad to help you.

Regards,

Frank