WASHINGTON (AP) _ In the midst of a major submarine construction program, the Navy is facing a worsening shortage of nuclear-trained officers to man its subs, service officials said Wednesday.

The problem is considered so serious that it is one of only two ''manpower retention'' problems cited by Defense Secretary Caspar W. Weinberger in his annual report accompanying the fiscal 1986 budget. The other is retention of skilled pilots for the Navy and Air Force, although major improvements in that area are cited as well.

Such is not the case with the submarine officers. In testimony to the Senate Armed Services Committee, Navy Secretary John F. Lehman Jr. and Adm. James D. Watkins, the chief of naval operations, cited that manpower problem in urging Congress to consider improvements to various bonus programs.

Specific proposals were not outlined, but Watkins promised the Navy would soon submit ''urgently needed legislative proposals, which modify nuclear officer incentive pay and submarine duty incentive pay, to target these essential experienced officers.''

Watkins also called the submarine officer shortage ''our most serious manpower problem.''

''With inventory (of officers) 18 percent short of requirements at the end of fiscal 1984, sea billets are kept filled by extending sea-tour lengths and assigning most officers back-to-back sea tours,'' he added. ''Some critical shore billets are not manned. Unless corrected, the experienced nuclear officer shortage will grow to 21 percent by fiscal 1987.''

Watkins also said the Navy is facing a ''critical inventory shortage of experienced post-command submarine officers, which is projected to grow from four percent in fiscal 1984 to 22 percent in fiscal 1990.''

Post-command officers are men who have already served in submarine command positions, primarily on attack submarines. It is from their ranks that commanders for Trident missile submarines are drawn, as well as key leaders for sub squadrons and tenders and important shore posts.

Watkins said the Navy has set a goal of retaining 55 percent of the 370 nuclear submarine officers who will be eligible to leave the service this fiscal year. The Navy has already concluded, however, that it will likely retain only 47 percent, or roughly 175, of those officers - more than two dozen short.

Watkins also said ''the number of officers submitting letters of resignation in 1984 stating a request to resign in 1985 rose dramatically - from 211 to 279 for nuclear submariners.''

All of this comes at a time when the Navy's underwater force is expanding. The Navy currently has 31 nuclear-powered ballistic missile submarines and 97 nuclear-powered attack submarines. Five more subs are scheduled to be commissioned by the end of fiscal 1986. In addition, the Pentagon's five-year spending plan calls for 18 additional attack submarines and five more Trident missile submarines.

Watkins' emphasis on better pay comes at a time when questions are being raised about whether salary improvements would solve the problem. According to the Navy, a lieutenant serving on a submarine, married and with five years' service, can earn more than $43,000 including base pay plus submarine, sea duty and nuclear bonuses. A commander can earn more than $64,000.

But in an article published this week by the U.S. Naval Institute, a Naval Reserve officer argued the problem is not salary but long family separations ''and a career path that is both rigid and excessive.''

Capt. F. G. Satterthwaite, a professor of management at the Monterey Institute of International Studies, argued the Navy needs to rethink the way it trains submarine officers to attract more men and thus avoid deployments that can last as long as 300 days out of the year.