  We investigate the physical structure of the gas component of the disk around
the pre-main-sequence star HD169142. The 13CO and C18O J=2-1 line emission is
observed from the disk with 1.4'' resolution using the Submillimeter Array. We
adopt the disk physical structure derived from a model which fits the spectral
energy distribution of HD169142. We obtain the full three-dimensional
information on the CO emission with the aid of a molecular excitation and
radiative transfer code. This information is used for the analysis of our
observations and previous 12CO J=2-1 and 1.3 mm continuum data. The disk is in
Keplerian rotation and seen at an inclination close to 13 deg from face-on. We
conclude that the regions traced by different CO isotopologues are distinct in
terms of their vertical location within the disk, their temperature and their
column densities. With the given disk structure, we find that freeze-out is not
efficient enough to remove a significant amount of CO from gas phase. Both
observed lines match the model prediction both in flux and in the spatial
structure of the emission. Therefore we use our data to derive the 13CO and
C18O mass and consequently the 12CO mass using standard isotopic ratios. We
constrain the total disk gas mass to (0.6-3.0)x10(-2) Msun. Adopting a maximum
dust opacity of 2 cm2 per gram of dust we derive a minimum dust mass of
2.16x10(-4) Msun from the fit to the 1.3 mm data. Comparison of the derived gas
and dust mass shows that the gas to dust mass ratio of 100 is only possible
under the assumption of a dust opacity of 2 cm2/g and 12CO abundance of 10(-4)
with respect to H2. However, our data are also compatible with a gas to dust
ratio of 25, with a dust opacity of 1 cm2/g and 12CO abundance of 2x10(-4).
