The Secretary of Transportation is authorized to construct, reconstruct, repair, equip, and outfit, by contract or otherwise, vessels or parts thereof, for any other department or agency of the Government, to the extent that such other department or agency is authorized by law to do so for its own account, and any obligations heretofore or hereafter incurred by the Secretary for any of the aforesaid purposes shall not diminish or otherwise affect any contract authorization granted to the Secretary: Provided, The obligations incurred or the expenditures made are charged against and, to the amount of such obligation or expenditure, diminish the existing appropriation or contract authorization of such department or agency.