If you break down your swim Into component parts there are lots gym exercises your can do. I try workout abs, chest, back, and arms whenever I'm unable to get in wet training, and sometimes it helps to get the kinks out (active recovery) after a wicked hard master swim workout. Not just your old high school weight groups but exercises that simulate elements of the swim . When you're doing your swim warmups try to think about which muscle are working as you warming up you should be able to feel the enage as they become to loosen up.
Starting in the middle. Core is abs, this is where alot of the strength in your stroke comes from. rotation of the hips is the key to power in the water. Find some crunches that work the obilques. Warmup with some push ups, flip over onto your back, work some crunches with your legs up and reach to your toes. back to pushups, down, up and then rotate your core to the side and reach your left arm to the sky, down to push up, rotate onto your side and then reach your right arm to the sky. get the idea? I think those are called T-Up's.
Having fun yet? From a seated position, raise your legs so your balanced on your glutes, bring your legs to your chest. Repeat, Can you do this with your arms crossed your chest? This is another variation.Lay on your side. Hold you body up on an elbow, now bring your knees to your chest, extend and repeat. Can you do this without holding your body up with you arm, just balancing.
Any core strength will help with your swimming.
Thinking you need some work on your catch? Do you have one of those cable pully machines with the arms that adjust. Lots of people use this to improve golf or baseball bat swing. Here is how you can improve your catch. Set the machine so the arms are pointing to the sky maybe just two clicks of angle. Put on a light weight. protect your shoulders. The idea is to simulate the the movement of the hand to elbow and then press down to your hips. You cannot practice the full stroke here, there;s no way to finish at your hip and recover but you can get a good catch workout.
Of course seated row works the lats
Look at the muscle on a collegete swimmers: chest, lats, back and abs. There are the muscle groups you want to strengthen to improve your swim. Of course weight training cannot eliminate the need to get a feel for the water by swimming. But sometimes you get a kink in a muscle group swimming and need to go to the gym and work the problem out.
I hope this helps you and does not confuse to much.
Swim/Bike/Run Happy.