You can grow trees in pots. Many people do this. But you need a tree that is suitable for the pot, and isn't going to out grow the pot. Containers also tend to easily dry out so you need some way of keeping the tree well watered in hot conditions.
To calculate the size of the tree, you need to know where the sun is at the time you want the shade. If you're on the equator, then the sun will be directly overhead and you won't get much shade from anything without an extensive canopy. If the sun is not directly overhead, then you can calculate using geometry the final height of the tree needed to provide shade.
You may also need to find out the engineering loading for your concrete roof. Concrete is strong in compression, but weak in tension. Likely your roof has been reinforced with steel, but it will still have a rated loading. The reason you need to know this is that some trees keep growing. An oak starts from an acorn. With the wrong choice of trees, you might be exceeding the roof loading specifications.