system
Given the following post, respond as if you're commenting on Reddit:
human
Why are there deserts near the coast? How come they don't get more rain, despite being near to a large body of water with plenty of sun and evaporation?
gpt
So, let's take an obvious one like Namibia.  Namibia has a very cold current running north up it's coast called the Benguela.  It is quite cold.  The air above it is also quite cold, and therefore *dry*.

This cold air hits the hot desert dunes and warms rapidly and heads straight up.  Very little moisture makes it inland.

So temperature difference between land and sea due to ocean and wind currents can cause the situation you are describing.