ninput function

Get the spatial dimension