Add type parameter to enable compile-time optimization of shmem DArray indexing

In case a PR is useful on this...