      real*8 function introvrzprsqr(lnp0,lnp1,r,hp)
c
c integral of 1/(1+z/r)^2
c
c input:
c lnp0 - log of pressure at sfc using p(z1)=p1 and p0=p1*exp(z1/hp) [atm]
c lnp1 - log of pressure [atm]
c r  - radius of earth [km]
c hp - pressure scale height [km]
c
c output:
c introvrzprsqr
c
c
      real*8 lnp0,lnp1,r,hp
c
c local
      real*8 chi,p1,a
c
      chi=Hp/r
c      p1=exp(lnp1)
c without lnp0
c      introvrzprsqr=p1*(1.0d0-2.0*chi*(lnp1-1.0d0)+
c     &chi*chi*(lnp1*lnp1-2.0d0*lnp1+2.0d0))
c with lnp0
      a=1.0+chi*lnp0
c      introvrzprsqr=p1*(a*a+2.0*a*chi*(1.0d0-lnp1)
c     &+chi*chi*(lnp1*lnp1-2.0d0*lnp1+2.0d0))
      introvrzprsqr=((a+chi*(1.0d0-lnp1))**2+chi**2)
      return
      end
