Spectroscopic observations of solar flares provide critical diagnostics of the physical conditions in the flaring atmosphere . Some key features in observed spectra have not yet been accounted for in existing flare models . Here we report a data-driven simulation of the well-observed X1.0 flare on 2014 March 29 that can reconcile some well-known spectral discrepancies . We analyzed spectra of the flaring region from the Interface Region Imaging Spectrograph ( IRIS ) in Mg ii h & k , the Interferometric BIdimensional Spectropolarimeter at the Dunn Solar Telescope ( DST/IBIS ) in H \alpha 6563 Å and Ca ii 8542 Å , and the Reuven Ramaty High Energy Solar Spectroscope Imager ( RHESSI ) in hard X-rays . We constructed a multi-threaded flare loop model and used the electron flux inferred from RHESSI data as the input to the radiative hydrodynamic code RADYN to simulate the atmospheric response . We then synthesized various chromospheric emission lines and compared them with the IRIS and IBIS observations . In general , the synthetic intensities agree with the observed ones , especially near the northern footpoint of the flare . The simulated Mg ii line profile has narrower wings than the observed one . This discrepancy can be reduced by using a higher microturbulent velocity ( 27 km s ^ { -1 } ) in a narrow chromospheric layer . In addition , we found that an increase of electron density in the upper chromosphere within a narrow height range of \approx 800 km below the transition region can turn the simulated Mg ii line core into emission and thus reproduce the single peaked profile , which is a common feature in all IRIS flares .