dirt to grass under certain conditions

I wanted to make a water lake feature, which would basically be exactly the same as existing lava lakes but with water instead of lava and dirt/grass instead of stone. How do I specify in the 'barrier' field that I want grass blocks to generate whenever there's air one block above, but dirt everywhere else?

Continue to help post