diffusion coefficient versus distance from surface,

I don’t know exactly what you mean, but compute msd will compute
a z displacement of every atom from its original position. It will
also store each atoms original z position. You can dump those 2
values or the difference to a dump file whenever you want. You
can write a per-atom formula as a function of those 2 values.

You can use fix ave/histo to bin any of those quantities. You
can post process the dump file. Somewhere in that combination
should be the values you are looking for.

Steve

Dear Steve,
Thank you for your reply.
Here is the link of that paper I meant, fig 2. Maybe you do not have time to check it but I preferred to refer.

http://pubs.acs.org/doi/abs/10.1021/ja0487776

I do not know maybe I misunderstood.