program f90_DRAW_SURGE implicit none integer,parameter::NUMS=10 !Limit number of section definition points of Surge Tank character(len=256)::Title !Title real(4)::RWL !Water level at reservoir (EL) integer::NST !Number of sections real(4)::SEL(NUMS+2) !Level definition of sections of shaft (EL) character(len=50)::SLB(NUMS+1) !Label for section (text: for drawing) character(len=50)::fnameR,fnameW !Input file name, eps file name for output of figure real(4)::WLmax,TTmax,WLmin,TTmin !Memory of water levels and times at max.& mim water level real(4)::draw_xmin,draw_xmax,draw_dx !Drawing range of x-axis real(4)::draw_ymin,draw_ymax,draw_dy !Drawing range of y-axis real(4)::strdx; call getarg(1,fnameR) call getarg(2,fnameW) call INP_DATA(fnameR,draw_xmin,draw_xmax,draw_dx,draw_ymin,draw_ymax,draw_dy,strdx,& WLmax,TTmax,WLmin,TTmin,Title,RWL,NST,SEL,SLB) call MAKE_SCRIPT(fnameW,draw_xmin,draw_xmax,draw_dx,draw_ymin,draw_ymax,draw_dy,strdx,& WLmax,TTmax,WLmin,TTmin,Title,RWL,NST,SEL,SLB) call system('gnuplot "gpl_temp.txt"') stop contains subroutine INP_DATA(fnameR,draw_xmin,draw_xmax,draw_dx,draw_ymin,draw_ymax,draw_dy,strdx,& WLmax,TTmax,WLmin,TTmin,Title,RWL,NST,SEL,SLB) character(len=50),intent(in)::fnameR real(4),intent(out)::WLmax,TTmax,WLmin,TTmin !Memory of water levels and times at max.& mim water level real(4),intent(out)::draw_xmin,draw_xmax,draw_dx !Drawing range of x-axis real(4),intent(out)::draw_ymin,draw_ymax,draw_dy !Drawing range of y-axis real(4),intent(out)::strdx character(len=256),intent(out)::Title !Title real(4),intent(out)::RWL !Water level at reservoir (EL) integer,intent(out)::NST !Number of sections real(4),intent(out)::SEL(NUMS+2) !Level definition of sections of shaft (EL) character(len=50),intent(out)::SLB(NUMS+1) !Label for section (text: for drawing) integer::i,io,NQT character(len=50)::dummy real(4)::TMAX real(4)::ELB,ELU,wa,wb open(11,file=fnameR,status='old') read(11,'(a)') Title read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,*) dummy,TMAX read(11,'()') read(11,'()') read(11,'()') read(11,*) dummy,RWL read(11,*) dummy,dummy,NST read(11,'()') do i=1,NST read(11,*) dummy,dummy,SEL(i),SLB(i) end do read(11,*) dummy,dummy,NQT read(11,'()') do i=1,NQT read(11,'()') end do read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,'()') read(11,'()') ELB=SEL(1) !Bottom elevation of tank ELU=SEL(NST) !Top elevation of tank WLmax=ELB TTmax=0.0 WLmin=ELU TTmin=0.0 do read(11,*,iostat=io) wa,wb !if 'EOF' is found, exit if(io<0)exit if(WLmax