In this paper coupling effects and energy spectra are investigated for vertically stacked InAs/GaAs quantum dots under magnetic fields. The Hamiltonian considers here the position- and energy-dependent quasi-particle effective mass approximation and Lande factor, the finite hard wall confinement potential, and the Ben Daniel-Duke boundary conditions. A nonlinear iterative method is applied to solve the three-dimensional problem. For small quantum dots the transition energy is dominated by the number of stacked layers. The inter-distance d between layers plays a crucial role in the tunable states of the dots. For d=1 nm, it is found that there is about 25% variation in ground state energy at zero magnetic field. We observed that the dependence of magnetic fields on the electron transition energy is depressed when the number of vertically coupled layers is increased. This study is constructive for exploring the magneto-optical phenomena and quantum optical structures.