Rob, I would use ReplacePart to avoid the error
FSD[r_, xdim_, ydim_] := Module[{}, ReplacePart[r, 5, {1, 1}]]
To see what is going on try this simpler problem:
b=(1,2)
myfunc[b_]:=b[[1]]=5
Now evaluate
Trace[myfunc[b]]
Here is a snippet of the output
{{b, {1, 2}}, myfunc[{1, 2}], {1, 2}[[1]] = 5, {Message[Set::setps, {1,
2}],....
During the evaluation b gets replaced with {1,2} so that Mathematica is
trying to evaluate {1,2}[[1]] and hence the reason for the error. If on
the other hand you evaluate
c={1,2}
Trace[c[[1]]=5]
{c[[1]] = 5, 5}
Hope this helps,
Cheers,
Brian