--- nec2c-0.6.orig/network.c +++ nec2c-0.6/network.c @@ -5,21 +5,21 @@ Numerical Electromagnetics Code (NEC2) developed at Lawrence Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 - for problems with the NEC code. For problems with the vax implem- - entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 - 422-5936) - file created 4/11/80. - - ***********Notice********** - This computer code material was prepared as an account of work - sponsored by the United States government. Neither the United - States nor the United States Department Of Energy, nor any of - their employees, nor any of their contractors, subcontractors, + for problems with the NEC code. For problems with the vax implem- + entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 + 422-5936) + file created 4/11/80. + + ***********Notice********** + This computer code material was prepared as an account of work + sponsored by the United States government. Neither the United + States nor the United States Department Of Energy, nor any of + their employees, nor any of their contractors, subcontractors, or their employees, makes any warranty, express or implied, or - assumes any legal liability or responsibility for the accuracy, - completeness or usefulness of any information, apparatus, product - or process disclosed, or represents that its use would not infringe - privately-owned rights. + assumes any legal liability or responsibility for the accuracy, + completeness or usefulness of any information, apparatus, product + or process disclosed, or represents that its use would not infringe + privately-owned rights. *******************************************************************/ @@ -65,7 +65,7 @@ ndimn = j = (2*netcx.nonet + vsorc.nsant); /* Allocate network buffers */ - if( netcx.nonet > 0 ) + if( netcx.nonet != 0 ) { mem_alloc( (void *)&rhs, data.np3m * sizeof(complex long double) ); @@ -81,6 +81,12 @@ mem_alloc( (void *)&vsrc, vsorc.nsant * sizeof(complex long double) ); } + else + if( netcx.masym != 0) + { + i = j * sizeof(int); + mem_alloc( (void *)&ipnt, i ); + } if( netcx.ntsol == 0) { @@ -527,7 +533,10 @@ } if( (vsorc.nsant+vsorc.nvqd) == 0) + { + free_ptr( (void *)&ipnt ); return; + } fprintf( output_fp, "\n\n\n" " " @@ -587,31 +596,29 @@ } /* if( vsorc.nsant != 0) */ - if( vsorc.nvqd == 0) - return; + if( vsorc.nvqd != 0) + for( i = 0; i < vsorc.nvqd; i++ ) + { + isc1= vsorc.ivqd[i]-1; + vlt= vsorc.vqd[i]; + cux= cmplx( crnt.air[isc1], crnt.aii[isc1]); + ymit= cmplx( crnt.bir[isc1], crnt.bii[isc1]); + netcx.zped= cmplx( crnt.cir[isc1], crnt.cii[isc1]); + pwr= data.si[isc1]* TP*.5; + cux=( cux- ymit* sinl( pwr)+ netcx.zped* cosl( pwr))* data.wlam; + ymit= cux/ vlt; + netcx.zped= vlt/ cux; + pwr=.5* creall( vlt* conjl( cux)); + netcx.pin= netcx.pin+ pwr; + irow2= data.itag[isc1]; - for( i = 0; i < vsorc.nvqd; i++ ) - { - isc1= vsorc.ivqd[i]-1; - vlt= vsorc.vqd[i]; - cux= cmplx( crnt.air[isc1], crnt.aii[isc1]); - ymit= cmplx( crnt.bir[isc1], crnt.bii[isc1]); - netcx.zped= cmplx( crnt.cir[isc1], crnt.cii[isc1]); - pwr= data.si[isc1]* TP*.5; - cux=( cux- ymit* sinl( pwr)+ netcx.zped* cosl( pwr))* data.wlam; - ymit= cux/ vlt; - netcx.zped= vlt/ cux; - pwr=.5* creall( vlt* conjl( cux)); - netcx.pin= netcx.pin+ pwr; - irow2= data.itag[isc1]; - - fprintf( output_fp, "\n" - " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" - " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", - irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), - creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr ); + fprintf( output_fp, "\n" + " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE" + " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE", + irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux), + creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr ); - } /* for( i = 0; i < vsorc.nvqd; i++ ) */ + } /* for( i = 0; i < vsorc.nvqd; i++ ) */ /* Free network buffers */ free_ptr( (void *)&ipnt ); --- nec2c-0.6.orig/Makefile +++ nec2c-0.6/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/sh PROJECT = nec2c -BINDIR = /usr/local/bin +BINDIR = $(DESTDIR)/usr/bin CC = gcc -Wall -O2 objects = calculations.o fields.o geometry.o ground.o input.o \ --- nec2c-0.6.orig/debian/rules +++ nec2c-0.6/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/nec2c.sgml > nec2c.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp *.o nec2c + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/nec2c. + $(MAKE) DESTDIR=$(CURDIR)/debian/nec2c install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- nec2c-0.6.orig/debian/compat +++ nec2c-0.6/debian/compat @@ -0,0 +1 @@ +5 --- nec2c-0.6.orig/debian/control +++ nec2c-0.6/debian/control @@ -0,0 +1,16 @@ +Source: nec2c +Section: hamradio +Priority: extra +Maintainer: Joop Stakenborg +Build-Depends: debhelper (>= 5) +Standards-Version: 3.8.0 + +Package: nec2c +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: translation of the NEC2 FORTRAN source code to the C language + The translation was performed mostly "by hand" and a lot of modifications + to the original program were introduced in order to modernize the NEC2 + and to remove as many built-in limitations as possible. The attendant + SOMNEC program was also translated to C and incorporated in nec2c as a + function so that Sommerfeld ground solutions are a part of the program. --- nec2c-0.6.orig/debian/docs +++ nec2c-0.6/debian/docs @@ -0,0 +1,2 @@ +NEC2-bug.txt +README --- nec2c-0.6.orig/debian/copyright +++ nec2c-0.6/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Joop Stakenborg on +Thu, 30 Nov 2006 17:13:03 +0100. + +It was downloaded from http://5b4az.chronos.org.uk/pages/nec2.html + +Upstream Author: Neoklis Kyriazis + +From the README included with the package: + + nec2c is Public Domain, same as the original FORTRAN source. + Please keep any software you write incorporating nec2c in Public Domain + or at least use an open license like GPL or BSD. + +The file file main.c in this package contains the license included with +the original fortran code: +--------------------------------------------------------------------- + Numerical Electromagnetics Code (NEC2) developed at Lawrence + Livermore lab., Livermore, CA. (contact G. Burke at 415-422-8414 + for problems with the NEC code. For problems with the vax implem- + entation, contact J. Breakall at 415-422-8196 or E. Domning at 415 + 422-5936) + file created 4/11/80. + + ***********Notice********** + This computer code material was prepared as an account of work + sponsored by the United States government. Neither the United + States nor the United States Department Of Energy, nor any of + their employees, nor any of their contractors, subcontractors, + or their employees, makes any warranty, express or implied, or + assumes any legal liability or responsibility for the accuracy, + completeness or usefulness of any information, apparatus, product + or process disclosed, or represents that its use would not infringe + privately-owned rights. +---------------------------------------------------------------------- + +The Debian packaging is (C) 2006, Joop Stakenborg and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- nec2c-0.6.orig/debian/dirs +++ nec2c-0.6/debian/dirs @@ -0,0 +1 @@ +usr/bin --- nec2c-0.6.orig/debian/changelog +++ nec2c-0.6/debian/changelog @@ -0,0 +1,25 @@ +nec2c (0.6-4) unstable; urgency=low + + * Another upstream revision of the previous patch. + + -- Joop Stakenborg Thu, 20 Nov 2008 19:15:28 +0100 + +nec2c (0.6-3) unstable; urgency=low + + * Upstream patch to better fix the previous bug. + + -- Joop Stakenborg Wed, 19 Nov 2008 21:22:06 +0100 + +nec2c (0.6-2) unstable; urgency=low + + * Fixed a segfault, thanks Jeffrey Hundstad. Closes: #498676. + Upstream notified. + + -- Joop Stakenborg Tue, 18 Nov 2008 19:53:30 +0100 + +nec2c (0.6-1) unstable; urgency=low + + * Initial release. + + -- Joop Stakenborg Thu, 30 Nov 2006 17:13:03 +0100 +