do k = 1, nz, 1 do j = 1, ny, 1 do i = 1, nx, 1 x = i + nx * (j - 1) + (nx*ny) * (k - 1) threeDarray(i,j,k) = oneDarray(x) enddo enddo enddo