Figured it out.
GRID_NAME should be the exact one from the metadata, which can be achieved by hdfinfo.
For example,
fileinfo = hdfinfo('MCD12C1.A2009001.051.2013164180520.hdf');
In fileinfo>attributes>'StructMetadata.0', there is GridName.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!