modified defstruct.f90 for 3d