I live in Edmonton Alberta. My problem is the ensuite bathroom that we shower in all the time. The bathrooms have fans vented through the attic and have same vents as shown above. We can not use the ensuite fan in the winter. With the moisture and warm air it melts the snow which freezes, ices up and it backs up. The eavestroughs get filled with ice which backs up from there destroying the shingles and causing leakage in the house. I don't know how to solve this problem. I am wondering if the "CODE" allows the use of a vent pipe that goes through and sits 2 feet above roof similar to the furnace vent?
I can't speak specifically to your code, but I can't imagine a code that would permit a bathroom vent to be vented into the attic space. It is the goal to keep water vapor out of the attic. The pipe should extend through the roof a certain distance (determined by code - maybe 12") above anticipated snow levels.
bcworkz is correct on the exhaust termination. If there was code to follow on this it would be very local. First I would insulate the pipe exiting the house. Wrap it fully. Next I would seriously think about venting this out the side of the house. I have vented on the side of more than a few houses and you can't even notice.
I've not encountered any code that was very specific about exhaust fan termination. They may just say it shall be directed outside the building and prevent entry to rain or something like that without any more specificity.
I believe a standard 4" Type B furnace vent installed near the ridge would work quite well. The double wall would help prevent melting against the pipe. If you live in a subdivision with architectural restrictions, there may be requirement to use the low profile type. OTOH, a single vent located on a slope away from the road would hardly be noticeable.
Even near the ridge, stay away from any valley areas.