subroutine chap (fc,hm,sh,tipe,h,ed,dndh)
c	s/r to evaluate the electron density and gradient of density
c	wrt height for a Chapman layer
c
c	written by leo mcnamara 31-aug-87
c-----	last modified 31-aug-87
c
c	tipe = 0.5 for alpha-chapman layer
c	       1.0 for beta-chapman layer
c
	z = (h - hm) / sh
	expmz = exp (-z)
	u = 1. - z - expmz
	ed = fc * fc * 1.24e10 * exp (tipe * u)
c
c	the gradient dndh
	dzdh = 1. / sh
	dudz = -1. + expmz
	dndu = tipe * ed
	dndh = dndu * dudz * dzdh
c
	return
	end