The ecosystem with the highest level of biodiversity will be that in which there is high richness (number of species) and high evenness (equal contribution to the community among species).
When it comes to the second question, you need to know which variable is limiting in that ecosystem, according to Liebig's Law of the Minimum. If it is a nutrient, then nutrient availability will control primary productivity, if it is light availability, then nutrient availability will not matter too much.
In the aquatic ecosystem, coral reefs show the highest gross primary productivity. Large numbers of aquatic phototrophs and phytoplankton contribute to the productivity of the ecosystem. Coral reefs are believed to have the greatest biodiversity. They provide habitats for around 25% of marine organisms. The highest net primary productivity in terrestrial environments occurs in swamps and marshes and tropical rainforests; the lowest occurs in deserts. Coral reefs are believed by many to have the highest biodiversity of any ecosystem on the planet even more than a tropical rainforest. Occupying less than one percent of the ocean floor, coral reefs are home to more than 25% of all marine life. In terrestrial ecosystems Tropical rain-forests show the highest productivity. In aquatic ecosystems, coral reefs have the highest productivity. Primary productivity, in ecology, the rate at which energy is converted to organic substances by photosynthetic producers which obtain energy and nutrients by harnessing sunlight, and chemosynthetic producers which obtain chemical energy through oxidation. If an essential nutrient is in short supply, primary productivity will be limited. The nutrient whose supply limits productivity is called the limiting nutrient. The growth of crop plants is typically limited by one or more nutrients that must be taken up by plants through their roots.Coral reefs are considered to be the most biologically diverse of all marine ecosystems, supporting an estimated 25 percent of all marine life and 32 of the current 34 existing animal phyla. As you might expect, the terrestrial biome with the highest level of primary productivity is the tropical rainforest biome with around 2,200 grams of biomass per square meter per year. Estuarine areas have high biodiversity compared to other areas. Trophical rainforests are rich in terms of biodiversity and arid and semiarid areas have low biodiversity. Tropical forests are widely considered to have the greatest species diversity of the terrestrial biomes and the tundra biome has the least