Commit b0aec859 authored by Daniel Wortmann's avatar Daniel Wortmann

Added file missing in 01b9d8b8

parent 01b9d8b8
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_mpi_dist_forcetheorem
CONTAINS
SUBROUTINE mpi_dist_forcetheorem(mpi,forcetheo)
USE m_types
IMPLICIT NONE
TYPE(t_mpi),INTENT(in)::mpi
CLASS(t_forcetheo),ALLOCATABLE,INTENT(INOUT)::forcetheo
INTEGER::t,ierr
#ifdef CPP_MPI
INCLUDE 'mpif.h'
IF (mpi%irank==0) THEN
SELECT TYPE(forcetheo)
TYPE IS (t_forcetheo)
t=1
TYPE IS (t_forcetheo_mae)
t=2
END SELECT
ENDIF
CALL MPI_BCAST(t,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
IF (mpi%irank.NE.0) THEN
SELECT CASE (t)
CASE (1)
ALLOCATE(t_forcetheo::forcetheo)
CASE(2)
ALLOCATE(t_forcetheo_mae::forcetheo)
END SELECT
END IF
!now we have the correct type, now we have to distribute the data
SELECT TYPE(forcetheo)
TYPE IS (t_forcetheo_mae)
CALL forcetheo%dist(mpi)
END SELECT
#endif
END SUBROUTINE mpi_dist_forcetheorem
END MODULE m_mpi_dist_forcetheorem
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment