The SRD rules on characters underwater show a rather surprising lack of understanding about what being underwater is in fact like for a person. “When underwater, characters can move in any direction as if they were flying with perfect maneuverability”, and “Listen and Move Silently checks function normally underwater” are examples of what I mean.
At any rate, “Spells or spell-like effects with the fire descriptor are ineffective underwater unless the caster makes a Spellcraft check (DC 20 + spell level). If the check succeeds, the spell creates a bubble of steam instead of its usual fiery effect, but otherwise the spell works as described.” I think the implication here is abundantly clear that other spells function exactly as normal.
Personally, I think cold spells would also have some different effects, along with some others. I don’t think they knocked themselves out there, exactly.
Also, personally, I think that a character loaded for travel who finds themselves underwater suddenly would lack the ability to perform even the somatic part of a spell, given the flailing to avoid sinking and drowning, and would rapidly run out of any air available to mutter underwater. If a character went underwater deliberately, then I could see them casting for one or two rounds, but that would use up all of their air, in my view; talking is rather overtly different form holding breath.