finally we can read and write grid volume into kernel function