The basic structure of the code is:
The Fortran code conforms to the "Fortran 77" standard with the exception of the "IMPLICIT NONE" statement, which can be removed if required.
The main mesh array has been placed in a common block since some compilers would otherwise take the required storage on the stack, and stack space can be limited on some machines.
Named constants (PYNX, PZNX, etc.) have been used throughout, rather than the more traditional port numbering scheme to aid readability. The scattering procedure was developed by Trenkic.
The "connect" procedure is applied across the entire mesh, regardless of any boundary conditions. This means that special treatment is needed for boundary conditions which are not placed on the edge of the mesh. In this case, the voltage pulse reflected from the boundary is placed with the adjacent node, so that it is returned to the correct node after the subsequent connection. One way of avoiding this complication would be to use a larger mesh in which external boundaries are not permitted.