m_arrays.f90 Source File


Source Code

module m_arrays

use, intrinsic :: iso_fortran_env, only: real64
use m_parameters

implicit none

real(real64), allocatable, dimension(:,:,:) :: u,v,w,y

contains

subroutine m_arrays_init

integer :: ierr

ALLOCATE(u(nxp,nyp,nzp),STAT=ierr)
if (ierr /= 0) then
    write(0,*) "Error: allocation of u failed on process", myid
    call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err)
end if
u=0.

ALLOCATE(v(nxp,nyp,nzp),STAT=ierr)
if (ierr /= 0) then
    write(0,*) "Error: allocation of v failed on process", myid
    call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err)
end if
v=0.

ALLOCATE(w(nxp,nyp,nzp),STAT=ierr)
if (ierr /= 0) then
    write(0,*) "Error: allocation of w failed on process", myid
    call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err)
end if
w=0.

ALLOCATE(y(nxp,nyp,nzp),STAT=ierr)
if (ierr /= 0) then
    write(0,*) "Error: allocation of y failed on process", myid
    call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err)
end if
y=0.

end subroutine m_arrays_init


subroutine m_arrays_finalize

DEALLOCATE(u)
DEALLOCATE(v)
DEALLOCATE(w)
DEALLOCATE(y)

end subroutine m_arrays_finalize


end module m_arrays