Sorry to be a year late but this may help someone else.
If you want to be spot-on accurate, purchase the high-res Admiralty Plan of HMS Discovery (1789) here:
https://prints.rmg.co.uk/products/discovery-1789-j0509?_pos=2&_sid=80e1c1879&_ss=r Then measure the gunports! This is the best method, far better than any regulations that might or might not have been followed.
Next best to regs are formula.
Not as precise as you would like since it is a generic, but the Ship Model Builder's Assistant, p.229, has general formula for gunport sizing and spacing based on diameter of the shot. E.g., 4 lb shot 3.053" diameter, 6 lb 3.494", 9 lb 4", 12 lb 4.403", 18 lb 5.040", 24 lb 5.546", 32 lb 6.106", 36 lb 6.350", 42 lb 6.684". Ports from center to center should be spaced 25 times diameter. Port length (fore and aft) 6.5 times diameter. Port height 6 times diameter. Sills should be 3.5 times diameter above deck. Thickness of gun carriage sides should be same as diameter of shot and bolts 1/5. Missing, unfortunately, is the sill height which I believe you need to figure the height of the port above deck. Chapman, Architectura Navalis Mercatoria, p.141, has his table for pounds, sill height above deck, height of ports, breadth of ports.
The formula for sill height (the piece of lumber) based on this and an American ship table (differs from the usual), Ship Model Builder's Assistant, p.230, appears parabolic rather than linear.