module tests implicit none integer, parameter :: WP = KIND(1.0D0), elem_xr=600 contains !------------------------------------------------------------------------------ function func1() implicit none real(WP) :: func1(0:elem_xr-1, 0:elem_xr-1) ! write(*,*) 'entered func1' func1 = 0.0_wp end function func1 !------------------------------------------------------------------------------ subroutine func2() implicit none real(WP), dimension(0:elem_xr-1, 0:elem_xr-1) :: array1 array1(0:elem_xr-1,0:elem_xr-1) = & func1()+func1()+func1()+func1() end subroutine func2 !------------------------------------------------------------------------------ subroutine func3() implicit none include 'mpif.h' integer :: ierror, my_rank, mpi_proc call MPI_INIT(ierror) ! write(*,*) 'ierror = ', ierror call MPI_COMM_RANK(MPI_COMM_WORLD, my_rank, ierror) ! write(*,*) 'ierror = ', ierror call MPI_COMM_SIZE(MPI_COMM_WORLD, mpi_proc, ierror) ! write(*,*) 'ierror = ', ierror call func2() call MPI_FINALIZE(ierror) end subroutine func3 !------------------------------------------------------------------------------ end module tests program testsuite use tests implicit none call func3() end program testsuite