Pressure in fluids in the presence of gravity: a mesoscopic approach