A variational method for the calculation of spin–rovibronic energy levels of any triatomic molecule in an electronic triplet state