I don't really get whats the purpose of dorsal fins and what they do with the flow over the vertical stabilizer. I noticed on most single tail configured aircrafts are equipped with a dorsal fin like the f 16.
There are two features that you may be referring to.
A) Is an antenna that is shaped to provide low drag. Not all F16 have this.
B) The true dorsal "fin":
- increases structural strength
- decreases drag by providing a fillet for the vertical stabilizer,
- improves stability about the vertical axis,
- and specifically in the case of the f16 (when installed) aerodynamically blends the drag chute pack (box at base of Rudder)
- many aircraft use this as a convenient air intake for equipment or auxiliary cooling.
If you are asking about the aerodynamic purpose of a dorsal fin, then dorsal fin actually increases the angle of side slip to get maximum side force. At high side slip angles, it produces stable vortices along the surface of the vertical tail which produces higher suction force over vertical tail, thus increasing the side force.
So in absence of the dorsal fin at high side slip angle, aircraft would have stalled i.e. just as jwzumwalt said, it provides stability along the vertical axis. According to me as F-16 is a fighter aircraft which requires high maneuverability, it would require a dorsal fin to stabilize at high side slip angles.
The fin acts as a directional stabiliser, but not all aircraft or fighters have them. The Horten IX (Gotha Go 229) was a notable flying wing fighter design that didn't have a fin.