Fix bug arising from the reorganized griddecl in datawrite

ndims was not being set because of being renamed to ndims_decl.
This was found by running make geometry. Now that runs to completion
However the files are different now because file writing has been changed.