c	file  bouger.for
c	prog to apply bouger's rule to an n(h) profile
c	written by leo mcnamara 4-feb-88
c-----	last modified 10-feb-88
c
	dimension fn(1000),rr(1000),prod(1000)
	real mu
c
	open (unit = 1, file = 'bouger.dat', status = 'old' )
	open (unit = 2, file = 'data.out', status='old')
	degrad = 3.141492654 / 180.

	write(6,600)
600	format(//' enter wave freq, elev angle & h0 -- 3f5.0')
	read(5,500) freq,elev,h0
500	format(3f5.0)
	r0 = h0 + 6370.
	const = 6370. * cos (elev * degrad)
	if (freq.le.0.) stop
c
	k = 0
	do 50 i = 1,1000
	read(1, 100, end = 99) aa
100	format(f5.0)
	if(aa.gt.10.) go to 50
	k = k + 1
	fn(k) = aa
	rr(k) = r0 + k - 1
	mu = sqrt (1. - (aa/freq)**2 )
	prod(k) = mu * rr(k)
	write(6,601) k, rr(k) - 6370., mu, prod(k), const
	write(2,601) k, rr(k) - 6370., mu, prod(k), const
601	format(i5,f10.1,f10.4,2f10.1)
50	continue
99	continue	
	end