  We study the splitting of a harmonically trapped atomic Bose-Einstein
condensate when we continuously turn up an optical lattice (or a double-well)
potential. As the lattice height is increased, quantum fluctuations of atoms
are enhanced. The resulting nonequilibrium dynamics of the fragmentation
process of the condensate, the loss of the phase coherence of atoms along the
lattice, and the reduced atom number fluctuations in individual lattice sites
are stochastically studied within the truncated Wigner approximation. We
perform a detailed study of the effects of temperature and lattice height on
atom dynamics, and investigate the validity of the classical Gross-Pitaevskii
equation in optical lattices. We find the atom number squeezing to saturate in
deep lattices due to nonadiabaticity in turning up of the lattice potential
that is challenging to avoid in experiments when the occupation number of the
lattice sites is large, making it difficult to produce strongly number squeezed
(or the Mott insulator) states with large filling factors. We also investigate
some general numerical properties of the truncated Wigner approximation.
