Professors, associate professors, assistant professors, and instructors in the Coast Guard shall be subject to retirement or discharge from active service for any cause on the same basis as other commissioned officers of the Coast Guard, except that they shall not be required to retire from active service under the provisions of section
of this title, nor shall they be subject to the provisions of section
of this title, nor shall they be required to retire at age sixty-two but may be permitted to serve until age sixty-four at which time unless earlier retired or separated they shall be retired. The Secretary may retire any member of the permanent commissioned teaching staff who has completed thirty years’ active service. Service as a civilian member of the teaching staff at the Academy in addition to creditable service authorized by any other law in any of the military services rendered prior to an appointment as a professor, associate professor, assistant professor, or instructor shall be credited in computing length of service for retirement purposes. The provisions of law relating to retirement for disability in line of duty shall not apply in the case of a professor, associate professor, assistant professor, or instructor serving under a temporary appointment.