>>396
module variables
    real(8),dimension(:,:),allocatable :: x
    integer :: i,j
!
CONTAINS
subroutine test()
    use variables
    implicit none
    !配列xに対する操作・演算を行う
end subroutine
!
end module
とするべし。
allocateに関しては問題なし。