There are 2 possible solutions:
1) Make the naval yard built on land and give each ship a SET_NORMAL locomotor which moves on both land and water, but slowly and downhill only (see AvalanchLocomotor), then when it is in the water the player can upgrade it with an object level upgrade that upgrades its locomotor set to a water only locomotor. The land and water locomotor should have appearance=TREADS so it can turn in place. With this option you can also have dozers or workers build the ships (instead of a shipyard) on dry land and then slide them down into the water and upgrade them to move in water only.
2) Make the naval yard a movable floating structure with a land and water locomotor, so that you get the dozer to build it on land, and then you can float it out to sea and build ships directly on the water. This is the option i settled on in my navalised map.ini. My naval yard could can even build ships whilst on the move but it looked silly so i made it so that the player has to anchor it in one spot before he could start building boats.
You can see a single player test map with movable aircraft carriers, swimming infantry, the floating shipyard, and 2 types of submarines, all done by map.ini only, not a mod, at:
Beng's Naval Mod Map.ini for Zero Hour - Cncmaps Map Editing Forums
See the readme and the map.ini, the code is all there. Open the map in worldbuilder to see which objects i changed into ships etc. The map.ini is intended for makers of maps who want a navalised map. All the ships and boats etc are made from unused objects that are not used by any faction normally. However i doubt it will work for multiplayer maps because map.inis famously cause mismatch errors. It should be fine for single player maps though.
To enable the naval units, you need to place the supply prison for players to capture. When the capture it and repair it, it gives them supplies, special supply trucks, and can build a special agent infantry unit who can swim and who can build the shipyard. The shipyard then builds all the boats, submarines, etc. I can't remember if i made it able to build the aircraft carrier or not but try it and see.
The aircraft carrier can move to a location and deploy, but once deployed it cannot move again as it becomes a building (if you deploy it at the water's edge you can see it flatten the terrain and make a dent there). Also note that when you deploy it it will be rotated 180 degrees backwards as the moving version is actually backwards because EA games put their aircraft carrier 3D model backwards and i had to make it backwards to make it look like it was moving forwards.