jiheguangxue.for

来自「自己写的几何光学散射彩虹角计算程序」· FOR 代码 · 共 67 行

FOR
67
字号
	IMPLICIT real*8 A-Z
	integer I,N
	open(1,file='abc.DAT')
30	continue
!	write(*,*)'input the order of rainbow and the maximum of refractive index:'
	read(*,*)n,max_m
!	For n order rainbow(n=N-2),the maximum of m must less or equal n+1,otherwise the phenomenon of rainbow won't appear!

	if(max_m>n+1)then
		write(*,*)'Bad input!!!'
		goto 30
	end if

	N=n+2
	max_m_sub_one=max_m-1


!	For n order rainbow(n=N-2),the maximum of m must less or equal n+1,otherwise function asin(a) will out of define

	kmax_m_sub_one=1000*max_m_sub_one

	do I=0,kmax_m_sub_one-1
!							write(*,*)I

		m=0.001*I+1
!							write(*,*)m

		u=m*m-1.0

		l=(N-1.0)*(N-1.0)-1.0

		c=1.0*u/l
!							write(*,*)c
		a=sqrt(c)
!							write(*,*)a
		Trg=asin(a)
!							write(*,*)Trg


			
		th=2.0*Trg-2.0*(N-1.0)*Acos(1.0*cos(Trg)/m)


		th=-1.*th/3.141592654

10		if(th>=2)then
			th=th-2 
			goto 10
		end if

20		if(th>1)then
			th=2-th
			goto 20
		end if

		th=th*180.0
		

		write(1,*)m,th
	end do

	end




⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?