I.E., IDENTICAL RODS EQUALLY SPACED AROUND THE CIRCUMFERENCE OF A CIRCLE.
This program was originally written in Fortran in 1989 by David R. Brown and the American Public Power Association.
{n : TOTAL NUMBER OF RODS (UP TO 500)}
YOU MAY ENTER THE ROD SPACING OR THE DIAMETER OF THE CIRCULAR ARRANGEMENT OF RODS.
{nopt: rod spacing or diameter ? TYPE A 1 TO ENTER ROD SPACING. TYPE A 2 TO ENTER DIAMETER OF ARRANGEMENT.}
{val: value ? depending on previous value this is rodspacing or diameter of arrangement (feet)}
{rho: EARTH RESISTIVITY IN OHM-METERS}
{xl: LENGTH OF THE RODS IN FEET}
{rd: DIAMETER OF THE RODS IN INCHES}
# Click the Blue Plane to preview this as a CrossCompute tool
n = 100
nopt = 1
val = 10
rho = 10
xl = 10
rd = 10
target_folder = '/tmp'
n = int(n)
if n > 500 or n < 1:
raise Exception("total number of rods must be in range [1,500]")
nopt = 1 if int(nopt) == 1 else 2
from os.path import join
output_text_path = join(target_folder, 'sym_arr_vertical_rods.log')
target_text_path = join(target_folder, 'sym_arr_vertical_rods.txt')
from subprocess import run
executable = 'sym_arr_vertical_rods.out'
script = 'sym_arr_vertical_rods.f'
output_text = run([
'gfortran',
'-o',
executable,
script,])
from os.path import expanduser
from subprocess import check_output, STDOUT
output_text = check_output([
'./sym_arr_vertical_rods.out',
expanduser(target_text_path),
str(n),
str(nopt),
str(val),
str(rho),
str(xl),
str(rd),
], stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
output_file.write(output_text)
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)