INPUT TO NECCARDS 
                      R.P. Haviland, W4MB

	The program NECCARDS is written to simplify the creation of
input files to NEC for analysis. The file is in the form of an
image of an IBM card deck, each line being the image of one card.
Comma format is used in this program. Examples of other formats are
found in the CALIBRATE files.

	The program is divided into six parts.

	Problem Identification Input
	Wire/Structure Input
	Analysis Condition Input
	Calculation Condition Input
	Output and File Instruction Input
	Review

Each part includes reminder instructions, and each required input
is identified by name. Inputs which are decimal and require a
decimal point are identified by (D).  If the decimal is not
entered as required, a warning is given. Other numerical values
are integer. Yes-No inputs are of the form Y/N?, and are not case
sensitive.

	In the following, it is sometimes stated that there are no
limits to entries. While nominally true, it must be remembered
that program execution time increases with problem complexity.
Also, with large problems, available memory storage may be
exceeded, causing use of such disk memory as available.  Problems
may become too large for the computer. 
 
	A note. Experience shows that input errors are not unlikely
with a problem of any complexity. A common error is to forget the
decimal point required in FORTRAN floating point numbers. 
Corrrection of errors is easy until RETURN is pressed: use the
DEL key and retype. After a return, no direct correction to that
card line is possible. The suggested method is to immediately
repeat the card with corrected input, and to use a text editor
(EDLIN, or a word porcessor) to remove the bad line after the
card deck is closed. Alternatively, the editor can be used to
change a line with an error. The review part of the program is
intended as a check aid. Print of the cards should be part of the
permanent file of an analysis run.

	See file CARDDATA for the card identifiers, and for the line
structure of each card. This is designed for single sheet
printout, as a checking aid.

STEP 1  PROBLEM IDENTIFICATION

	Card decks are identified by a filename, used to identify a
problem, and also the file containing the output data. The card
file is given the suffix .NEC. The deck is further identified by
entering a date, although this may be an alphameric code rather
than just a date.

	NEC allows use of comment cards; one carying the name and
date is automatically generated by NECCARDS. Others may be added
to give a full description of the antenna, structure and
conditions. Generous use of these descriptions is recommended- do
not depend on memory.

	It is possible to save part of an analysis for reuse, in a
later run requiring the same structure and environment. This
file, called Numerical Greens Function (NGF) file, may be loaded
as part of the problem identification step. Subsequent steps may
then add to the structure, extend environmental and operating
conditions, or simply rerun for the original condition. (The file
must be in the current directory of the run file (it was originally
designated as TAPE20, but other names can be used by renaming.)

	The program keeps track of the number of cards generated.

STEP 2  ANTENNA STRUCTURE and SURFACE PATCH INPUT

	While NEC allows use of any geometry dimension unit, its
internal calculations are in meters. NECCARDS is limited to use
of meters, feet and inches, and provides for automatic conversion
to meters. Use of meters in input is recommended. Other quanties
must be entered as specified.

	Step 2 includes input selection from four types of elements
and two possible modifications.

	For antennas and wire modeled structures, the most common
input is for straight wires. Each wire is divided into one or
more segments. Wire end points X,Y,Z are input, and the wire
diameter. Each wire is automatically assigned a serial (tag)
number. Accuray is affected by wire dimension and segmentation.
See USINGNEC for accuracy considerations.

	NEC allows input of curved wires and helices, although it
models these internally by division into straight segments. Input
for both includes the starting point and wire size. As
appropriate, input is of the arc angle made by the wire, or the
number of turns in the helix. The helix may be tapered. A spiral
is entered as a helix of zero height.

	These elements are also assigned tag numbers.

	Structures formed of wires may be duplicated in two ways. A
linear section such as a ladder may be converted into a quasi-cylinder
of N sides. Any structure may be moved, rotated, or
duplicated at a new location. This use of symmetry can simplify
the card deck (and reduce run time): for example a stacked
rhombic can be created from one wire and three fold symmetry,
first to two wires, then to a single rhombic, then to the stacked
ones.  When wires are program duplicated, a tag increment number
is requested, which must be chosen so there is no duplication of
tag numbers in the entire card deck. The user must keep track of
wire tags and segmentation to allow proper entry of excitation,
loading, etc.

	Symmetry is destroyed by entry of another wire, and by
unsymmetrical connections of loads or lines (see later).
Structures created by symmetry must not have any wires crossing
the Z axis. Watch for interpenetrating structures, and elements
which violate the accuracy restrictions.

	Surfaces are modelled by patches. These may be entered
individually, described by center location, orientation, area and
shape. Large areas may be described, for program division into
smaller ones. See USINGNEC for restrictions on surface modelling.
There is no limit to the number of patches.

	Wires may connect to surfaces, but only at the center of a
patch. 

	When the elements are fully described, use the end structure
input option. A card signalling end of structure is automatically
generated.

STEP 3  OPERATING CONDITIONS INPUT

	Operating conditions include the presence of ground and
ground screen, the frequency analysis plan, the excitation plan,
and the introduction of networks, loads and transmission lines.

	See USINGNEC for details of ground capabilities of NEC. The
program calls for required data when the type of ground is
selected. One ground condition, for Sommerfield relation
analysis, requires that a separately generated file (originally 
designated as TAPE21, but can have other designation) be in the
run©time current directory.

	A Second Ground card should not immediately follow another
one: if this occurs, only the last such card is used. The problem
can be avoided by completing analysis for one type of second
ground, then specifying a new second ground, followed by analysis
for it.

	A single frequency analysis may be specified, or a
frequency-stepped analysis using either constant numerical or
fractional difference steps. Omission of frequency causes
analysis to be at 299.8 MHz. (If an appreciable number of steps
are specified, program output can only be called voluminous.)

	There are 6 possibilities for excitation, two voltage, one
current and three by incident radiation. Only one type of
excitation may be specified. The E-field voltage source is
located on the segment specified, whereas the currrent slope
voltage source is located at the junction on the specified
segment and the next previous segment. Both tag and segment must
be specified for direct voltage excitations. No more than 10
direct excitations may be applied. 

	The current source is specified by it's X,Y,Z coordinates,
and cannot be used over a ground plane. Bodies described by
surfaces cannot be excited by voltage sources, but a wire
connected to a patch can be.

	Networks, transmission lines and loading elements can be
introduced into antenna structures. Connection is to tag numbers
and segments. Networks are specified by admittances, transmission
lines by length and admittance, and loads by type, which can
include wire conductance as well as lumped values. There is no
limit to the number of such elements.

STEP 4 and 5 CALCULATION AND OUTPUT INSTRUCTIONS

	NECCARDS provides for 5 run-time calculation and 5 output
instructions. The first calculation instruction  specifies use of
an extended "kernel", which assumes that wire current is
distributed over the surface of the wire rather than at its
center. This should be used for fat wires.

	The option of calculating coupling between two segments is
available, but rarely needed.

	 Execution will be faster if an approximate relation  used
for inter©segment interaction. Accuracy will be lost if the two
segments are less than about one wavelength apart.

	Near-field and far field analysis can be selected. Near
field is for specified points. The far field analysis can specify
such items as ground screens and cliffs, see above. Several
choices of gain reference are provided. There is complete freedom
in choice of azmuith and elevation angles for calculation, or
preset values can be used. Currents and/or charge output can be
specified. A NGF file can be created, see above. There are
choices for vertical, horizonal or total components of gain.
Patterns can be saved for use with plotting programs, as can
impedance and admittance data.

	Cards are kept in memory until completion is signaled. Until
this is designated, operating condition input can be re-selected.

REVIEW

	After the card deck has been saved to the designated path,
it can be recalled for review. This can be to screen only, or to
screen and printer. Printed copies are recommendend for any real
problem.