Beruflich Dokumente
Kultur Dokumente
Holtrop’s Method
Applied Programming I
To use this program unit four guide book Applied programmming I [1].
In this dialog box I prepare, contains the following elements:
button
check box
edit control
group box
radio button
static tex t, and
Control picture
Messageboxes
SeudoCodigo
Main Program.F90
program res
use dflogm
include 'resource.fd'
external sub1 ,sub2, sub3
logical retlog,log
type (dialog)dlg
retlog=dlgset(dlg,idc_list2,3,dlg_numitems)
retlog=dlgset(dlg,idc_list2,"1 V-shaped section",1)
retlog=dlgset(dlg,idc_list2,"2 Normal Secction Shape",2)
retlog=dlgset(dlg,idc_list2,"3 U-shaped section with Hogner stern",3)
!list box set
retlog=dlgset(dlg,idc_check1,.false.)
retlog=dlgset(dlg,idc_check2,.false.)
retlog=dlgset(dlg,idc_check3,.false.)
retlog=dlgset(dlg,idc_check4,.false.)
retlog=dlgset(dlg,idc_check5,.false.)
retlog=dlgset(dlg,idc_check6,.false.)
retlog=dlgset(dlg,idc_check7,.false.)
retlog=dlgset(dlg,idc_check8,.false.)
retlog=dlgset(dlg,idc_check9,.false.)
retlog=dlgset(dlg,idc_check10,.false.)
retlog=dlgset(dlg,idc_check11,.false.) !check box set
i=dlgsetsub(dlg,idc_button1,sub1) !botton 1
i=dlgsetsub(dlg,idc_radio1,sub2) !radio1
i=dlgsetsub(dlg,idc_radio2,sub2) !radio2
i=dlgsetsub(dlg,idc_button2,sub3) !botton calculate
i=dlgmodal(dlg)
stop
end program res
Sub1 Reader.F90
subroutine sub1(dlg,idexecute,dlg_clicked)
use dflogm
use dflib
include 'resource.fd'
type (dialog)dlg
logical retlog, ok1, ok2, ok3, ok4, ok5, ok6, ok7, ok8, ok9, ok10,
ok11
common/val/q1,q2
common /values/ vel, leng, brt, tf, ta, cp, i2
!*********************************************************************
*********
character *100 put,datfile,nameship, lnt, lepp, br, dfp, dap, vol,
lcbb, tat, ssw, cbb, cmm, cww, &
cpp, angle, speed, tbt, chb, wden, kvis, skeg, stern, twin, shaft, sk,
strut, hu, sh, fn, dm, bilge
!*********************************************************************
*********
real leng, lpp, lc
!*********************************************************************
*********
if(q1.eq.0.and.q2.eq.3)then
retlog = dlgget(dlg,idc_edit2,datfile)
open(6, file=datfile)
retlog = dlgget(dlg,idc_edit1,nameship)
if (nameship.eq.'')then
retlog=messageboxqq('Name the Ship value missing'c,'Error
1'c,mb$iconexclamation.or.mb$ok)
!_____________________________________________________________________
____________
retlog = dlgget(dlg,idc_list3,i2,1)
if(i2.eq.1)then
write(6,10)
10 format('1 Bulk Carrier / Oil Tanker',20x,'Type of the
ship')
else if(i2.eq.2)then
write(6,20)
20 format('2 Tug Boat / Coaster',14x,'Type of the ship')
else if(i2.eq.3)then
write(6,30)
30 format('3 Container Ship / Fast Freighter',14x,'Type of the
ship')
else if(i2.eq.4)then
write(6,40)
40 format('4 Fast Freighter',14x,'Type of the ship')
else if(i2.eq.5)then
write(6,50)
50 format('5 Roll On / Roll off / Ferriers',14x,'Type of the
ship')
end if
write(*,*)i2
!_____________________________________________________________________
_____________
retlog = dlgget(dlg,idc_edit3,lnt)
if (lnt.eq.'')then
retlog=messageboxqq('L value missing'c,'Error
2'c,mb$iconexclamation.or.mb$ok)
else
read(lnt,*,err=10000)leng
write(6,60)leng
60 format(f7.3,24x,'Lenght [m]')
end if
retlog = dlgget(dlg,idc_edit4,lepp)
if (lepp.eq.'')then
retlog=messageboxqq('Lpp value missing'c,'Error
3'c,mb$iconexclamation.or.mb$ok)
else
read(lepp,*,err=10000) lpp
write(6,70)lpp
70 format (f7.3,24x,'Length between perpendiculars [m]')
end if
retlog = dlgget(dlg,idc_edit5,br)
if (br.eq.'')then
retlog=messageboxqq('Breadth value missing'c,'Error
4'c,mb$iconexclamation.or.mb$ok)
else
read(br,*,err=10000)brt
write(6,80)brt
80 format(f7.3,24x,'Breadth [m]')
end if
retlog = dlgget(dlg,idc_edit7,dap)
if(dap.eq.'')then
retlog=messageboxqq('ta value missing'c,'Error
6'c,mb$iconexclamation.or.mb$ok)
else
read(dap,*,err=10000) ta
write(6,100)ta
100 format(f7.3,24x,'Draught moulded on A.P [m]')
end if
retlog = dlgget(dlg,idc_edit8,vol)
if(vol.eq.'')then
retlog=messageboxqq('V value missing'c,'Error
7'c,mb$iconexclamation.or.mb$ok)
else
read(vol,*,err=10000)v
write(6,110)v
110 format(f7.3,24x,'Displacement volume moulded [m³]')
end if
retlog = dlgget(dlg,idc_edit9,lcbb)
if(lcbb.eq.'')then
retlog=messageboxqq('LCB value missing'c,'Error
8'c,mb$iconexclamation.or.mb$ok)
else
read(lcbb,*,err=10000) lcb
write(6,120)lcb
120 format(f7.3,24x,'Longitudinal position of the centre bouyancy
forward [m]')
end if
retlog = dlgget(dlg,idc_edit10,tat)
if(tat.eq.'')then
retlog=messageboxqq('At value missing'c,'Error
9'c,mb$iconexclamation.or.mb$ok)
else
read(tat,*,err=10000)at
write(6,130)at
130 format(f7.3,24x,'Tramsom area [m²]')
end if
retlog = dlgget(dlg,idc_edit11,ssw)
if(ssw.eq.'')then
retlog=messageboxqq('Sw value missing'c,'Error
10'c,mb$iconexclamation.or.mb$ok)
else
read(ssw,*,err=10000) sw
write(6,140)sw
140 format(f7.3,24x,'wetted area [m²]')
end if
retlog = dlgget(dlg,idc_edit12,cbb)
retlog = dlgget(dlg,idc_edit13,cmm)
if(cmm.eq.'')then
retlog=messageboxqq('Cm value missing'c,'Error
12'c,mb$iconexclamation.or.mb$ok)
else
read(cmm,*,err=10000) cm
write(6,160)cm
160 format(f7.3,24x,'Midship section coefficient')
end if
retlog = dlgget(dlg,idc_edit14,cww)
if(cww.eq.'')then
retlog=messageboxqq('Cw value missing'c,'Error
13'c,mb$iconexclamation.or.mb$ok)
else
read(cww,*,err=10000) cw
write(6,170)cw
170 format(f7.3,24x,'Waterplane area coefficient')
end if
retlog = dlgget(dlg,idc_edit15,cpp)
if(cpp.eq.'')then
retlog=messageboxqq('Cp value missing'c,'Error
14'c,mb$iconexclamation.or.mb$ok)
else
read(cpp,*,err=10000) cp
write(6,180)cp
180 format(f7.3,24x,'Prismatic coefficient')
end if
!_____________________________________________________________________
________
retlog = dlgget(dlg,idc_list2,i1,1)
if(i1.eq.1)then
write(6,190)
190 format ('-10.0',24x,'Cstern; V-shaped secction')
else if(i1.eq.2)then
write(6,200)
200 format(' 0.0',24x,'Cstern; Normal secction shape')
else if(i1.eq.3)then
write(6,210)
210 format(' 10.0',24x,'Cstern; U-shaped secction with Hogner
stern')
end if
!_____________________________________________________________________
________
retlog = dlgget(dlg,idc_edit16,angle)
if(angle.eq.'')then
retlog=messageboxqq('Angle value missing'c,'Error
15'c,mb$iconexclamation.or.mb$ok)
else
read(angle,*,err=10000)ei
write(6,220)ei
retlog = dlgget(dlg,idc_edit32,speed)
if(speed.eq.'')then
retlog=messageboxqq('Velocity value missing'c,'Error
16'c,mb$iconexclamation.or.mb$ok)
else
read(speed,*,err=10000)vel
write(6,230)vel
230 format(f7.3,24x,'Speed of the ship [Knots]')
end if
retlog = dlgget(dlg,idc_edit17,tbt)
if(tbt.eq.'')then
retlog=messageboxqq('Bt value missing'c,'Error
17'c,mb$iconexclamation.or.mb$ok)
else
read(tbt,*,err=10000)bt
write(6,240)bt
240 format(f7.3,24x,'Transverse Bulb Area [m²]')
end if
retlog = dlgget(dlg,idc_edit18,chb)
if(chb.eq.'')then
retlog=messageboxqq('hb value missing'c,'Error
18'c,mb$iconexclamation.or.mb$ok)
else
read(chb,*,err=10000) hb
write(6,250)hb
250 format(f7.3,24x,'Centre of bulb area above keel line [m]')
end if
retlog = dlgget(dlg,idc_edit30,wden)
if(wden.eq.'')then
retlog=messageboxqq('Density water value missing'c,'Error
19'c,mb$iconexclamation.or.mb$ok)
else
read(wden,*)wd
write(6,260)wd
260 format(f7.3,24x,'Density of the water [Kg/m³]')
end if
retlog = dlgget(dlg,idc_edit31,kvis)
if(kvis.eq.'')then
retlog=messageboxqq('Kinematic Viscosity value missing'c,'Error
20'c,mb$iconexclamation.or.mb$ok)
else
read(kvis,*,err=10000) visc
write(6,270)visc
270 format(f7.3,24x,'kinematic viscosity [m²/s]')
end if
!check------------------------------------------------------------
-----------------
retlog = dlgget(dlg,idc_check1,ok1)
if(ok1)then
retlog = dlgget(dlg,idc_edit19,skeg)
read(skeg,*,err=10000)rskeg
else
rskeg=0
end if
write(6,280)rskeg
retlog = dlgget(dlg,idc_check2,ok2)
if (ok2)then
retlog = dlgget(dlg,idc_edit20,stern)
read(stern,*,err=10000)rstern
else
rstern=0
write(6,290)rstern
290 format(f7.3,24x,'Rudder behind stern [m²]')
end if
retlog = dlgget(dlg,idc_check3,ok3)
if(ok3)then
retlog = dlgget(dlg,idc_edit21,twin)
read(twin,*,err=10000) rtwin
else
rtwin=0
write(6,300)rtwin
300 format(f7.3,24x,'Twin-screw balance rudders [m²]')
end if
retlog = dlgget(dlg,idc_check4,ok4)
if(ok4)then
retlog = dlgget(dlg,idc_edit22,shaft)
read(shaft,*,err=10000)shaftb
else
shaftb=0
write(6,310)shaftb
310 format(f7.3,24x,'Shaft brackets [m²]')
end if
retlog = dlgget(dlg,idc_check5,ok5)
if (ok5)then
retlog = dlgget(dlg,idc_edit23,sk)
read(sk,*,err=10000) skegg
else
skegg=0
write(6,320)skegg
320 format(f7.3,24x,'skeg [m²]')
end if
retlog = dlgget(dlg,idc_check6,ok6)
if(ok6)then
retlog = dlgget(dlg,idc_edit24,strut)
read(strut,*,err=10000) strutb
else
strutb=0
write(6,330)strutb
330 format(f7.3,24x,'strut bossings [m²]')
end if
retlog = dlgget(dlg,idc_check7,ok7)
if (ok7)then
retlog = dlgget(dlg,idc_edit25,hu)
read(hu,*,err=10000)hull
else
hull=0
write(6,340)hull
340 format(f7.3,24x,'hull bossings [m²]')
end if
retlog = dlgget(dlg,idc_check9,ok9)
if(ok9)then
retlog = dlgget(dlg,idc_edit27,fn)
read(fn,*,err=10000) fins
else
fins=0
write(6,360)fins
360 format(f7.3,24x,'stabilizer fins [m²]')
end if
retlog = dlgget(dlg,idc_check10,ok10)
if(ok10)then
retlog = dlgget(dlg,idc_edit28,dm)
read(dm,*,err=10000) dome
else
dome=0
write(6,370)dome
370 format(f7.3,24x,'dome [m²]')
end if
retlog = dlgget(dlg,idc_check11,ok11)
if(ok11)then
retlog = dlgget(dlg,idc_edit29,bilge)
read(bilge,*,err=10000) bg
else
bg=0
write(6,380)bg
380 format(f7.3,24x,'bilge keels [m²]')
end if
else if(q1.eq.1.and.q2.eq.2)then
retlog = dlgget(dlg,idc_edit34,put)
open(1,file=put,status='old',err=3000)
read(1,*)nameship
write(nameship,*)nameship
retlog = dlgset(dlg,idc_edit1,nameship)
read(1,*)i2
read(1,*)lpp
write(lepp,*)lpp
retlog = dlgset(dlg,idc_edit4,lepp)
read(1,*)leng
write(lnt,*)leng
retlog = dlgset(dlg,idc_edit3,lnt)
read(1,*)brt
write(br,*)brt
retlog = dlgset(dlg,idc_edit5,br)
read(1,*)tf
read(1,*)ta
write(dap,*)ta
retlog = dlgset(dlg,idc_edit7,dap)
read(1,*)v
write(vol,*)v
retlog = dlgset(dlg,idc_edit8,vol)
read(1,*)lcb
write(lcbb,*)lcb
retlog = dlgset(dlg,idc_edit9,lcbb)
read(1,*)at
write(tat,*)at
retlog = dlgset(dlg,idc_edit10,tat)
read(1,*)sw
write(ssw,*)sw
retlog = dlgset(dlg,idc_edit11,ssw)
read(1,*)cb
write(cbb,*)cb
retlog = dlgset(dlg,idc_edit12,cbb)
read(1,*)cm
write(cmm,*)cm
retlog = dlgset(dlg,idc_edit13,cmm)
read(1,*)cw
write(cww,*)cw
retlog = dlgset(dlg,idc_edit14,cww)
read(1,*)cp
write(cpp,*)cp
retlog = dlgset(dlg,idc_edit15,cpp)
read(1,*)i1
read(1,*)ei
write(angle,*)ei
retlog = dlgset(dlg,idc_edit16,angle)
read(1,*)vel
write(speed,*)vel
retlog = dlgset(dlg,idc_edit32,speed)
read(1,*)tb
write(tbt,*)tb
retlog = dlgset(dlg,idc_edit17,tbt)
read(1,*)hb
write(chb,*)hb
retlog = dlgset(dlg,idc_edit18,chb)
read(1,*)wd
write(wden,*)wd
retlog = dlgset(dlg,idc_edit30,wden)
read(1,*)visc
read(1,*)rskeg
write(skeg,*)rskeg
retlog = dlgset(dlg,idc_edit19,skeg)
read(1,*)rstern
write(stern,*)rstern
retlog = dlgset(dlg,idc_edit20,stern)
read(1,*)rtwin
write(twin,*)rtwin
retlog = dlgset(dlg,idc_edit21,twin)
read(1,*)shaftb
write(shaft,*)shaftb
retlog = dlgset(dlg,idc_edit22,shaft)
read(1,*)skegg
write(sk,*)skegg
retlog = dlgset(dlg,idc_edit23,sk)
read(1,*)strutb
write(strut,*)strutb
retlog = dlgset(dlg,idc_edit24,strut)
read(1,*)hull
write(hu,*)hull
retlog = dlgset(dlg,idc_edit25,hu)
read(1,*)sha
write(sh,*)sha
retlog = dlgset(dlg,idc_edit26,sh)
read(1,*)fins
write(fn,*)fins
retlog = dlgset(dlg,idc_edit27,fn)
read(1,*)dome
write(dm,*)dome
retlog = dlgset(dlg,idc_edit28,dm)
read(1,*)bg
write(bilge,*)bg
retlog = dlgset(dlg,idc_edit29,bilge)
close (1)
end if
return
10000 i1=messageboxqq('incorrect value'c,'Error
32'c,mb$iconexclamation.or.mb$ok)
3000 i2=messageboxqq('File not exist'c,'Error
32'c,mb$iconexclamation.or.mb$ok)
return
end
subroutine sub2(dlg,idexecute,dlg_clicked)
use dflogm
include 'resource.fd'
logical retlog,push
type(dialog)dlg
common/val/q1,q2
retlog = dlgget(dlg,idc_radio1,push)
if(push)then
q1 = 0
else
q1 = 1
end if
retlog = dlgget(dlg,idc_radio2,push)
if(push)then
q2 = 2
else
q2 = 3
end if
return
end
comparation.F90
subroutine sub3(dlg,idexecute,dlg_clicked)
use dflogm
use dflib
logical retlog
type (dialog)dlg
include 'resource.fd'
character *50 ext
common /values/ vel, leng, brt, tf, ta, cp, i2
real lb,leng
retlog=dlgget(dlg,idc_edit33,ext)
if(ext.eq.'')then
retlog=messageboxqq('File does exits'c,'Error
15'c,mb$iconexclamation.or.mb$ok)
else
open(6,file=ext)
end if
fn= (vel*0.5144)/sqrt(9.8*leng)
lb= (leng/brt)
bt= (brt/((tf+ta)/2))
if (i2.eq.1)then
if((fn.le.0.24).and.(lb.le.7.1).and.(lb.ge.5.1).and.(bt.ge.2.4).and.(b
t.le.3.2).and.(cp.ge.0.73).and.(cp.le.0.85))then
write(6,*)'This ship applied like a Bulk Carrier / Oil Tanker'
else
write(6,*)'This data don´t applied for this ship ´Bulk Carrier /
Oil Tanker´'
end if
else if (i2.eq.2)then
if((fn.le.0.38).and.(lb.ge.3.9).and.(lb.le.6.3).and.(bt.ge.2.1).and.(b
t.le.3.0).and.(cp.ge.0.55).and.(cp.le.0.65))then
write(6,*)'This ship applied like a Tug Boat / Coaster'
else
if((fn.le.0.45).and.(lb.ge.6.0).and.(lb.le.9.5).and.(bt.ge.3.0).and.(b
t.le.4.0).and.(cp.ge.0.55).and.(cp.le.0.67))then
write(6,*)'This ship applied like a Container Ship'
else
write(6,*)'This data don´t applied for this ship ´Container Ship´'
end if
else if (i2.eq.4)then
if((fn.le.0.30).and.(lb.ge.5.3).and.(lb.le.8.0).and.(bt.ge.2.4).and.(b
t.le.4.0).and.(cp.ge.0.56).and.(cp.le.0.75))then
write(6,*)'This ship applied like a Fast Freighter'
else
write(6,*)'This data don´t applied for this ship ´Fast Freighter´'
end if
else if (i2.eq.5)then
if((fn.le.0.35).and.(lb.ge.5.3).and.(lb.le.8.0).and.(bt.ge.3.2).and.(b
t.le.4.0).and.(cp.ge.0.55).and.(cp.le.0.67))then
write(6,*)'This ship applied like a Roll On / Roll off / Ferriers'
else
write(6,*)'This data don´t applied for this ship ´Roll On / Roll
off / Ferriers´'
end if
end if
return
end
Dialog Box
Picture1.-Resourse.rd(IDD_DIALOG1Dialog)
Bibliography:
When we talk about the plagiarism in our educational and professional process, it leads us to
many consequences, most of them negative for the academic development.
There are a lot of reasons that encourage students to use plagiarize information, either the lack
of time, itself-confidence or simply the facilities we have to do it.
Having a general environment where we can get any kind of information which is the internet,
eases the use of the data on the net. This is simpler and cheaper as it prevents students to go to
a library, take a book, read it and write in their own words the task assigned.
It's easy to say "everyone does it" when nowadays, that the vait majority of not to say all of
them, have networks to search and obtain information. But there are students who are more
honest and aware of what they do, using their resources as a support, for self-learning and
guidance. Unfortunately we can not say the same of everybody. Copy information from different
authors, has a huge influence in the values moral ethics, but now this can be a legal offense.
Now putting ourselves in the author’s shoes, plagiarism also affects them economically,
considering that dishonest people take advantage and manipulate their wax themselves even at
the expense of others that. Personally I would like my jobs is useful for everyone, but if they use
it to get their thesis grade’s or degrees, I would get upset, since got all they wanted on me
without any struggle, to create something their hands.
When we make a tack with sacrifice, whatever the result is we feel proud, because even though
we did not get the expected, it was done with all the potential we have and even better if we do
achieve our goals like our bachelor degree or other rewards. We spend hours and days working
is worthy at the end.
The law has strong penalties for those who plagiarize partially or totally. Graduating shouldn’t
enclose only the academics, but also of the moral and professional ethics.
Only we, the college students decided what to do, how to act and how to be successful in our
academic and professional lives. The awareness of a person who manages his own efforts to
succeed will be a thousand times over who decided to use plagiarism as the main weapon to
achieve some aims. Sooner or later these infringers pay the consequences of their actions, when
they go to work setting and live the reality of things.