Grdmath not outputting a grid


I am using version 6 of GMT.
I am inputting a large grid. I would like to take the RMS of every 3x3 grid within my input.
I have tried this by using grdmath, specifying increments of 3.
gmt grdmath $name.grd -I3 RMS = $name_rms.grd

I am not doing this correctly as my output file is empty. I get the error:
grdimage: Warning: No valid values in grid

Sorry that this is very simple but I cannot find an answer online.



For the warning message I think that there is a problem with the grid. Can you check this?