State global allocate using shmem

This is easier than rewriting the write_taj and does not affect the DD part of the code.
The allocation is done only if PD is used.