Automate grid refinement from the command line.