17 use mo_kind,
only : i4, dp
18 use mo_message,
only : message
19 use mo_string_utils,
only : num2str
29 PUBLIC :: distribute_parameterset, get_parameterset
39 subroutine distribute_parameterset(parameterset)
41 real(dp),
dimension(:),
intent(in) :: parameterset
43 integer(i4) :: nproc, iproc, dimen
46 call mpi_comm_size(
domainmeta%comMaster, nproc, ierror)
47 dimen =
size(parameterset(:))
49 call mpi_send(dimen, 1, &
50 mpi_integer,iproc,0,
domainmeta%comMaster,ierror)
51 call mpi_send(parameterset(:),dimen, &
52 mpi_double_precision,iproc,0,
domainmeta%comMaster,ierror)
54 end subroutine distribute_parameterset
57 subroutine get_parameterset(parameterset)
60 real(dp),
dimension(:),
allocatable,
intent(inout) :: parameterset
64 type(MPI_Status) :: status
66 call mpi_recv(dimen, 1, mpi_integer, 0, 0,
domainmeta%comMaster, status, ierror)
67 allocate(parameterset(dimen))
68 call mpi_recv(parameterset, dimen, mpi_double_precision, 0, 0,
domainmeta%comMaster, status, ierror)
69 end subroutine get_parameterset
79 integer(i4) :: nproc, rank
83 call mpi_comm_dup(mpi_comm_world, comm, ierror)
85 call mpi_comm_size(comm, nproc, ierror)
87 call mpi_comm_rank(comm, rank, ierror)
88 call message(
'MPI!, comm ', num2str(rank), num2str(nproc))
100 integer(i4) :: nproc, rank
103 call mpi_comm_size(comm, nproc, ierror)
104 call mpi_comm_rank(comm, rank, ierror)
105 call message(
'MPI finished ', num2str(rank), num2str(nproc))
106 call mpi_finalize(ierror)
Provides structures needed by mHM, mRM and/or mpr.
type(domain_meta), public domainmeta