For a triatomic molecule, we develop the rovibronic Hamiltonian, basis functions, and matrix elements necessary to allow us to determine the energy levels and wavefunctions in the situation that two potential energy surfaces touch at the linear configuration, The calculation of the rovibronic energy levels is complicated by the effect of the electronic angular momentum (the Renner effect), and while dealing with this problem we include spin-orbit coupling. We have written a computer program to implement the procedure, We base our approach on the MORBID Hamiltonian and computer program for an isolated electronic state [P. Jensen, J. Mol. Spectrosc. 128, 478-501 (1988); J. Chem. Sec. Faraday Trans. 2 84, 1315-1340 (1988); in ''Methods in Computational Molecular Physics'' (S. Wilson and G. H. F. Diercksen, Eds.), Plenum Press, New York, 1992]. The approach leads to a very efficient computational procedure that will, in the future, allow us to make fittings to data in order to determine potential energy surfaces and spin-orbit coupling functions. In this paper we test the computer program implementing the new procedure by calculating rovibronic energies for the ($) over tilde a(1)A(1) and ($) over tilde b(1)B(1) electronic states of the methylene radical CH2 on the basis of ab initio data by W. H. Green, Jr., N. C. Handy, P. J. Knowles, and S. Carter [J. Chem. Phys. 94, 118-132 (1991)] and comparing our results with the rovibronic energy values obtained by these authors. We also report vibronic (i.e., J = 0)energies determined on the basis of a fitted potential for the ($) over tilde a(1)A(1) state by P. Jensen and P. R. Bunker [J. Chem. Phys. 89, 1327-1332 (1988)]. Comparison between these vibronic energies and MORBID results determined from the fitted ($) over tilde a-state potential throws significant doubt on previous estimations of the ($) over tilde a-state barrier to linearity by Dai and co-workers [see G. V. Hartland, D. Qin, and H.-L. Dal, J. Chem. Phys. 98, 2469-2472 (1993) and references therein], Finally, we construct quantitative correlation diagrams showing how the rovibronic energies change as the potential energy surfaces are adjusted from linear to bent. (C) 1995 Academic Press, Inc.