Fortunately, climate change is a fairly minor problem on the large scale, and one we'll have solved long before any serious issues emerge.
Sea level rises are a very minor issue, for the simple reason that such rises - a couple of metres - are tiny, and slow. There are a number of major population centres that will need additional flood protections, but we're really good at that (c.f. the Netherlands). Less populated coastlines won't be able to afford all those protections, but since they're less populated they'll just move a few hundred metres inland over the course of the century. Likewise, some hardly-populated islands will be submerged, but they're hardly populated. The populations we're talking about would be absorbed into the cities in the blink of an eye.
[predicted coastline changes are actually far smaller than we've experienced in much of the world already in the last centuries. In England, for instance, literally miles of land have been lost on the east coast, and literally miles of land have been added elsewhere - there's a town near me that became a coastal port town 500 years ago, and now is15 miles inland again. People adapt.]
Changes to soil fertility will be a bigger problem in the short term, in certain areas. It will undoubtedly exacerbate hardship in some places, until populations shift to compensate. On the other hand, the stress will be an order of magnitude less than has been suffered in much of Africa and India in the last half-century due to rapid population increases.
And even then, the worst effects only occur if you assume the worst possible course of future energy use for the next 500 years - and so far we're doing significantly better than that. True, we'll miss the targets to avoid "irreversible change"; but we should bear in mind that irreversible change is a constant in life, at the large scale. And if we assume that doomsday scenario, new opportunities will also open up (if you think this is likely, go buy up land in Alaska!).
Now, sure, global warming IS a problem and we SHOULD continue to do something about it. It will cost a lot of money, and prevention would be cheaper than cure. But we also shouldn't get histrionic about it as though it were some sort of civilisation-threatening crisis.
meanwhile, there can be no 'algorithmic' solution to moral quandaries. First, because there is no consensus on ethical questions in general. But more particularly, because any consequentialist approach to solving moral problems has to treat population as uncontrollable, which renders results suboptimal (what if controlling population were good?) and potentially irrelevent (what if population changes unpredictedly?).
[population has to be taken out of the equation, because population levels in consequentialism are the equivalent of dividing by zero. You have to arbitrarily set a baseline "value of human life", and if that's zero or negative then all problems are solved by reducing the population to zero (or in some setups the minimum sustainable population of a few hundred people, depending what values you've set), but if it's greater than zero than all problems are solved, in the longterm, by force-breeding humans to convert as much of the universe's matter into humans as possible. Both solutions are counterintuitive, particularly when they result from seemingly arbitrary differences in set-up]
[actually, more technically, it's about how you define utility and disutility. If you consider utility additively, you end up human-rabbiting (the value of a life is always greater than zero). If you define utility subtractively (start at zero and subtract suffering) you end up exterminating all human (the value of a life is always less than zero). To not yield infinite breeding or infinite extermination, you need to precisely balance the values of every possible bad thing with every possible good thing so that the average life in every feasible scenario always equals exactly zero - and not only is that not practically possible, but you still end up with an algorithm that wants to exterminate 50% of the human race all the time. This is considered a Problem by most consequentialists, but fortunately so far a theoretical one (they can use consequentialism in the short term the way we use newtonian equations in day-to-day situations at low velocities).]
This doesn't get into the broader problem that the sort of AINazism you suggest is both silly and deplorable. [Implementing AINazism would be just as difficult as implementing NAINazism, except you'd have to build your own Hitler first, imbedded with all the values real Hitler would have to have, which you'd have to decide yourself first. You may as well just go ask Hitler.]
But the river tripped on her by and by, lapping
as though her heart was brook: Why, why, why! Weh, O weh
I'se so silly to be flowing but I no canna stay!