The attorney general and the district attorney of the county in which legal questions arise, shall be the legal advisers of the state engineer, and shall perform any and all legal duties necessary in connection with his work, without other compensation than their salaries as fixed by law, except when otherwise provided.