  We study charm production in ultra-relativistic heavy-ion collisions by using
the Parton-Hadron-String Dynamics (PHSD) transport approach. The initial charm
quarks are produced by the Pythia event generator tuned to fit the transverse
momentum spectrum and rapidity distribution of charm quarks from Fixed-Order
Next-to-Leading Logarithm (FONLL) calculations. The produced charm quarks
scatter in the quark-gluon plasma (QGP) with the off-shell partons whose masses
and widths are given by the Dynamical Quasi-Particle Model (DQPM) which
reproduces the lattice QCD equation-of-state in thermal equilibrium. The
relevant cross section are calculated in a consistent way by employing the
effective propagators and couplings from the DQPM. Close to the critical energy
density of the phase transition, the charm quarks are hadronized into $D$
mesons through coalescence and/or fragmentation depending on transverse
momentum. The hadronized $D$ mesons then interact with the various hadrons in
the hadronic phase with cross sections calculated in an effective lagrangian
approach with heavy-quark spin symmetry. Finally, the nuclear modification
factor $\rm R_{AA}$ and the elliptic flow $v_2$ of $D^0$ mesons from PHSD are
compared with the experimental data from the STAR Collaboration for Au+Au
collisions at $\sqrt{s_{\rm NN}}$ =200 GeV. We find that in the PHSD the energy
loss of $D$ mesons at high $p_T$ can be dominantly attributed to partonic
scattering while the actual shape of $\rm R_{AA}$ versus $p_T$ reflects the
heavy quark hadronization scenario, i.e. coalescence versus fragmentation. Also
the hadronic rescattering is important for the $\rm R_{AA}$ at low $p_T$ and
enhances the $D$-meson elliptic flow $v_2$.
