  We present a model of the global magnetic field in the barred galaxy NGC 1365
based jointly on the large-scale velocity field of interstellar gas fitted to
HI and CO observations of this galaxy and on mean-field dynamo theory. The aim
of the paper is to present a detailed quantitative comparison of a galactic
dynamo model with independent radio observations. We consider several gas
dynamical and nonlinear dynamo models that include plausible variations of
parameters that are poorly known. Models of cosmic ray distribution in the
galaxy are introduced to produce synthetic radio polarization maps allowing
direct comparison with those observed at 3.5cm and 6.2cm. We show that the
dynamo model is robust in that the most important magnetic features are
controlled by the relatively well established properties of the density
distribution and gas velocity field. The optimal agreement between the
synthetic polarization maps and observations is obtained when a uniform cosmic
ray distribution is adopted. We find some indirect evidence for enhanced
turbulence in the regions of strong velocity shear and within 1-2kpc of the
galactic centre. We confirm that magnetic stresses can drive an inflow of gas
into the inner 1kpc of the galaxy at a rate of a few solar masses per year. The
dynamo models are successful to some extent in modelling the large scale
regular magnetic field in this galaxy. Our results demonstrate that dynamo
models and synthetic polarization maps can provide information about both the
gas dynamical models and conditions in the interstellar medium. We demonstrate
that the dynamical effects of magnetic fields cannot be everywhere ignored in
galaxy modelling.
