SUB HDDHLP(action$, title$, recs%) ! ! functions required by HDXDAT which are to be overlaid ! for task size reduction purposes ! {BL:[101,5]FCSERRCOM.B4S} {BL:[101,5]TRUTH.B4S} ! {HDDDEF.B4S} ! {HDDMAP.B4S} ! do% = fn.help% IF action$ = "HELP" do% = fn.dump.nodes% IF action$ = "NODES" do% = fn.dump.pipes% IF action$ = "PIPES" do% = fn.dump.loops% IF action$ = "LOOPS" do% = fn.write.heads% IF action$ = "HEADS" ! SUBEXIT ! ! ************** debug listings of files ************* ! ! ! debug output ! DEF fn.dump.nodes% call open.("NODES.DMP", "W", 30%, 0%) ! print "nodes" print for r% = 1% to recs% CALL GET.(.node.chan%, node$, r%) out$ = num1$(r%) +" "+ num1$(n%(0%)) +" "+ num1$(n%(1%)) +" "+ num1$(n%(2%)) +" "+ num1$(n%(3%)) out$ = out$ +" "+ num1$(nodeflow) +" "+ num1$(xnode) +" "+ num1$(ynode) out$ = out$ +" "+ num1$(elevation) +" "+ num1$(resid.head) +" "+ num1$(procflag%) ! CALL PRINT.(30%, out$) ! next r% print call close.(30%) ! FNEND ! DEF fn.dump.pipes% call open.("PIPES.DMP", "W", 30%, 0%) print "pipes" print for r% = 1% to recs% CALL GET.(.pipe.chan%, pipe$, r%) out$ = num1$(r%) +" "+ num1$(node1%) +" "+ num1$(node2%) +" " out$ = out$ + num1$(diam) +" "+ num1$(length) +" "+ num1$(pipeflow) ! CALL PRINT.(30%, out$) ! next r% print call close.(30%) ! FNEND ! DEF fn.dump.loops% ! print "loops" for r% = 1% to recs% CALL GET.(.loop.chan%, loop$, r%) print "err1%: "; err1% print r%; loop%; print l.node%(i%); for i% = 0% to (.max.nodes% - 1%) next r% print ! FNEND ! ! ************************ fn.write.heads% ***************************** ! DEF fn.write.heads% ! CALL CLOSE.(.tf.out.chan%) ! just in case CALL OPEN.(outfile$ + ".HDS", "W", .tf.out.chan%, 0%) ! ! head$ = " Richard Wittenoom and Associates Pty Ltd" + CR + LF + CR + LF head1$ = " HDXDAT - Hardy Cross Input Data Management Program" + CR + LF head2$ = " Static and Residual Heads At Nodes" + CR + LF + CR + LF head3$ = " Project/Run: " + title$ + CR + LF head4$ = " Time: " + time$(0%) + " " + date$(0%) + CR + LF + CR + LF head5$ = "node elevation total head residual head (m)" + CR + LF + CR + LF ! head$ = head$ + head1$ + head2$ + head3$ + head4$ + head5$ ! 1###1234567 101234567###.##1234567 1012345678###.##1234567 1012345678###.## CALL PRINT.(.tf.out.chan%, head$) ! a$ = "###" b$ = "###.##" ! for r% = 1% to recs% CALL GET.(.node.chan%, node$, r%) ! out$ = " " + format$(node%, a$) + " " + format$(elevation, b$) + " " + & format$((elevation + resid.head), b$) + " " + format$(resid.head, b$) next r% ! CALL PRINT.(.tf.out.chan%, out$) ! FNEND ! ! ***************** fn.help% ******************* ! DEF fn.help% ! print\print\print print "HARDY CROSS PIPE NETWORK ANALYSIS DATA PREPARATION PROGRAM" print "----------------------------------------------------------" print print "Input commands are:" print print "WORKFILE filename ..specify names to be used" print "OUTFILE filename by the program to build" print " filenames for work files" print " output files" print "FLOWS ..calculate initial pipe" print " flows for input to HDX" print "HEADS ..calculate residual heads" print "DATAFILE ..write hardy cross network" print " input data file" print "ELEVATION ..overwrite node elevations" print "COEFFICIENT ..hazen williams coeff." a = 1.553^9.256 for t% = 1% to 2000% print\print\print print "HARDY CROSS PIPE NETWORK ANALYSIS DATA PREPARATION PROGRAM" print "----------------------------------------------------------" print print "Input commands - page 2:" print print "DEBUG number ..sets up what is to be" print " written to a logfile" print " (range is 1 to 5)." print " ..program takes over" print "ECHO ..echo commands on screen" print "DO (or) GO ..execute the program" print "QUIT (or) EXIT ..terminate execution" print "HELP (or) ? ..print this message" print\print ! FNEND ! SUBEND