%N opacget %F $MIR/src/subs/refract.for
%D Compute sky brightness and opacity of a model atmosphere.
%P rjs
%: utilities
%B
        subroutine opacGet(nfreq,freq,el,t0,p0,h0,fac,Tb)

        implicit none
        integer nfreq
        real freq(nfreq),el,t0,p0,h0,fac(nfreq),Tb(nfreq)

  Returns the transmissivity of the atmosphere given frequency, elevation
  angle and meteorological data. This uses a simple model of the
  atmosphere and Liebe's model (1985) of the complex refractive index of
  air.

  The model of the atmosphere is one with an exponential fall-off in
  the water vapour content (scale height of 1540 m) and a temperature lapse
  rate of 6.5 mK/m. Otherwise the atmosphere obeys the ideal gas equation
  and hydrostatic equilibrium.

  Input:
    freq       Frequency (Hz).
    el         Elevation angle (radians).
    t0,p0,h0   Met data - Observatory temperature, pressure and humidity
               (Kelvins, Pascals and fraction).

  Output:
    fac        Transmissivity (fraction between 0 and 1).
    Tb         Sky brightness temperature (Kelvin).
