编辑代码

program main
	real(kind=8), dimension (:), allocatable :: evsTime
    real(kind=8), dimension (:,:), allocatable :: evsCoord
    real(kind=8), dimension (:,:), allocatable :: evsField
    real(kind=8) StartP(5), EndP(5)
    real(kind=8) a(3)
    COMMON /my_common_block/ a(3)
    a(1) = 10.5
    a(2) = 20.0
    a(3) = 30.0

    allocate(evsTime(5))
    allocate(evsCoord(3,5))
    allocate(evsField(1,5))

    do i = 1,3
        do j = 1,5
            evsCoord(i,j) = 1.0*i + 2.0 * j
        end do
    end do

    call test()
    call test2()

    do i = 1,3
        print*,evsCoord(i,:)
    end do
    StartP(2:4) = evsCoord(:,1)
    print*,StartP
end

subroutine test()
real(kind=8) b(3)
    COMMON /my_common_block/ b(3)
    print*,b
return 
end

subroutine test2()
real(kind=8) c(3)
    COMMON /my_common_block/ c(3)
    print*,c
return 
end