登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
程序
>
菜鸟求助高手牛人帮助FORTRAN调试
发帖
回复
4783
阅读
0
回复
[
求助
]
菜鸟求助高手牛人帮助FORTRAN调试
离线
假酒鬼真醉
UID :73463
注册:
2011-03-09
登录:
2013-08-12
发帖:
636
等级:
积极交流五级
0楼
发表于: 2011-04-20 16:13:17
代码是朱国瑞著,刘盛纲译的《开放谐振腔的时域分析》书中的代码,用的Micosoft developer studio
X*'-^WM6
菜鸟原因,没有跑通
W[3)B(Vq<E
跪求那位高手指点
kM\O2ay
附代码 感激啊!!!!!!!!!!!!
<ST#< $%
program cavity
d/ OIc){tD
!
/Iu._2
! ***********************************************
hrRX=
! this program calculates the resonant frequency, diffraction/ohmic q,
!&Q3>8l
! and field profile of the te mode of an axisymmetric, open-end cavity.
-j_J1P0,
!
*ad"3>
! the cavity structure is formed of multiple section of uniform and
y]`@%V2P
! linearly tapered waveguides with resistive walls. By assumption, the
Lay+)S.ta[
! radius of the (circular cross-section) cavity structure is either
S:"t]gbF =
! constant or a slowly varying function of the axial position z.
V ;)q?ZHg
! the end section (on the left or right) is either a propagating or
HSOdqjR*
! a cut-off waveguide of uniform cross-section and resistivity.
-ijQTB
!
`$\Y,9E}x
! a single te(m,n) mode is assumed throughout the structure.
Z qg(\
!
HH|&$C|64
! theory and algorithm are described in lecture notes "time domain
Q( KLx )
! analysis of open cavity" (by k.. r. chu).
N+PW,a
!
?%h JZm;
! note: comment statements in the main program beginning with ccc
41TB
! call for action by the user.
|8"~ou:.
!
TPds )osZT
! date of first version: 1985
)Cz^Xp)#
! date of this version: February 20, 1993
E#FyL>:.h
! ***************************************************************************
FBcF
!
Cs %-f"
implicit real(a, b, d-h, j-z), complex(c)
r\"O8\
! in the main program and subprogram cbc , difeq, radius, rho, and
Al`[Iu&
! closs, all variables beginning with I are integers, and all variables
f6Wu+~|Y
! beginning with c are complex numbers.
v=|BqG`
dimension axmn(9,8), cw(20)
hqY9\,.C
dimension zmark(100), rwl(100), rwr(100), rhol(100), rhor(100)
$E4W{ad2jW
dimension az(3001),arw(3001),arho(3001),afamp(3001),afphse(3001)
(r.{v@h,dV
common/const/ci,pi,realc
?Ib/}JST
common/ckt/zmark,rwl,rwr,rhol,rhor,izmark,izstep
Rh%/xG#k
common/mode/wr,wi,fr0,fi0,xmn,im
\6Ze H
common/diag/az,arw,arho,afamp,afphse,idiag,icont
^F~e?^s
external cbc
7 v<$l
data axmn/&
zY|]bP[NEH
3.832e0,1.841e0,3.054e0,4.201e0,5.318e0,6.416e0,&
VmkYl$WZo
7.501e0,8.578e0,9.647e0,&
G1~|$X@@
7.016e0,5.331e0,6.706e0,8.015e0,9.282e0,10.250e0,&
q$`:/ ehw
15.268e0,16.529e0,17.774e0,&
%f&(U/
13.324e0,11.706e0,13.170e0,14.586e0,15.964e0,17.313e0,&
oA~m*|
18.637e0,19.942e0,21.229e0,&
Wx/!Myu
16.471e0,14.864e0,16.348e0,17.789e0,19.196e0,20.576e0,&
<P5;8
21.932e0,23.268e0,24.587e0,&
zHB{I(q
19.616e0,18.016e0,19.513e0,20.973e0,22.401e0,23.804e0,&
S~F:%@,*
25.184e0,26.545e0,27.889e0,&
= sIR[V'(
22.760e0,21.164e0,22.672e0,24.145e0,25.590e0,27.010e0,&
tGd<{nF% 2
28.410e0,29.791e0,31.155e0,&
7`tnoTUv
25.904e0,24.311e0,25.826e0,27.310e0,28.768e0,30.203e0,&
N)h>Ie
31.618e0,33.015e0,34.397e0/
2`vCQV
! axmn(im+1, in) is the nth root of jm'(x)=0 up to im=8 and in =8.
/)de`k"
!
7-ba-[t#A
! universal constants
UUY-EC7X
ci=cmplx(0.0,1.0)
B<[;rk
pi=3.1415926
?4Z0)%6
realc=2.99792e10
\sC0om,
!!! give plot instruction (1:plot, no plot)
"ngYh]Git$
iplot=1
-&kQlr
!!! specify no of points on the z-axis to be used to mark the positions
S_:(I^
! of the left/right boundaries and the junctions between sections.
Vrz!.X~
izmark=5
x[}e1sXXs
! cavity dimension arrays zmark rwl, and rwr specified below are to be
&bj :,$@
! passed to the subprograms through the common block, the array
.KT+,Y
! elements
),\>'{~5&
! must be in unit of cm..!
vO{ijHKE
! zmark is a z-coordinate array to mark, from left to right, the positions
@WEem(@
! of the left boundary (zmark(1)), the junctions between sections
im+2)9f
! (zmark(2),… ,zmark(izmark-1)), and the right boundary (zmark(zmark)).
;.W0Aa
!
u ?g!E."v
! zmark(1) must be located within the left end section and zmark(izmark)
H8K<.RY
! must be located within the right end section. The end section (on the left or right)
@\!wW-:A
! is assumed to be either a progagating or a cut-off
0 $e;#}
! waveguide of uniform cross-section and resistivity.
z[v5hhI)4
! in theory., lengths of the uniform end section so not affect the results.
#G.3a]p}"
! in practice, set the length of the cut-off end section(if any)sufficiently short
Mn~A;=%qF
! to avoid numerical difficulties due to the exponential
!nj%n
! growth or attenuation of f with z.
&J hN&Ur
!
vo`wYJ3W
! rwl(i) is the wall radius immediately to the left of z=zmark(i).
<\^X,,WtO
! rwr(i) is the wall radius immediately to the right of z=zmark(i).
y=vH8D]%X
! wall radius between zmark(i) and zmark(i+1) will be linearly
.3|9 ~]
! interpolated between rwr(i) and rwl(i+1) by function radius(z).
]QT0sGl
!!! specify cavity dimension arrays zmark, rwl, and rwr in cm.
hCT%1R}rKr
r=0.9
{u.V8%8
r1=0.5
6ddkUPTF
r2=1.1
Q'+N72=
l=11.7
ITc/aX
l1=3.0
Sc6wC H
l2=5.0
g-p OO/|
theta=10.0
pN0c'COy^
zmark(1)=0.0
45MK|4\Y_
zmark(2)=zmark(1)+l1
fe37T@
zmark(3)=zmark(2)+l
R|+R4'
zmark(4)=zmark(3)+(r2-r)/tan(theta*pi/180.0)
[k'Ph33c
zmark(5)=zmark(4)+l2
v[a#>!;s
rwl(1)=r1
rpEFyHorJ
rwr(1)=r1
}aNiO85
rwl(2)=r1
FYcMvY
rwr(2)=r
GYO\l.%V5y
rwl(3)=r
7Xad2wXn
rwr(3)=r
4nl>&AV
rwl(4)=r2
@L<[38
rwr(4)=r2
ri JyH;)
rwl(5)=r2
z{#F9'\&
rwr(5)=r2
3Gp4%UT&
! wall resistivity arrays rhol and rhor specified below are to be
k) v[/#I
! passed to the subprograms through the common block. Array elements
oLr"8R\d>t
! must be in mks unit of ohm-m(1 ohm-m = 100*ohm-m)
0"2 [I
! (example: resistivity of copper at room temperature=1.72e-8 ohm-m)
:LBe{Jbw
!
9x?;;qC"m9
! rhol(i) is the wall resistivity immediately to the left of z=zmark(i).
o@>c[knJ
! rhor(i) is the wall resistivity immediately to the right of z=zmark(i).
0dcXgP
! wall resistivity between zmark(i) and zark(i+1) by function rho(z).
0= 'DDy
!
t^CT^z
!!! specify wall resistivity arrays rhol and rhor in ohm-m.
Bd NuhV`0
rhomks=1.72e-8
'-i tn
rhomks=0.0
H;sQ]:.*]
rhol(1)=rhomks
4G>|It
rhor(1)=rhomks
"]_|c\98
rhol(2)=rhomks
z t,-O7I'1
rhor(2)=rhomks
%o"Rcw|
rhol(3)=rhomks
AVyZ#`,
rhor(3)=rhomks
Ar<OP'C
rhol(4)=rhomks
oo Z-T>$
rhor(4)=rhomks
|Lhz^5/
rhol(5)=rhomks
#dpt=
rhor(5)=rhomks
rmMO-!s
!
HJJ^pk&
! write cavity dimensions and resistivity
z}Z`kq+C
write(* ,2)r, r1, r2, l, l1, l2, theta
Q?a"uei[
2 format (/'cavity dimensions(length in cm ):',/'r=',1pe10.3,',r1=',1pe10.3,',r2=',1pe10.3,',11=',1pe10.3,',12=',1pe10.3,',theta=',1pe10.3,'degree')
4|$D.`Wu
write(*,3) izmark
y{<#pS.
3 format(/'cavity dimension arrays: (izmark=',i4,')')
`90v~OF
do 50 i=1,izmark, 6
{-Y_8@&