  CO is one of the most abundant molecules in protoplanetary disks, and
optically thin emission from its isotopologues has been detected in many of
them. However, several past works have argued that reproducing the relatively
low emission of CO isotopologues requires a very low disk mass or significant
CO depletion. Here, we present a Python code, DiskMINT, which includes gas
density and temperature structures that are both consistent with the thermal
pressure gradient, isotope-selective chemistry, and conversion of CO into
$\mathrm{CO_2}$ ice on grain-surfaces. The code generates a self-consistent
disk structure, where the gas disk distribution is obtained from a Spectral
Energy Distribution (SED)-derived dust disk structure with multiple grain
sizes. We use DiskMINT to study the disk of RU~Lup, a high-accreting star whose
disk was previously inferred to have a gas mass of only $\sim
1.5\times10^{-3}\,M_\odot$ and gas-to-dust mass ratio of $\sim 4$. Our best-fit
model to the long-wavelength continuum emission can explain the total
$\mathrm{C^{18}O}$ luminosity as well as the $\mathrm{C^{18}O}$ velocity and
radial intensity profiles, and obtains a gas mass of $\sim
1.2\times10^{-2}\,M_\odot$, an order of magnitude higher than previous results.
A disk model with parametric Gaussian vertical distribution that better matches
the IR-SED can also explain the observables above with a similarly high gas
mass $\sim 2.1\times10^{-2}\,M_\odot$. We confirm the conclusions of Ruaud et
al. (2022) that optically thin $\mathrm{C^{18}O}$ rotational lines provide
reasonable estimates of the disk mass and can therefore be used as gas disk
tracers.
