As far as I can tell, trade route output does not add to surplus calculation, at least for food, and almost definitely for hammers.
Easy way to test it is to get a large, food neutral city (a capital transitioned from foodbasket to Academy Center), send some powerful Food routes to it from food/hammer centers, and then try to send out a TR to Specialized Cities. The resulting TR usually has no food or nearly no food whatsoever, both cities have nearly little or no surplus.
alpaca:
Whelp, I tried the Biowells. Super-expensive. Expensive in population, Worker time, tiles, and Energy. The best thing about the Biowells is that spamming them really allowed me to basically just expand everywhere. The worst thing about them is that very nearly every other tile that's not a Biowell had to be a Generator in order to cover the costs!
Biowells being 2 food and on Bionics with a hefty build time has several implications:
They are exactly as good as Ectogenesis-Farms for food, but cost 2 Energy more per tile. They come later, and can't be spammed as quickly unless you're PAC and you invest a crapton of hammers and maintenance on Workers.
They're half as good at food as Ecto+Vertical Farms. A 4-food Grassland generates 2 surplus for TR calculations, but there will rarely be that many empty Grasslands to take advantage with Biowell spamming. Most will be plains and Forests - the Biowells don't cut down the Forests, and cutting down Forests would take even more time. An Ecto/Vert Farmland City in the middle of a lot of Forest/flatland with Grasslands underneath will reliably generate a massive 3 food per tile, plus 1 energy - half a Generator.
The main issue with Ecto/Farms is growth - since they don't generate Health, you will almost always need to resort to building Health buildings in some amount. In my Biowell try-on game, I teched Health buildings only to find that I didn't need to build them at all!
If you have any advice on how to make up the Energy shortfall, that'd be great. Even with Organics, I was carpeting the land in Generators. I didn't have much room for Academies or Manufacturies.