1! -*- f90 -*-
2!
3! Copyright (c) 2009-2012 Cisco Systems, Inc.  All rights reserved.
4! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5!                         All rights reserved.
6! Copyright (c) 2018      Research Organization for Information Science
7!                         and Technology (RIST).  All rights reserved.
8! $COPYRIGHT$
9
10subroutine MPI_Type_create_struct_f08(count,array_of_blocklengths,array_of_displacements, &
11                                      array_of_types,newtype,ierror)
12   use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
13   use :: ompi_mpifh_bindings, only : ompi_type_create_struct_f
14   implicit none
15   INTEGER, INTENT(IN) :: count
16   INTEGER, INTENT(IN) :: array_of_blocklengths(count)
17   INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: array_of_displacements(count)
18   TYPE(MPI_Datatype), INTENT(IN) :: array_of_types(count)
19   TYPE(MPI_Datatype), INTENT(OUT) :: newtype
20   INTEGER, OPTIONAL, INTENT(OUT) :: ierror
21   integer :: c_ierror
22
23   call ompi_type_create_struct_f(count,array_of_blocklengths,array_of_displacements, &
24                                  array_of_types(:)%MPI_VAL,newtype%MPI_VAL,c_ierror)
25   if (present(ierror)) ierror = c_ierror
26
27end subroutine MPI_Type_create_struct_f08
28