All damage is always (what I have observed in many similar attacks at least) assigned to the land unit in port.
In the screenshot example the sub attack does no damgae to the enemy ship, only to the enemy land unit.
I have set up the sub SFT to only be able to damage naval vessels.

