WANtaroHP (Engineering)

toJA

Outline of this page

This is the room to save Fortran90 programs related engineering problems.

Contents


Marston's formula (Vertical soil pressure)

Outline of this program

Source code by f90 and output sample by GMT

FilenameDescription
Program to calculate the vertical load for embedded pipe by Marston's formula.
Small document for Marston's formula


Amstutz's formula (Buckling pressure of embedded pipe)

Outline of this program

f90_AMS_org.f90

f90_AMS_JPN.f90

gpl_AMS.txt

Source code by f90

FilenameDescription
Document of calculation formulas for critical buckling pressure
program for calculation of Buckling pressure (Amstutz original 1970)
program for calculation of Buckling pressure (Standard in japan)
script for gnuplot
sample figure (effect of initial imperfections by Amstutz)
sample figure (comparison between Amstutz original and JPN standard)


Curve fitting by Simplex method

Outline of this program

Format of input data file

 001 | Simplex_test_1
 002 | time_(sec),Displacement_(mm)
 003 | N,0,800,100,"%.0f"
 004 | N,-10,10,2,"%.0f"
 005 | 800
 006 | 0.000,2.543
 007 | 1.000,3.402
 008 | 2.000,2.978
..........
001
Comment
002
x-axis label, y-axis label
003
Type of x-axis (N: normal, L: log), x-min.value, x-max.value, x-increment, x-format (style of x-axis)
004
Type of y-axis (N: normal, L: log), y-min.value, y-max.value, y-increment, y-format (style of y-axis)
005
Number of input data sets
006
(Lower rows are x and y-values of data)

Bach command for execution

For execution of this program 'f90_SIMPLEX.exe,' (1) input filename, (2) output filename, (3) image output filename for gnuplot and (4) initial values of unknown parameters for Simplex method must be inputted from command line.

gfortran -o f90_SIMPLEX.exe f90_SIMPLEX.f90
f90_SIMPLEX inp_SIMP_0.txt out_SIMP_0.txt fig_SIMP_0.png 1 1 1 1 1

Source code by f90

FilenameDescription
program for curve fitting by Simplex method
Sample of input data (1)
Sample of output data (1)
Sample drawing of result (1)
Sample of input data (2)
Sample of output data (2)
Sample drawing of result (2)


Basic Design of Restricted Orifice Surge Tank

Outline of this program

f90_SURGR.f90

Sample of input data (file: inp_scvf_Load.csv)
KN No.1 Headrace ST (Load interception)
Hg,Q0,L,d0,c,Cd,zm,xc,yc
713,340,2553.370,8.2,0.179,0.9,35,4.6,17
Hg Total head (m)
Q0 Maximum discharge (m3/s)
L Length of the pressure tunnel (m)
d0 Diameter of the pressure tunnel (m)
c Head loss coefficient
Cd Discharge coefficient of the port
zm Target maximum water level given by designer (m)
xc Selected diameter of the port (m)
yc Selected diameter of the shaft (m)

Bach command for execution

gfortran -o f90_surgeSCVF.exe f90_surgeSCVF.f90
f90_surgeSCVF inp_scvf_Load.csv fig_scvf_Load_SC.eps fig_scvf_Load_VF.eps

Source code by f90

FilenameDescription
Document for Design of Restricted Orifice Surge Tank
program for basic design of Restricted Orifice Surge Tank
sample input data (load interception)
sample figure (stability condition: load interception)
sample figure (maximum water level: load interception)


Surging Analysis for Restricted Orifice Surge Tank

Outline of this program

f90_SURGR.f90

Sample of input data (file: inp_surge_Ta.csv)
KN No.1 Tailrace ST (Load interception: 4 units) //: Title
1,70.0,210.0                                     //: ICT,AFCA,AFCT
600.0,0.01,0.1                                   //: TMAX,dt,DTWR
18.857,0.9,0.9                                   //: PAA,PCI,PCO
814.000,2167.752,52.810,0.166                    //: RWL,TNL,TNA,TNC
3                                                //: NST
520.000,865.000,Top_of_Surge_Tank                //: SAA(1),SEL(1),SLB(1)
520.000,854.050,Bottom_of_Chamber                //: SAA(2),SEL(2),SLB(2)
78.540,727.600,Bottom_of_Surge_Tank              //: SAA(3),SEL(3),SLB(3)
3                                                //: NQT
-340,0                                           //: QTQ(1),QTI(1)
0,8                                              //: QTQ(2),QTI(2)
0,9999                                           //: QTQ(3),QTI(3)
Title Title
ICT Calculation case (1: normal, 2: AFC)
AFCA Discharge of half amplitude of AFC (m3/s)
AFCT Period of AFC (s)
TMAX End time for calculation (s)
dt Time increment for calculation (s)
DTWR Time increment for print out (s)
PAA Section area of port (m2)
PCI Discharge coefficient of port for in-flow
PCO Discharge coefficient of port for out-flow
RWL Water level at reservoir (EL.m)
TNL Length of pressure tunnel (m)
TNA Section area of pressure tunnel (m2)
TNC Head loss coefficient of pressure tunnel (s2/m)
NST Number of sections
SAA(i)Section area of specified level in the shaft (m2)
SEL(i)Level definition of sections of shaft (EL.m)
SLB(i)Label for section (text: for drawing)
NQT Number of discharge input points
QTQ(i)Discharge at specified time point (m3/s)
QTI(i)Time at specified time point (s)

f90_DRAW_SURGR.f90

Bach command for execution

gfortran -o f90_SURGE.exe f90_SURGE.f90
f90_SURGE inp_surge_Ha.csv out_surge_Ha.csv
f90_SURGE inp_surge_Hc.csv out_surge_Hc.csv
f90_SURGE inp_surge_Ta.csv out_surge_Ta.csv
f90_SURGE inp_surge_Tc.csv out_surge_Tc.csv

gfortran -o f90_DRAW_SURGE.exe f90_DRAW_SURGE.f90
f90_DRAW_SURGE out_surge_Ha.csv fig_surge_Ha.eps
f90_DRAW_SURGE out_surge_Hc.csv fig_surge_Hc.eps
f90_DRAW_SURGE out_surge_Ta.csv fig_surge_Ta.eps
f90_DRAW_SURGE out_surge_Tc.csv fig_surge_Tc.eps

Source code by f90

FilenameDescription
program for Surging analysis for Restricted Orifice Surge Tank
program to draw the time history of water surface using gnuplot
sample input data (headrace surge tank: load interception)
sample input data (headrace surge tank: input interception)
sample input data (tailrace surge tank: load interception)
sample input data (tailrace surge tank: input interception)
sample figure (headrace surge tank: load interception)
sample figure (headrace surge tank: input interception)
sample figure (tailrace surge tank: load interception)
sample figure (tailrace surge tank: input interception)


Drawing of the circular pressure tunnel section

Outline of this program

Bach command for execution

gfortran -o f90_TUNNEL.exe f90_TUNNEL.f90

f90_TUNNEL bat_HT1.bat fig_eps_HT1.eps 0 8200 550 0 6000 100 100
f90_TUNNEL bat_HT2.bat fig_eps_HT2.eps 0 6100 550 0 5000 100 100
f90_TUNNEL bat_PS1.bat fig_eps_PS1.eps 1 5400 600 300 5000 100 100
f90_TUNNEL bat_PS2.bat fig_eps_PS2.eps 1 3000 500 100 3000 100 100

The format of command line arguments are shown below.

f90_TUNNEL fnameW fnameF ksp DIA Tc Tx W ts tp
f90_TUNNELCompiled F90 program
fnameW Batch file for execution of GMT
fnameF Output image filename (eps)
ksp 0: no-steel lining, 1: steel lining
DIA Internal diameter of waterway
Tc Thickness of concrete lining
Tx Additional thickness of invert concrete
W Width of invert concrete
ts Thickness of shotcrete
tp Thickness from design line to pay line

Source code by f90

FilenameDescription
Program to draw waterway tunnel section
Batch file for GMT execution by F90 program (for drawing fig_eps_PS1.eps)
Output image file (1)
Output image file (2)
Output image file (3)
Output image file (4)
TeX document sample using eps image file

Meaming of symbols in the drawings are shown below.

Ae Area for excavation by pay line
Ce Area for concrete by design line
Ls Length for shotcrete by design line
ΔCe Difference of area between pay line and design line
ΔLs Difference of length between pay line and design line


H-Q curve by uniform flow calculation

Outline of this program

Bach command for execution

gfortran -o f90_MANNING_CIRC.exe f90_MANNING_CIRC.f90
gfortran -o f90_MANNING_RECT.exe f90_MANNING_RECT.f90

f90_MANNING_CIRC 1.50 0.06649 0.015 > inp_manning_circ.txt
f90_MANNING_RECT 3.00 0.00500 0.015 > inp_manning_rect.txt

The format of command line arguments are shown below.

f90_MANNING_CIRC DD ii nn > fnameW
f90_MANNING_RECT BB ii nn > fnameW
f90_MANNING_CIRCCompiled F90 program for circular cross section
f90_MANNING_RECTCompiled F90 program for rectangular cross section
fnameW Output file name (text file)
DD Diameter of circular waterway
BB Width of rectarngular waterway
ii Gradient of invert
nn Manning's roughness coefficient

Source code by f90

FilenameDescription
Program to obtain the H-Q relationship of circular cross section
Program to obtain the H-Q relationship of rectangular cross section
Batch file for GMT execution (for circular cross section)
Batch file for GMT execution (for rectangular cross section)
Output image file (circular cross section)
Output image file (rectangular cross section)


Run-off analysis using Storage Function method (1)

Outline of this program

Bach command for execution

gfortran -o f90_SFM.exe f90_SFM.f90

f90_SFM dat_sfm1.csv out_test1.csv 3 1 10
f90_SFM dat_sfm2.csv out_test2.csv 3 1 10
f90_SFM dat_sfm3.csv out_test3.csv 4 1 10
f90_SFM dat_sfm4.csv out_test4.csv 2 1 10
f90_SFM dat_sfm5.csv out_test5.csv 2 1 10
f90_SFM dat_sfm6.csv out_test6.csv 8 1 10

call bat_gmt_ctl_qcss
call bat_gmt_ctl_sfm

The format of command line arguments are shown below.

f90_SFM fnameR fnameW n1 m md
f90_SFMCompiled F90 program for storage function method
fnameR Input file name (text file)
fnameW Output file name (text file)
n1 Starting point of separation of base run-off
m Value to specify the separation method of run-off (0: horizontal separation [constant value], 1: using sloped line[optimal ending point is searced])
md Number of division of time increment (integer which shall be greater than or equal to one)

Source code by f90 and related documents

FilenameDescription
F90 program for storage function method
Input data example (1)
Input data example (2)
Input data example (3)
Input data example (4)
Input data example (5)
Input data example (6)
Batch file for GMT to make q-S relationship (for control)
Batch file for GMT to make q-S relationship (for drawing commands)
Batch file for GMT to make hydrograph (for control)
Batch file for GMT to make hydrograph (for drawing commands)
Document of theory and examples


Run-off analysis using Storage Function Method (2)

Outline of this program

Bach command for execution

gfortran -o f90_SFMQ.exe f90_SFMQ.f90

f90_SFMQ dat_sfm1Q.csv out_test1Q.csv 10

call bat_gmt_ctl_sfmQ

The format of command line arguments are shown below.

f90_SFMQ fnameR fnameW md
f90_SFMQCompiled F90 frogram for estimation of hydrograph
fnameR Input file name
fnameW Output file name
md Number of division of time increment (integer which shall be greater than or equal to one)

Source code by f90 and related documents

FilenameDescription
F90 program for estimation of hydrograph
Input data sample
Batch file for GMT to make hydrograph (for control)
Batch file for GMT to make hydrograph (for drawing commands)
Output sample graph


Seismic Response Spectrum using Runge-Kutta method

Outline of this program

Bach command for execution

gfortran -o f90_ARS_RUNGE.exe f90_ARS_RUNGE.f90

f90_ARS_RUNGE dat_acc_TCGH16_EW2.csv dat_spc_TCGH16_EW2.csv
f90_ARS_RUNGE dat_acc_TCGH16_NS2.csv dat_spc_TCGH16_NS2.csv
f90_ARS_RUNGE dat_acc_TCGH16_UD2.csv dat_spc_TCGH16_UD2.csv

The format of command line arguments are shown below.

f90_ARS_RUNGE fnameR fnameW
f90_ARS_RUNGECompiled F90 program
fnameR Input file name
fnameW Output file name

Source code by f90 and related documents

FilenameDescription
program for calculating response spectrum by Runge-Kutta method
Input data sample (1)
Input data sample (2)
Input data sample (3)
Output data sample (1)
Output data sample (2)
Output data sample (3)
Document


Stress calculation of Reinforced Concrete cross section

Outline of this program

Bach command for execution

Stress calculation for RC against pure bending

gfortran -o f90_RCmSD.exe f90_RCmSD.f90

rem iflag hh bb dd_t dd_c As_t As_c  MO
f90_RCmSD 1 7.5 25 2.5 0.0 3.925 0.0 8013

The format of command line arguments are shown below.

f90_RCmSD iflag hh bb dd_t dd_c As_t As_c MO
f90_RCmSD Compiled F90 frogram
iflag 1: Single reinforcement, 2: Double reinforcements
hh, bb Total height and width of RC section
dd_t, dd_c Distance between Tensile re-bar and tensile edge, or Compressive re-bar and compressive edge
As_t, As_c Section area of Tensile re-bar, or Compressive re-bar
MO Moment (value shall be positive)

Stress calculation for RC against bending and tensile axial force

gfortran -o f90_RCmntD.exe f90_RCmntD.f90

rem hh bb dd_t dd_c As_t As_c MO AF
f90_RCmntD 350 1000 60 60 1570 1570 140000000 160000

The format of command line arguments are shown below.

f90_RCmntD hh bb dd_t dd_c As_t As_c MO AF
f90_RCmntD Compiled F90 frogram
hh, bb Total height and width of RC section
dd_t, dd_c Distance between Tensile re-bar and tensile edge, or Compressive re-bar and compressive edge
As_t, As_c Section area of Tensile re-bar, or Compressive re-bar
MO Moment (value shall be positive)
AF Tensile axial force (value shall be positive)

Source code by f90 and related documents

FilenameDescription
F90 program for estimation of stresses against pure bending
F90 program for estimation of stresses against bending and tensile axial force


Stress calculation of RC Circular Pressure Tunnel

Outline of this program

Bach command for execution

gfortran -o f90_CPT.exe f90_CPT.f90

f90_CPT inp_CPT_comp.csv out_CPT_comp.csv
f90_CPT Compiled f90 program
inp_CPT_comp.csvInput data filename
out_CPT_comp.csvOutput data filename

Source code by f90 and related documents

FilenameDescription
f90 program code for stress calculation of RC Circular Pressure Tunnel
Example of input data
Example of output data
Document for theory of calculation
Document of study on RC Circular Pressure Tunnel by FEM


Non Uniform Flow analisys for Subcritical flow

Outline of this program

Program for data input

    call getarg(1,dummy1)
    call getarg(2,dummy2)
    call getarg(3,dummy3)
    call getarg(4,fnameR)

    read(dummy1,*) icase
    read(dummy2,*) Q0
    read(dummy3,*) h0

    open(11,file=fnameR,status='old')
    read(11,*) nd
    do i=1,nd
        read(11,'()')
        read(11,*) k,xx(i),zz(i),nas(i),ninp(i)
        do j=1,nas(i)
            read(11,*) hh(i,j),area(i,j),wper(i,j),wids(i,j)
        end do
    end do
    close(11)
nd Number of the section calculated
k Section No.(arbitrary)
xx(i) Horizontal distance from starting point of calculation
zz(i) Elevation of river bed
nas(i) Number of input for the relationship between depth and section area
ninp(i) Roughness coefficient
hh(i,j) Water depth in the perpendicular direction to the river bed
area(i,j) Section area of flow at the specified water depth
wper(i,j) Wetted perimeter at the specified water depth
wids(i,j) Width of Water surface at the specified water depth

The sequence of the section shall be from starting point of calculation to end point. In this case, the sequence of section shall be from downstream to upstream because of Subcritical flow.

Batch commands for execution

gfortran -o f90_NUF.exe f90_NUF.f90

f90_NUF 10 430.92 1.958 inp_open.txt > outQ0430.txt
f90_NUF f90 program for execution compiled
10 icase=10: Subcritical flow, icase=20: Supercritical flow
430.92 Q0   : Discharge at starting point of calculation
1.9582 h0   : Water depth at starting point of calculation
inp_open.txtfnameR : Input data file name
outQ0430.txtOutput data file name

Items for output

x1 Horizontal distance from starting point of calculation
Q1 Discharge
a1 Section area of flow
t1 Width of water surface
h1 Water depth in the perpendicular direction to the river bed
z1 Elevetion of river bed
h1+z1 Elevation of water surface
v1 Mean velocity of flow
E1 Total head of energy (including the dynamic head)
Fr Froude number
hc Critical depth in the perpendicular direction to the river bed
it Count of iteration for convergence

Source code by f90 and related documents

FilenameDescription
Source code of the program for non unuform flow analysis
Sample of input data
Sample of output data
Sample of useage of this program


Flood Routine Analysis

Outline of this program

Batch command for execution and format of Input and Output

gfortran -o f90_floodr.exe f90_floodr.f90

f90_floodr inp_kusan_hv.txt inp_kusan_pmf_0.txt > test0.txt
f90_floodr inp_kusan_hv.txt inp_kusan_pmf_1.txt > test1.txt

Format of batch file for execution

f90_floodr fnameR1 gnameR2 > fnameW
f90_floodr Compiled program for execution
fnameR1 Input data (H-V curve of reservoir)
fnameR2 Input data (Inflow data)
fnameW Output data

Format of input data (H-V curve of reservoir)

vcoef
rh(1)  rv(1)
rh(2)  rv(2)
rh(3)  rv(3)
...    ...
vcoef Coefficient multiplied to the volume
rh(i) Water level
rv(i) Cumulative volume / vcoef

Format of input data (inflow)

ELini  outlet
ti(1)  q_in(1)
ti(2)  q_in(2)
ti(3)  q_in(3)
...    ...
ELini Initial water level (EL.m)
outlet Discharge from outlet (constant) (m3/s)
ti(i) time (hour)
q_in(i)Inflow (m3/s) / vcoef

Items for output

i Step no.
iUD Index for up-down of reservoir water level(1: up, -1: down)
ti Time (hour)
EL reservoir water level (EL.m)
EL-elv error of water level (m)
VOL Cumulative volume of reservoir (m3)
q_in Inflow (m3/s)
q_out Outflow (m3/s)

Source code by f90 and related documents

File nameDescription
Source code of program
Sample input data (H-V curve of reservoir)
Sample input data (1) (Inflow data)
Sample input data (2) (Inflow data)
GMT script for drawing
awk script to draw a legend
Sample drawing (1)
Sample drawing (2)

toJA
inserted by FC2 system