Frequency control in subterahertz gyrotrons