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: SINGLE VERTICAL GROUND ROD

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}

{xl: LENGTH OF THE ROD IN FEET}

{rd: ROD DIAMETER IN INCHES}

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

rho = 10
xl = 10
rd = 10

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

executable = 'single_vertical_ground_rod.out'
script = 'single_vertical_ground_rod.f'

output_text = run([
    'gfortran',
    '-o',
    executable,
    script,])
In [4]:
from os.path import expanduser
from subprocess import check_output, STDOUT
output_text = check_output([
    './single_vertical_ground_rod.out',
    expanduser(target_text_path),
    str(rho),
    str(xl),
    str(rd),
], stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
    output_file.write(output_text)
In [5]:
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)
output_text_path = /tmp/single_vertical_ground_rod.log
target_text_path = /tmp/single_vertical_ground_rod.txt