¿äÁò¿¡µµ ¹°¸®ÇÐÀÚ³ª ¼öÄ¡¿¬»ê°ú °ü·ÃµÈ Á÷Á¾¿¡¼
¿¬±¸ÇϽô ºÐµéÀº ´ëºÎºÐ Unix¸¦ ÀÌ¿ëÇÑ´Ù. Unix¸¦ ÀÌ¿ëÇÏ´Â °¡Àå
Å« ÀÌÀ¯´Â ½Ã½ºÅÛÀÇ ¾ÈÁ¤¼º°ú Ãâ·Â °ªÀÇ ½Å·Úµµ°¡ ³ô±â ¶§¹®ÀÌ´Ù.
ÀÌ·± ÀåÁ¡µéÀº Linuxµµ °¡Áö°í ÀÖ´Ù´Â »ç½ÇÀº ¸®´ª¼µéÀº Àß ¾Ë
°ÍÀÌ´Ù. ±×·¡¼ ÇÊÀÚ´Â Linuxµµ ÈǸ¢ÇÑ ¼öÄ¡ ¿¬»êÀ» ÇÒ ¼ö ÀÖ´Ù´Â
°ÍÀ» ¿©·¯ Ç÷§Æû¿¡ ¼³Ä¡µÇ¾î ÀÖ´Â Linux¸¦ °¡Áö°í ºñ±³/ºÐ¼®ÇÏ·Á°í
ÇÑ´Ù.
ºñ±³ ´ë»ó Ç÷§Æû ¹× »ç¿ëÇÒ ÄÄÆÄÀÏ·¯
Ç÷§Æû |
»ç¿ëÇÒ ÄÄÆÄÀÏ·¯ |
Sparc Solaris 2.5.1 (±âÁØ)
|
Sun Microsystem
Fortran77 |
Alpha Red Hat Linux 4.2 |
Fort77, Microway
NDP Fortran77 |
Sparc Red Hat Linux 4.2 |
Fort77, Sun
Microsystem Fortran77 |
Intel Red Hat Linux 4.2 |
GNU g77 |
Sparc Solaris¸¦ ±âÁØÀ¸·Î »ïÀº ÀÌÀ¯´Â
ÇöÀç °úÇаè»ê Ãâ·Â °ªÀÇ ´ëºÎºÐÀÌ Sparc Solaris/HPUX µî¿¡¼ ³ª¿Â
°ÍÀÌ ´ëºÎºÐÀ̱⠶§¹®ÀÌ´Ù. ±×¸®°í ÇöÀç ÀϺΠÀ¯¸í ´ëÇÐÀÇ ±³¼ö´Ôµéµµ
Sparc¿¡¼ ³ª¿Â °ªÀ» ´õ ½Å·ÚÇÏ´Â °æÇâÀÌ ÀÖ´Ù. ±×¸®°í Fort77Àº
Red Hat package¾È¿¡ µé¾î°¡ Àִµ¥, Fort77Àº f2c·Î ¿ì¼± Æ÷Æ®¶õ
¼Ò½º¸¦ C ¼Ò½º·Î º¯È¯ ½ÃÄÑÁÖ°í ³ª¸ÓÁö ¸µÅ©³ª ÄÄÆÄÀÏÀ» fort77ÀÌ
¸Ã´Â´Ù. ÀÚ¼¼ÇÑ ºÎºÐÀº manÆäÀÌÁö¸¦ ÀÌ¿ëÇϽðí ÀÌÁ¦ º»°ÝÀûÀ¸·Î
Ãâ·Â °ª¿¡ ´ëÇÑ ºñ±³¸¦ ÇÏ°Ú´Ù. Âü°í·Î ÇÊÀÚ´Â AlphaLinux¿¡¼ g77À»
»ç¿ëÇÏÁö ¾Ê¾Ò´Âµ¥, ±× ÀÌÀ¯´Â Alpha¿¡¼´Â g77ÀÇ performance°¡
³Ê¹« ¾È ÁÁ¾Æ¼ ±×·¸´Ù. ±×³É fort77À» »ç¿ëÇÏ´Â °ÍÀÌ ´õ ³ªÀ» °ÍÀÌ´Ù.
±×·¯³ª º¹ÀâÇÑ ¿¬»ê¿¡¼´Â fort77ÀÇ »ç¿ëÀ» »ï°¡ÇØ ÁÖ¼ÌÀ¸¸é ÇÑ´Ù.
1. ·±Áö-ÄíŸ ¹æ¹ý(Runge-Kutta Method)À» ÀÌ¿ëÇÑ
°á°ú ºñ±³
·±Áö-ÄíŸ ¹æ¹ýÀº ¹ÌºÐ ¹æÁ¤½ÄÀ» Ǫ´Â ¾Ë°í¸®Áò
Áß¿¡¼ °¡Àå ³Î¸® ÀÌ¿ëµÇ´Â ¹æ¹ýÀÌ´Ù. ÇÊÀÚ´Â Á¤È®µµ°¡ ¼Ò¼öÁ¡ 6ÀÚ¸®±îÁö
À¯È¿ÇÑ 4Â÷ ·±Áö-ÄíŸ ¾Ë°í¸®ÁòÀ» »ç¿ëÇÏ°Ú´Ù.
k1 = hf(xn,yn) k2 = hf(xn+1/2h,yn+1/2k1) k3 = hf(xn+1/2h,yn+1/2k2) k4 = hf(xn+h,yn+k3) yn+1 = yn+1/6(k1+2k2+2k3+k4)+O(h5)
f´Â function, Áï ÇÔ¼ö¸¦ ¶æÇϸç, h´Â °¢ Á¤ÀÇ¿ªÀÇ
°£°ÝÀ» ¶æÇÑ´Ù. O(h5)´Â Å×ÀÏ·¯ Àü°³¿¡ µû¸¥ 5Â÷ ÀÌ»ó Ç×µéÀ» ¹«½ÃÇÑ´Ù´Â
¶æÀÌ´Ù. (¾î·Á¿î ¸»À» »ç¿ëÇؼ Á˼ÛÇÕ´Ï´Ù.)
¿©±â¼ ¿ì¸®´Â ÄÄÇ»ÅÍ°¡ ÀúÁö¸£´Â ¾öû³ ½Ç¼ö¸¦
°¨¾ÈÇÏ¿©¾ß ÇÑ´Ù. ÇöÁ¸ÇÏ´Â ¸ðµç ÄÄÇ»Å͵éÀº ¾ÆÁÖ ÀÛÀº °ªÀ» Å«
°ªÀ¸·Î ³ª´©°Å³ª °öÇÒ ¶§, ¶Ç´Â ÀÛÀº °ªÀ» °¡Áö°í ÀÖ´Â µ¥ÀÌÅ͵éÀ»
Å« °ªÀ» °¡Áö´Â µ¥ÀÌÅ͵é°ú °°ÀÌ ´Ù·ê ¶§ ¹«½ÃÇÒ ¼ö ¾ø´Â ¿ÀÂ÷°¡
³ª¿Â´Ù. ¿¹¸¦ µé¾î ¼³¸íÇÏ°Ú´Ù. ¼Ò¼ö 5ÀÚ¸®±îÁö µ¥ÀÌÅ͸¦ ¾ò´Â ÇÁ·Î±×·¥À»
ÀÛ¼ºÇß´Ù°í ÇÏÀÚ. óÀ½ °è»ê¿¡´Â ±× °ªÀ» ½Å·ÚÇÒ ¼ö ÀÖ´Ù. ±×·¯³ª
°è»êÀ» ¹Ýº¹Çϸé ÇÒ¼ö·Ï ¼Ò¼ö 6ÀÚ¸®¿¡ ³²¾ÆÀÖ´ø ºÎºÐÀÌ ½ÇÁ¦ µ¥ÀÌÅÍ¿¡
¿µÇâÀ» ¹ÌÄ¡±â ½ÃÀÛÇÑ´Ù. Ƽ²ø ¸ð¾Æ Å»êÀ̶ó´Â ¼Ó´ãÀÌ ÀÖµíÀÌ,
0.0000000001À» 100¸¸¹ø ¿¬»êÀ» ÇÏ¸é ¾ÕÀÇ °ªÀº 100¸¸¹ø ´õÇØÁö°Å³ª
»©Á®¼ ¿øÇÏ´Â Ãâ·Â °ªÀ» ¾òÁö ¸øÇÒ ¼ö ÀÖ´Ù. ¾ÕÀ¸·Î ºñ±³ÇÒ Ãâ·Â
°ªµéÀº Solaris¿¡¼ ¿ÀÂ÷À²ÀÌ Á¦ÀÏ ÀûÀº °ªÀ» ±âÁØÀ¸·Î Linux¿¡¼
³ª¿Â °ªµéÀ» ºñ±³ÇØ ³ª°¥ °ÍÀÓÀ» ¹Ì¸® ¾Ë·ÁµÐ´Ù. ´ÙÀ½ÀÇ ¼Ò½º´Â
·±Áö-Äퟸ¦ ÀÌ¿ëÇÑ Oscillation ÀûºÐ¿¡ °üÇÑ °ÍÀÌ´Ù. wÀÇ ÀϹÝÀûÀÎ
Á¶°ÇÀº Damped OscillationÀ» µû¸£°í ÀÖ´Ù. ¼Ò½º¿¡ ´ëÇÑ ºÐ¼®Àº
»ý·«ÇÏ°Ú´Ù. ±×·¯³ª °£´ÜÇÑ ÇÁ·Î±×·¥À̹ǷΠ½±°Ô ºÐ¼®ÇÒ ¼ö ÀÖ´Ù.
f(t,v,x,r)=v
g(t,v,x,r)=-r*v-x
20 print*,'enter value of w' read*,w
if(w .le. 0.)
stop r=w
h=0.01 nstep=10./h
v=0 x=2.5
do 10 it=0,
nstep-1 t=it*h
aa=h*f(t,v,x,r)
ba=h*g(t,v,x,r)
ab=h*f(t+0.5*h,v+0.5*ba,x+0.5*aa,r)
bb=h*g(t+0.5*h,v+0.5*ba,x+0.5*aa,r)
ac=h*f(t+0.5*h,v+0.5*bb,x+0.5*ab,r)
bc=h*g(t+0.5*h,v+0.5*bb,x+0.5*ab,r)
ad=h*f(t+h,v+bc,x+ac,r)
bd=h*g(t+h,v+bc,x+ac,r)
v=v+(ba+2*bb+2*bc+bd)/6
x=x+(aa+2*ab+2*ac+ad)/6
print*,t,x
10 continue goto20
end
Ãâ·Â°ªÀ» GNUplotÀ» ÀÌ¿ëÇÏ¿© plotÇÏ¿´´Ù.
¿©±â¼, data1Àº w=1.5, data2´Â w=1.0, data3´Â w=0.75, data4´Â
w=0.50, data5´Â w=0.25·Î frequency¸¦ ³õ¾Ò´Ù. °¢ ±×·¡ÇÁ´Â
´«À¸·Î º¸¾Æ¼ °ÅÀÇ Â÷ÀÌ°¡ ¾ø´Ù.
¡ß °¢ µ¥ÀÌÅÍ °ª ºñ±³
data1ÀÇ °ª¸¸À» ListÇÏ°Ú´Ù. (Áö¸é °ü°è»ó ¸ðµÎ
ListÇÒ ¼ö ¾øÀ½À» ¾çÁöÇØÁÖ¼¼¿ä^^;)
¤¡)Solaris |
¤¤)SparcLinux
f77(Sun) |
¤§)SparcLinux
fort77 |
0. 2049988
1.00000E-02 2.49950 2.00000E-02 2.49889
3.00000E-02 2.49804 4.00000E-02 2.49695
5.00000E-02 2.49563 6.00000E-02 2.49409
7.00000E-02 2.49231 8.00000E-02 2.49032
9.00000E-02 2.48811 1.00000E-01 2.48569
|
0. 2.49988
1.00000E-02 2.49950 2.00000E-02 2.49889
3.00000E-02 2.49804 4.00000E-02 2.49695
5.00000E-02 2.49563 6.00000E-02 2.49409
7.00000E-02 2.49231 8.00000E-02 2.49032
9.00000E-02 2.48811 1.00000E-01 2.48569
|
0. 2.49987555
.00999999978 2.4995048 .0199999996 2.49889159
.0299999993 2.49803948 .0399999991
2.49695206 .049999997 2.49563313
.0599999987 2.49408603 .0700000003
2.49231458 .0799999982 2.49032211
.0899999961 2.48811197 .099999994
2.48568797 |
¤©)AlphaLinux
fort77 |
¤±)AlphaLinux
NDP fortran77 |
¤²)IntelLinux
GNU g77 |
0. 2.49987555
.00999999978 2.4995048 .0199999996 2.49889159
.0299999993 2.49803948 .0399999991
2.49695206 .049999997 2.49563313
.0599999987 2.49408603 .0700000003
2.49231458 .0799999982 2.49032211
.0899999961 2.48811197 .099999994
2.48568797 |
0.0000000E+000 2.499876
9.9999998E-03 2.499505 2.0000000E-02
2.498892 2.9999999E-02 2.498039
3.9999999E-02 2.496952 4.9999997E-02
2.495633 5.9999999E-02 2.494086
6.9999993E-02 2.492315 7.9999998E-02
2.490322 8.9999996E-02 2.488112
9.9999994E-02 2.485688 |
0. 2.49987555
0.00999999978 2.4995048 0.0199999996 2.49889159
0.0299999993 2.49803948 0.0399999991
2.49695206 0.049999997 2.49563313
0.0599999987 2.49408603 0.0700000003
2.49231458 0.0799999982 2.49032211
0.0899999961 2.48811197 0.099999994
2.48568797 |
À§ÀÇ List¸¦ º¸¸é ¼Ò¼ö À¯È¿ °ª°ú ¹Ý¿Ã¸²¿¡
´ëÇÑ Ç¥ÇöÀÇ Â÷À̸¸ ÀÖÀ» »Ó, °á°ú °ªÀÇ Å« º¯È´Â ¾ø´Ù. ¾Æ½Ã´Â
ºÐÀº ¾Æ½Ã°ÚÁö¸¸, À§ÀÇ Wave functionÀº °ø¾÷¼öÇÐÀÇ ±âÃÊÆí¸¸ °øºÎÇϽÅ
ºÐÀ̶ó¸é °£´ÜÈ÷ Ç® ¼ö ÀÖ´Â ¹®Á¦ÀÌ´Ù. ÀÌÁ¦ Á» ´õ º¹ÀâÇÑ functionÀ¸·Î
Test Çغ¸ÀÚ.
2. Bessel ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¼Ò½º °á°ú ºñ±³
Bessel ÇÔ¼ö¿¡ ´ëÇÑ °£·«ÇÑ ¼³¸íÀº ÇÇÇÏ°Ú´Ù.
(¾Ë°í ½ÍÀ¸½Å ºÐÀº °ø¾÷¼öÇп¡¼ ã¾Æ º¸¼¼¿ä.) Bessel ÇÔ¼ö
Jn(x)´Â x2af2f(x)/dr2+xdf(x)/dx+(x2-n2)f(x)=0ÀÇ ¹ÌºÐ ¹æÁ¤½ÄÀ» ¸¸Á·ÇÑ´Ù. ÇÑÆí À̵éÀº J0'(x)=-J1(x), Jn-1(x)=n/rJn(x)+Jn'(x) (n=1,2,3,...) ÀÇ Ãʱâ Á¶°ÇÀ» »ç¿ëÇÏ¿© xÀÇ °ªÀÌ
[1,20] ³»ÀÇ Bessel ÇÔ¼ö J0(1)=0.7651977, J1(1)=0.4400506, J2(1)=0.1149034849,
J3(1)=0.0195634 AlphaLinux¿¡¼´Â fort77 ÄÄÆÄÀÏ·¯¿¡¼ ´ÙÀ½°ú
°°Àº ¿¡·¯ ¸Þ¼¼Áö¸¦ Ãâ·ÂÇÏ°í ÄÄÆÄÀÏÀ» ÇÏÁö ¸øÇÏ¿´´Ù.
C Find the Bessel functions
by solving the diff equations parameter(nvat=4,nstep=150)
dimension vstart(nvar) common
/PATH/x(200),y(10,200) external
derivs x1=1 vstart(1)=0.7651976
vstart(2)=0.4400506 vstart(3)=1.149034849E-01
vstart(4)=0.0195634 x2=0
call rkdumb(vstart,nvar,x1,x2,nstep,derivs)
c write(*,'(/1x,t9,a,t17,a/')'X','Integrated
BESSJ3'
do 10
i=nstep,1,-1 j=i
write(*,'(/1x,f10,4,2x,f12,6)')x(j),y(4,j)
10 continue end
subroutine
derivs(x,y,dydx) dimension
y(*),dydx(*) dydx(1)=-y(2)
dydx(2)=(y(1)-(1.0/x)*y(2))
dydx(3)=(y(2)-(2.0/x)*y(3))
dydx(4)=(y(3)-(3.0/x)*y(4))
return end
subroutine
rkdumb(vstart,nvar,x1,x2,nstep,derivs) integer
nstep,nvar,nmax,nstpmx parameter
(nmax=10,nstpmx=200) real
x1,x2,vstart(nvar),xx(nstpmx),y(nmax,nstpmx) external
derivs common /PATH/xx,y
cu uses rk4 integer
i,k real h,x,dv(nmax),v(nmax)
do 11 i=1,nvar v(i)=vatart(i)
y(i,1)=v(i)
11 continue xx(1)=x1
x=x1 h=(x2-x1)/nstep
do 13 k=1,nstep
call
derivs(x,v,dv) call
rk4(v,dv,nvar,x,h,v,derivs) if(x+h.eq.x)pause
'stepsize not significant in rkdumb' x=x+h
xx(k+1)=x
do
12 i=1,nvar y(i,k+1)=v(i)
12 continue
13 continue return
end
subrountine
rk4(y,dydx,n,x,h,yout,derivs) integer
n,nmax real h,x,dydx(n),y(n),yout(n)
parameter (nmax=10)
integer I real
h6,hh,xh,dym(nmax),dyt(nmax),yt(nmax) hh=h*0.5
h6=h/6 xh=x+hh
do 11 i=1,n yt(i)=y(i)+hh*dydx(i)
11 continue call
derivs(xh,yt,dyt) do
12 i=1,n yt(i)=y(i)+hh*dyt(i)
12 continue call
derivs(xh,yt,dym) do
13 i=1,n yt(i)=y(i)+h*dym(i)
dym(i)=dyt(i)+dym(i)
13 continue call
derivs(x+h,yt,dyt) do
14 i=1,n yout(i)=y(i)+h6*(dydx(i)+dyt(i)+2.*dym(i))
14 continue return
end
±× ÀÌÀ¯´Â Àß ¸ð¸£°Ú´Ù.
Compiler error line 18 of : floation exception
during constant evaluation: cannot recover/usr/bin/fort77: aborting
compilation
À§ÀÇ ±×·¡ÇÁ¸¦ º¸¸é ¾Õ ºÎºÐ¿¡ Â÷ÀÌ°¡ ÀÖ´Ù.
µÚ ºÎºÐÀ¸·Î ´«¿¡ ¶ç´Â Â÷ÀÌ´Â ¾ø´Ù.
¡ß °¢ µ¥ÀÌÅÍ °ª ºñ±³
¤¡)Solaris |
¤¤)SparcLinux
f77(Sun) |
¤§)SparcLinux
fort77 |
0.0067 0.145580
0.0133 0.019414 0.0200 0.005801
0.0267 0.002453 0.0333 0.001257
0.0400 0.000729 0.0467 0.000460
0.0533 0.000310 0.0600 0.000220
0.0667 0.000163 0.0733 0.000126
0.0800 0.000102 0.0867 0.000085
0.0933 0.000074 0.1000 0.000067 |
0.0067 0.145580
0.0133 0.019414 0.0200 0.005801
0.0267 0.002453 0.0333 0.001257
0.0400 0.000729 0.0467 0.000460
0.0533 0.000310 0.0600 0.000220
0.0667 0.000163 0.0733 0.000126
0.0800 0.000102 0.0867 0.000085
0.0933 0.000074 0.1000 0.000067 |
.0067 .145580
.0133 .019414 .0200 .005801
.0267 .002453 .0333 .001257
.0400 .000729 .0467 .000460
.0533 .000310 .0600 .000220
.0667 .000163 .0733 .000126
.0800 .000102 .0867 .000085
.0933 .000074 .1000 .000067 |
¤©)AlphaLinux
fort77 |
¤±)AlphaLinux
NDP fortran77 |
¤²)IntelLinux
GNU g77 |
Compile
½ÇÆÐ |
0.0067 0.143668
0.0133 0.019159 0.0200 0.005725
0.0267 0.002420 0.0333 0.001241
0.0400 0.000719 0.0467 0.000454
0.0533 0.000306 0.0600 0.000217
0.0667 0.000161 0.0733 0.000125
0.0800 0.000100 0.0867 0.000084
0.0933 0.000073 0.1000 0.000067 |
0.0067 0.145607
0.0133 0.019417 0.0200 0.005802
0.0267 0.002453 0.0333 0.001257
0.0400 0.000729 0.0467 0.000460
0.0533 0.000310 0.0600 0.000220
0.0667 0.000163 0.0733 0.000126
0.0800 0.000102 0.0867 0.000085
0.0933 0.000074 0.1000 0.000067 |
À§ÀÇ °ªµéÀº ±×·¡ÇÁÀÇ ¾Õ ºÎºÐ°ú Àß ºñ±³Çϱâ
¹Ù¶õ´Ù. »ç½Ç ÀÌ ÇÁ·Î±×·¥¿¡´Â ÇÑ°¡Áö ¾öû³ ¿À·ù¸¦ ÀÏÀ¸Å°´Â ºÎºÐÀÌ
µé¾îÀÖ´Ù. ¹Ù·Î ÀÛÀº °ªÀ» Å« °ªÀ¸·Î ³ª´©´Â ºÎºÐÀÌ´Ù.(0¿¡ °¡±î¿î
¼ö·Î ³ª´«´Ù´Â Ç¥ÇöÀÌ ´õ ¾î¿ï¸±Áöµµ ¸ð¸¥´Ù). ½ÇÁ¦·Î graph¿¡¼µµ
0¿¡ °¡±î¿ï¼ö·Ï °©Àڱ⠳ôÀº °ªÀ» °¡Áø´Ù´Â °ÍÀ» º¼ ¼ö ÀÖ´Ù. ÇÊÀÚ´Â
ÀÌ graph¸¦ º¸°í ºñ±³ÇÒ ºÎºÐÀ» x°ªÀÌ 0.3ÀÌ»óÀÎ ºÎºÐÀ¸·Î ¿¹»óÇÏ°í
´Ù½Ã ºñ±³¸¦ ÇÏ°Ú´Ù.
¡ß °¢ µ¥ÀÌÅÍ °ª ºñ±³
À§ÀÇ Data¸¦ º¸¸é Alpha ÂÊ¿¡¼ 0.333ºÎºÐÀÇ
°ªÀÌ ´Ù¸¥ machineµéÀÇ °ª°ú ´Ù¸£´Ù. ¾Æ¸¶µµ À¯È¿ÀÚ¸® ¼ö¸¦ µûÁú
¶§ ´Ù¸¥ machineµé°ú °Í °°´Ù. Á¤È®ÇÑ ÀÌÀ¯´Â ÇÊÀÚµµ ¸ð¸£°Ú´Ù.
¤¡)Solaris |
¤¤)SparcLinux
f77(Sun) |
¤§)SparcLinux
fort77 |
0.3000 0.000561
0.3067 0.000599 0.3133 0.000638
0.3200 0.000680 0.3267 0.000723
0.3333 0.000768 0.3400 0.000814
0.3467 0.000863 0.3533 0.000913
0.3600 0.000965 0.3667 0.001019
0.3733 0.001076 0.3800 0.001134
0.3867 0.001194 0.3933 0.001256
0.4000 0.001321 |
0.3000 0.000561
0.3067 0.000599 0.3133 0.000638
0.3200 0.000680 0.3267 0.000723
0.3333 0.000768 0.3400 0.000814
0.3467 0.000863 0.3533 0.000913
0.3600 0.000965 0.3667 0.001019
0.3733 0.001076 0.3800 0.001134
0.3867 0.001194 0.3933 0.001256
0.4000 0.001321 |
.3000 .000561
.3067 .000599 .3133 .000638
.3200 .000680 .3267 .000723
.3333 .000768 .3400 .000814
.3467 .000863 .3533 .000913
.3600 .000965 .3667 .001019
.3733 .001076 .3800 .001134
.3867 .001194 .3933 .001256
.4000 .001321 |
¤©)AlphaLinux
fort77 |
¤±)AlphaLinux
NDP fortran77 |
¤²)IntelLinux
GNU g77 |
Compile
½ÇÆÐ |
0.3000 0.000561
0.3067 0.000599 0.3133 0.000638
0.3200 0.000680 0.3267 0.000723
0.3333 0.000767 0.3400 0.000814
0.3467 0.000863 0.3533 0.000913
0.3600 0.000965 0.3667 0.001019
0.3733 0.001076 0.3800 0.001134
0.3867 0.001194 0.3933 0.001256
0.4000 0.001321 |
0.3000 0.000561
0.3067 0.000599 0.3133 0.000638
0.3200 0.000680 0.3267 0.000723
0.3333 0.000768 0.3400 0.000814
0.3467 0.000863 0.3533 0.000913
0.3600 0.000965 0.3667 0.001019
0.3733 0.001076 0.3800 0.001134
0.3867 0.001194 0.3933 0.001256
0.4000 0.001321 |
3. Relaxation Method¸¦ ÀÌ¿ëÇÑ ºñ±³
Relaxation Method´Â Two point Boundary Value¹®Á¦¸¦
´Ù·ê ¶§ »ç¿ëÇÏ´Â ¹æ¹ýÀÌ´Ù. ¾à°£ÀÇ º¸Ãæ ¼³¸íÀ» ÇÏ°Ú´Ù. óÀ½ ¾ÆÁÖ
ÃʱⰪ µÎ °³¸¦ ¾Ë°í ¾ÆÁÖ Ãß»óÀûÀÎ ÇÔ¼ö¸¦ ¾Ë°í ÀÖ´Â »óÅ¿¡¼
Ãâ¹ßÇÑ´Ù. º¸Åë 2°è ¹ÌºÐ(µÎ ¹ø ¹ÌºÐÇÑ ÇÔ¼ö¶ó°í »ý°¢Çϱ⠹ٶø´Ï´Ù)
ÇüÅÂÀÇ ÇÔ¼ö¸¦ ÇÊÀÚ´Â ´Ù·é´Ù. ±× ´ÙÀ½, ÇÊÀÚ´Â Ãß»óÀûÀÎ ÇÔ¼ö¿¡¼
°£´ÜÇÑ ÇÔ¼ö¸¦ Á¤ÇÏ¿© ±¸ÇÏ°í ½ÍÀº °ªÀÌ ³ª¿Ã ¼ö ÀÖµµ·Ï ½ÄÀ» ¸¸µé¾î
°£´Ù. À̶§, ÇÊÀÚ´Â ÀÚ¼¼ÇÑ Á¤º¸´Â ¸ð¸£°í, ´ëÃæ ºñ½ÁÇÑ ºÎºÐ¸¸À»
ÄÄÇ»ÅÍ¿¡°Ô °¡¸£ÃÄÁÖ°í, ³ª¸ÓÁö´Â ÄÄÇ»ÅÍ°¡ ¾Ë¾Æ¼ ãµµ·Ï ÇÏ´Â
°ÍÀÌ´Ù. Áï, Àΰ£ÀÇ ÈûÀ¸·Î´Â ¿¹ÃøÇÒ ¼ö ¾ø°í ¹Ý¸ñÀÛ¾÷°ú Ãʱâ Á¶°Çµé¸¸À»
»ç¿ëÇÏ¿© °ªÀ» ã´Â °ÍÀÌ´Ù. ´ÙÀ½ÀÇ Source¸¦ º¸ÀÚ. À§ÀÇ
Source¿¡ ´ëÇÑ ºÐ¼® ¹× Ãʱâ Á¶°ÇµéÀº »ý·«ÇÏ°Ú´Ù. ±âÁØÀº data-sparc(Solaris
f77»ç¿ë)À¸·Î ÇÏ°Ú´Ù.
ccccccccccccccccccccccccccccccccc
cc Relaxation
cc
cc w;
division cc
cc Very funny function... cc
cc -3(x+1)-7+(3*3.141592/2+3) cc
cccccccccccccccccccccccccccccccccc
PARAMETER
(NSTEP=100) DIMENSION
PHI(0:NSTEP),S(0:NSTEP)
READ*,OMEGA
IF
(OMEGA.LE. 0) STOP
H=3.141592/2./NSTEP
dif=4./100.
DO 10
IX=0.NSTEP
X=IX*H
c S(IX)=-1*H*H*(-7*sin(X)-3*cos(X))
s(IX)=-1*H*H*(-3.*(X+1.)-7.+(3.*3.141592/2.+3.))
PHI(IX)=3.
+ dif*IX 10 CONTINUE
DO
20 ITER=1,5000 DO
15 IX=1,NSTEP-1 PHIP=(PHI(IX-1)+PHI(IX+1)+S(IX))/2
PHI(IX)=(1.-OMEGA)*PHI(IX)+OMEGA*PHIP
15 CONTINUE
20 continue do
40 ix=1,NSTEP-1 step=h*IX
print*,step,PHI(IX)
40 continue
END
Alpha fort77À» Á¦¿ÜÇÑ ³ª¸ÓÁö graph´Â ´«À¸·Î
Â÷À̸¦ È®ÀÎÇÒ ¼ö ¾øÀ» Á¤µµ·Î ºñ½ÁÇÑ ÇüÅ·ΠÃâ·ÂµÇ¾ú´Ù. graph¿¡
´ëÇÑ ¼³¸íÀ» ÇÏ°Ú´Ù. ÇÊÀÚ°¡ ¿øÇÑ graph´Â REAL graphÀÌ´Ù. ±×¸®°í
³ª¸ÓÁö graph´Â ÄÄÇ»ÅÍ°¡ À¯ÃßÇس½ graphÀÌ´Ù. ÇÊÀÚÀÇ ÇÁ·Î±×·¡¹Ö
½Ç·ÂÀÌ ºÎÁ·(^^;)ÇÏ¿© ¿Ïº®ÇÑ ÇüÅÂÀÇ graph·Î ÄÄÇ»ÅÍÀÇ À¯Ã߸¦ À̲ø¾î³»Áö´Â
¸øÇÏ¿´´Ù. ÀÌÁ¦ dataÀÇ ºÐ¼®À» ÇÏ°Ú´Ù. ¾Æ·¡ÀÇ data´Â 'data
graph'ÀÇ ¸®½ºÆ®ÀÌ´Ù.
¡ß °¢ µ¥ÀÌÅÍ °ª ºñ±³
¤¡)Solaris |
¤¤)SparcLinux
f77(Sun) |
¤§)SparcLinux
fort77 |
1.57080E-02 3.08720
3.14159E-02 3.17382 4.71239E-02
3.25985 6.28318E-02 3.43529
7.85398E-02 3.43012 9.42478E-02
3.51433 0.109956
3.59790 0.125664
3.68083 0.141372
3.76311 0.157080
3.84472 0.172788
3.92565 0.188496
4.00590 0.204203
4.08544 0.219911
4.16427 0.235619
4.24237 0.251327
4.31974 0.267035
4.39636 0.282743
4.47222 0.298451
4.54731 0.314159
4.62162 0.329867
4.69513
|
1.57080E-02 3.08720
3.14159E-02 3.17382 4.71239E-02
3.25985 6.28318E-02 3.43529
7.85398E-02 3.43012 9.42478E-02
3.51433 0.109956
3.59790 0.125664
3.68083 0.141372
3.76311 0.157080
3.84472 0.172788
3.92565 0.188496
4.00590 0.204203
4.08544 0.219911
4.16427 0.235619
4.24237 0.251327
4.31974 0.267035
4.39636 0.282743
4.47222 0.298451
4.54731 0.314159
4.62162 0.329867
4.69513
|
.0157080E-02 3.08719587
.0314159E-02 3.1738162 .0471239E-02
3.25985026 .0628318E-02 3.43528804
.0785398E-02 3.43011737 .0942478E-02
3.51432514 .109955721
3.59799991 .125663683
3.6808331 .141371638
3.7631104 .157079607
3.84472156 .172787562
3.92565393 .188495517
4.00590561 .204203486
4.08543777 .219911441
4.16426802 .235619411
4.24237061 .251327366
4.31973696 .267035335
4.39635658 .282743275
4.47221708 .298451245
4.54730749 .314159214
4.62161514 .329867154
4.69512892 |
¤©)AlphaLinux
fort77 |
¤±)AlphaLinux
NDP fortran77 |
¤²)IntelLinux
GNU g77 |
Compile
½ÇÆÐ |
1.5707960E-02 3.087193
3.1415921E-02 3.173813 4.7123879E-02
3.259846 6.2831841E-02 3.435282
7.8539796E-02 3.430110 9.4247758E-02
3.514318 0.1099557
3.597894 0.1256637
3.680826 0.1413716
3.763103 0.1570796
3.844713 0.1727876
3.925645 0.1884955
4.005988 0.2042035
4.085429 0.2199114
4.164259 0.2356194
4.242362 0.2513274
4.319731 0.2670353
4.396352 0.2827433
4.472212 0.2984512
4.547301 0.3141592
4.621609 0.3298672
4.695122 |
0.0157079604 3.08719468
0.0314159207 3.17381525 0.0471238792
3.25985003 0.0628318414 3.43528685
0.0785398036 3.43011498 0.0942477584
3.514323 0.109955721 3.59789801
0.125663683 3.68082976
0.141371638 3.76310611
0.157079607 3.8447156
0.172787562 3.92564702
0.188495517 4.00598942
0.204203486 4.08542919
0.219911441 4.16425705
0.235619411 4.24236012
0.251327366 4.31972647
0.267035335 4.39634562
0.282743275 4.47220564
0.298451245 4.54729605
0.314159214 4.62160254
0.329867154 4.69511509 |
À§ÀÇ data list¸¦ º¸¸é Âü Àç¹ÌÀÖ´Â Çö»óÀ»
ºñ±³ÇÒ ¼ö ÀÖ´Ù. ´«¿¡ ¹Ù·Î µé¾î¿À´Â °ÍÀÌ ¹Ù·Î À¯È¿ ÀÚ¸®¼öÀÌ´Ù.
ÇÊÀÚ´Â ¥ð°ªÀ¸·Î 3.141592·Î ¼Ò¼ö 6ÀÚ¸®±îÁö ÁÖ¾ú´Ù. ±×·¯³ª °¢
ÄÄÆÄÀÏ·¯º°·Î ±âº» À¯È¿ ÀÚ¸®¼ö°¡ ´Þ¶ú´Ù. NDP³ª Sun f77Àº À¯È¿ÀÚ¸®¼ö¸¦
°¨¾ÈÇÏ¿© Ãâ·ÂÀ» ÇÏ¿´´Ù. GNU g77À̳ª fort77Àº À¯È¿ ÀÚ¸´¼ö 6ÀÚ¸®¸¦
³Ñ¾î¼±îÁö Ãâ·ÂÀ» ÇÏ¿´´Ù. ±×¸®°í, ¶Ç ÇÑ °¡Áö Èï¹Ì·Î¿î °ÍÀº Sun
f77Àº NDP f77°ú ºñ±³ÇÒ ¶§, Sun f77ÀÌ ¼Ò¼ö 6ÀÚ¸®ÀÇ °ªÀ» ±×³É
¹ö¸®´Â °æÇâÀ» ¶ì°í ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥Àº À¯È¿ ÀÚ¸´¼ö¿¡ ´ëÇÑ Á¤ÀǸ¦
ÇÏÁö ¾Ê¾ÒÀ½À» ¹àÈù´Ù.
4. Fast Fourier Transform(FFT)¸¦ »ç¿ëÇÑ ºñ±³
ºÐ¼®
¼Ò½º´Â ³Ê¹« ±ä °ü°è·Î »ý·«ÇÏ°Ú´Ù. ÀÌ·ÐÀº °£´ÜÇÏ´Ù.
Delta Function ÇüŸ¦ Áö´Ñ ÇÔ¼ö¸¦ Fourier º¯È¯À» ÃëÇÏ¿© plotÇÑ
graph¸¦ ºñ±³ÇÑ´Ù. ±×·±µ¥ º¸ÅëÀÇ Fourier º¯È¯½ÄÀ» ±×´ë·Î ÇÁ·Î±×·¡¹ÖÇϸé,
¿ÀÂ÷À²µµ Å©°í ¾µµ¥¾ø´Â °è»êÀ» ¸¹ÀÌ ÇÑ´Ù. ±×·¡¼ FFT¶ó´Â °ÍÀ»
»ç¿ëÇÏ¿© ÇÁ·Î±×·¡¹ÖÇÑ´Ù.
¡ß °¢ µ¥ÀÌÅÍ °ª ºñ±³
ÀÌ ÇÁ·Î±×·¥ ¼Ò½º´Â À¯È¿ÀÚ¸®¼ö ¹× ¿ÀÂ÷¸¦ ÀÏÀ¸Å³
ºÎºÐÀ» ¹Ì¿¬¿¡ ¹æÁöÇϵµ·Ï Á¦ÀÛµÈ ¼Ò½ºÀÌ´Ù. ÇÊÀÚ°¡ º¸¾Æ¼´Â dataÀÇ
Â÷ÀÌ°¡ ¾ø´Ù. À§ÀÇ 3°³ÀÇ ¼Ò½º¿Í ´Ù¸¥ Á¡Àº ¿ÀÂ÷¸¦ ÀÏÀ¸Å³ ºÎºÐ¿¡
´ëÇÑ ¼öÁ¤ ·çƾÀÌ µé¾î°¬°í, À¯È¿ ¹üÀ§¿¡ ´ëÇÑ Á¤ÀǸ¦ ³»·È´Ù. ±×¸®°í
´Ù¸¥ ¼Ò½ºº¸´Ù ¸î ¹è ´õ ±æ´Ù´Â Á¡ÀÌ´Ù. (¸¸¾à, ÀÌ dataÀÇ ¼Ò½º¸¦
¿øÇϽô ºÐÀº ÇÊÀÚ¿¡°Ô e-mailÀ» º¸³»½Ã±â ¹Ù¶ø´Ï´Ù.)
¤¡)Solaris |
¤¤)SparcLinux
f77(Sun) |
¤§)SparcLinux
fort77 |
507 2.7053816319
508 2.7100114822 509
2.7136235237 510 2.7162096500
511 2.7177634239 512
2.7182817459 513 2.7177634239
514 2.7162096500 515
2.7136235237 516 2.7100114822
517 2.7053816319 |
507 2.7053816319
508 2.7100114822 509
2.7136235237 510 2.7162096500
511 2.7177634239 512
2.7182817459 513 2.7177634239
514 2.7162096500 515
2.7136235237 516 2.7100114822
517 2.7053816319 |
507 2.7053816319
508 2.7100114822 509
2.7136235237 510 2.7162096500
511 2.7177634239 512
2.7182817459 513 2.7177634239
514 2.7162096500 515
2.7136235237 516 2.7100114822
517 2.7053816319 |
¤©)AlphaLinux
fort77 |
¤±)AlphaLinux
NDP fortran77 |
¤²)IntelLinux
GNU g77 |
Compile
½ÇÆÐ |
507 2.7053816319
508 2.7100114822 509
2.7136235237 510 2.7162096500
511 2.7177634239 512
2.7182817459 513 2.7177634239
514 2.7162096500 515
2.7136235237 516 2.7100114822
517 2.7053816319 |
507 2.7053816319
508 2.7100114822 509
2.7136235237 510 2.7162096500
511 2.7177634239 512
2.7182817459 513 2.7177634239
514 2.7162096500 515
2.7136235237 516 2.7100114822
517 2.7053816319 |
ÀÌÁ¦ Á¤¸®¸¦ ÇÏ°Ú´Ù. À§ÀÇ Data¸¦ ºñ±³Çغ¸¸é
¾Ë°ÚÁö¸¸, °í°¡ Á¦Ç°ÀÎ Sparc°ú ºñ±³ÇßÀ» ¶§, Alpha³ª Intel°è¿¿¡¼µµ
½Å·ÚÇÒ ¼ö ÀÖ´Â °ªÀ» ¾òÀ» ¼ö ÀÖ´Ù´Â °ÍÀ» ¾Ë ¼ö ÀÖÀ» °ÍÀÌ´Ù. Linux¸¦
žÀçÇÑ machineµéÀº ¼öÄ¡ °è»ê±â·Î¼ Ź¿ùÇÑ ¼º´ÉÀ» ¹ßÈÖÇÑ´Ù. °ªºñ½Ñ
Sun Microsystem»çÀÇ f77À» »ç¿ëÇÏÁö ¾Ê´õ¶óµµ Linux¸¦ »ç¿ëÇÏ´Â
userµéÀº °ª½Ñ GNU toolµéÀ» »ç¿ëÇÏ¿© ¼öÄ¡°è»êÀ» ÇÒ ¼ö ÀÖ´Ù. ±×¸®°í
¿©±â¼ ÇÑ°¡Áö ´õ ÁÖ¸ñÇÒ ¸¸ÇÑ »çÇ×Àº, SparcLinux¿¡¼´Â SunOS
binary°¡ ¿À·ù¾øÀÌ Àß µ¹¾Æ°£´Ù´Â »ç½ÇÀ» ¾Ë ¼ö ÀÖ´Ù. (Sun Fortran77ÀÌ
SparcLinux¿¡ ¼³Ä¡µÇ¾ú´Âµ¥, Sun f77Àº SunOS binaryÀÌ´Ù) ÀÌ ÀÛ¾÷À»
ÇÏ¸é¼ ¸î °¡Áö ¾Æ½¬¿î Á¡ÀÌ ÀÖ¾ú´Ù. ÇÑ°¡Áö´Â AlphaLinux¿¡¼ g77
¼³Ä¡¿¡ ½ÇÆÐÇÏ¿© g77 toolµéÀÇ performance°¡ ±×·¸°Ô ÁÁÁö ¾Ê´Ù´Â
°ÍÀÌ´Ù. ±×·¡¼ ÇÊÀÚ´Â NDP fortranÀ» ±¸ÇÏ¿© ÀÌ·¸°Ô Å×½ºÆ®¸¦ ÇÏ°Ô
µÈ °ÍÀÌ´Ù. NDP fortranÀº AlphaLinux¿¡¼ µ¹¾Æ°¡´Â »ó¿ë Fortran
CompilerÀÌ´Ù. ¸¶Áö¸·À¸·Î ÇÊÀÚ´Â Linux°¡ ¼öÄ¡ °è»ê±â·Î¼ Ź¿ùÇÑ
¼º´ÉÀ» ¹ßÈÖÇÑ´Ù´Â °ÍÀ» °Á¶ÇÏ¸é¼ ºÐ¼®À» ¸¶Ä¡°Ú´Ù. Ȥ½Ã, AlphaLinux¿¡¼
À§ÀÇ ÄÄÆÄÀÏÀ» ½ÇÆÐÇÏ¸é¼ ³ª¿Â ¿¡·¯ ¸Þ½ÃÁö¿¡ ´ëÇÑ ¶æÀ» ¾Æ½Ã´Â
ºÐÀº ¿¬¶ôÀ» ÁÖ¼¼¿ä. ÇÊÀÚÀÇ E-mail : reduck96@landau.scu.ac.kr
reduck96@monster.scu.ac.kr REDUCK96@hitel.net
Compiler error line 18 of : floating exception
during constant evaluation; cannot recover /usr/bin/fort77:
aborting compilation
Âü°í¹®Çå
1. Numerical Recipes in FORTRAN The Art of Scientific Computing,
Second Edition 2. Classical dynamics of particles and system,
Fourth edition, Marion 3. Computational Physics Fortran
edition, Steven E. Koonin/Dawn C. Meredith
¡ã top
|