P\'egase.3: A code for modeling the UV-to-IR/submm spectral and chemical
  evolution of galaxies with dust
  A code computing consistently the evolution of stars, gas and dust, as well
as the energy they radiate, is required to derive reliably the history of
galaxies by fitting synthetic SEDs to multiwavelength observations. The new
code P\'egase.3 described in this paper extends to the far-IR/submm the
UV-to-near-IR modeling provided by previous versions of P\'egase. It first
computes the properties of single stellar populations at various metallicities.
It then follows the evolution of the stellar light of a galaxy and the
abundances of the main metals in the ISM, assuming some scenario of mass
assembly and star formation. It simultaneously calculates the masses of the
various grain families, the optical depth of the galaxy and the attenuation of
the SED through the diffuse ISM in spiral and spheroidal galaxies, using grids
of radiative transfer precomputed with Monte Carlo simulations taking
scattering into account. The code determines the mean radiation field and the
temperature probability distribution of stochastically heated individual
grains. It then sums up their spectra to yield the overall emission by dust in
the diffuse ISM. The nebular emission of the galaxy is also computed, and a
simple modeling of the effects of dust on the SED of star-forming regions is
implemented. The main outputs are UV-to-submm SEDs of galaxies from their birth
up to 20 Gyr, colors, masses of galactic components, ISM abundances of metallic
elements and dust species, supernova rates. The temperatures and spectra of
individual grains are also available. The paper discusses several of these
outputs for a scenario representative of Milky Way-like spirals. P\'egase.3 is
fully documented and its Fortran 95 source files are public. The code should be
especially useful for cosmological simulations and to interpret future mid- and
far-IR data, whether obtained by JWST, LSST, Euclid or e-ELT.
