This paper reports a method to build a semiclassical wave function correspo
nding to an invariant torus satisfying Einstein-Brillouin-Keller quantizati
on conditions. Instead of calculating the stability matrix of the trajector
y at each step, as in the standard method of Keller [Ann. Phys. (N.Y.) J, 1
80 (1958)] or the modification of Maslov and Fedoriuk [Semiclassical Approx
imations in Quantum Mechanics (Reidel, Dordrecht, 1981)], we use the actual
density of the trajectory, calculated by running the trajectory and counti
ng passages through cells in coordinate space. The method is tested for a s
ystem of coupled Morse oscillators, and found to be comparable in accuracy
to the standard method. It may be mon useful than the standard method for t
esting ideas for semiclassical quantization in the chaotic regime.