[Fortran] 纯文本查看 复制代码 program gyro
implicit none
!-- ofen used constant
real(8),parameter :: light_speed=2.99792458d8, pi=3.14159265d0, h_pc=6.62620d-34
!-- parameter of the detector
real(8),parameter :: eta=0.9d0, t0=3.6d3
!-- input parameter of the incident ligth
real(8),parameter :: intensity_input=1.0d-6, wavelength=1550d-9, frequency=light_speed/wavelength
!-- structure parameter of the ring
real(8) :: radius_ring, length_ring
real(8) :: neff_r, neff_i
!-- structure parameter of the waveguide
! real(8) :: radius_nanoline
!-- variables
real(8) :: k, alpha, m, t_max, t_min, snr, df12,domega
!-- common integer variables
integer :: n
radius_ring = 5.0d-2
! unit = m, correspongding to 2cm
length_ring = 2*pi*radius_ring
neff_r = 1.451117
neff_i = 7.485137d-6
!-- correspongding propagation loss and effective index
alpha = 2.0*pi*neff_i/wavelength
!-- open(1,file='output.dat')
write(1,*) 'k m t_maxt_minsnr df12 domega'
do n = 1, 99, 1
k = n*0.01d0
m = exp(-alpha*length_ring)
t_max=( 2*m*dsqrt(1-k) + (1-k) + m**2 ) / ( 1 + 2*m*dsqrt(1-k) +(m**2)*(1-k) )
t_min=(-2*m*dsqrt(1-k) + (1-k) + m**2 ) / ( 1 - 2*m*dsqrt(1-k) +(m**2)*(1-k) )
snr = dsqrt( (eta * t0 * intensity_input) / ( 2 * h_pc * frequency ) )*( (t_max - t_min)/dsqrt(t_max) )
df12 = ( light_speed / (2*neff_r*pi*length_ring) ) * (2*pi - 2*dacos( (2*m*dsqrt(1-k))/( (m**2)*(k-1) -1 ) ) )
domega = 3600*(wavelength / ( 2*radius_ring ) ) * ( ( dsqrt(2.0d0)*df12 )/ snr )
write(1,'(10e20.5e3)') k, m, t_max, t_min, snr, df12, domega
enddo
close(1)
end program gyro
|