American Public Power Association tools




Pay Notebook Creator: Salah Ahmed0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0

TOWER GROUNDING RESISTANCE PROGRAM: BURIED RING OF WIRE

This program was originally written in Fortran in 1989 by David R. Brown and the American Public Power Association.

{rho: EARTH RESISTIVITY IN OHM-METERS}

{xrad: RADIUS OF THE RING IN FEET}

{rd: WIRE DIAMETER IN INCHES}

{xd: DEPTH OF BURIAL OF THE RING}

In [2]:
# Click the Blue Plane to preview this as a CrossCompute tool

rho = 10
xrad = 10
xd = 10
rd = 10

target_folder = '/tmp'
In [3]:
from os.path import join
output_text_path = join(target_folder, 'buried_ring_wire.log')
target_text_path = join(target_folder, 'buried_ring_wire.txt')
In [1]:
from subprocess import run

executable = 'buried_ring_wire.out'
script = 'buried_ring_wire.f'

output_text = run([
    'gfortran',
    '-o',
    executable,
    script,])
In [5]:
from os.path import expanduser
from subprocess import check_output, STDOUT


output_text = check_output([
    join('.', executable),
    expanduser(target_text_path),
    str(rho),
    str(xrad),
    str(rd),
    str(xd),
], stderr=STDOUT)

with open(output_text_path, 'wb') as output_file:
    output_file.write(output_text)
In [6]:
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)
output_text_path = /tmp/buried_ring_wire.log
target_text_path = /tmp/buried_ring_wire.txt