A ported enclosure can be tuned to a specific frequency. The tuning plays a LARGE role in how your subs will sound, along with box volume, and somewhat port area.
Tuning is determined by a complex formula. You need to know your NET box volume (volume the woofers actually "see" after all displacements), as well as the size or cross-sectional area of the port (known a port area). Once you know these two parameters, you need to decide your desired tuning frequency. For daily driving, I recommend anywhere from 28hz-38hz. The lower tuning will result in better Sound Quality, and generally a flatter response. A higher tuning will result in higher SPL (louder) but generally will have less SQ and a peakier response. Personally, I like tuning around 30-33hz myself, for a good mix of SQ and Output.
So, you know your NET Volume, Port area, and desired tuning. Using the Port length formula...you can find the need length for your port.
There are numerous programs, and calculators online...BUT they don't do it all for you. You need to know how to properly solve for unknowns and such when properly finding the NET volume and displacements and such.
But, that in a nutshell is what it is.
NG