1
1

Added logical and rank 0 (elemental) types. Also removed output of methods with @kind='No_F90' (2 choice args, for example).

This commit was SVN r4009.
Этот коммит содержится в:
Craig E Rasmussen 2005-01-14 23:03:36 +00:00
родитель ae9dcc2ab7
Коммит f1634ae698
2 изменённых файлов: 611 добавлений и 10 удалений

Просмотреть файл

@ -81,6 +81,7 @@
<xsl:param name="module" select="@name"/>
<xsl:value-of select="$nl"/>
<xsl:for-each select="method">
<xsl:if test="@kind != 'No_F90'">
<xsl:if test="@template = 'yes'">
<xsl:value-of select="$nl"/>
@ -99,6 +100,7 @@
<xsl:value-of select="$nl"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
@ -118,6 +120,8 @@
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="''"/>
<xsl:with-param name="void_type" select="''"/>
<xsl:with-param name="void_kind" select="''"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
@ -139,6 +143,154 @@ echo
-->
<xsl:template name="defineArrayFunctionBody">
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $lkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DL${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'logical'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $ikinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DI${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'integer'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $rkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DR${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'real'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $ckinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DC${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'complex'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>
for rank in $ranks
do
@ -150,6 +302,40 @@ do
case "$rank" in 6) dim=':,:,:,:,:,:' ; esac
case "$rank" in 7) dim=':,:,:,:,:,:,:' ; esac
</xsl:text>
<xsl:text> for kind in $lkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DL${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'logical'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $ikinds</xsl:text>
@ -165,6 +351,76 @@ do
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'integer'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $rkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DR${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'real'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$nl"/>
<xsl:text> echo " call ${procedure}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $ckinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DC${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'complex'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
@ -219,9 +475,15 @@ echo
-->
<xsl:template name="decl-construct-list">
<xsl:param name="ws" select="' '"/>
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:for-each select="arg">
<xsl:call-template name="type-decl-stmt">
<xsl:with-param name="ws" select="$ws"/>
<xsl:with-param name="void_type" select="$void_type"/>
<xsl:with-param name="void_kind" select="$void_kind"/>
<xsl:with-param name="has_dim" select="$has_dim"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
@ -232,11 +494,18 @@ echo
-->
<xsl:template name="type-decl-stmt">
<xsl:param name="ws" select="' '"/>
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:value-of select="$ws"/>
<xsl:text>echo " </xsl:text>
<xsl:for-each select="type[1]">
<xsl:call-template name="decl-type-spec"/>
<xsl:call-template name="decl-type-spec">
<xsl:with-param name="void_type" select="$void_type"/>
<xsl:with-param name="void_kind" select="$void_kind"/>
<xsl:with-param name="has_dim" select="$has_dim"/>
</xsl:call-template>
</xsl:for-each>
<xsl:if test="type/@kind != 'void'">
@ -251,14 +520,22 @@ echo
- decl-type-spec <arg>
-->
<xsl:template name="decl-type-spec">
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:choose>
<!-- C++ types -->
<xsl:when test="@kind = 'void'">
<xsl:text>integer(kind=MPI_INTEGER${kind}_KIND)</xsl:text>
<xsl:text>, dimension(${dim})</xsl:text>
<xsl:value-of select="$void_type"/>
<xsl:text>(kind=MPI_</xsl:text>
<xsl:value-of select="$void_kind"/>
<xsl:text>${kind}_KIND)</xsl:text>
<xsl:if test="$has_dim">
<xsl:text>, dimension(${dim})</xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="@kind = 'bool'">
<xsl:text>integer</xsl:text>

Просмотреть файл

@ -82,6 +82,8 @@
<xsl:value-of select="$nl"/>
<xsl:for-each select="method">
<xsl:if test="@kind != 'No_F90'">
<xsl:value-of select="$nl"/>
<xsl:text>procedure='</xsl:text>
<xsl:value-of select="@name"/>
@ -111,6 +113,7 @@
<xsl:value-of select="$nl"/>
<xsl:value-of select="$nl"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
@ -130,6 +133,8 @@
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="''"/>
<xsl:with-param name="void_type" select="''"/>
<xsl:with-param name="void_kind" select="''"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
@ -151,6 +156,138 @@ echo
-->
<xsl:template name="defineArrayFunctionBody">
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $lkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DL${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'logical'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $ikinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DI${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'integer'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $rkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DR${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'real'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>rank=0</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>for kind in $ckinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text>do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DC${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'complex'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
<xsl:with-param name="has_dim" select="0"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text>
for rank in $ranks
do
@ -162,6 +299,36 @@ do
case "$rank" in 6) dim=':,:,:,:,:,:' ; esac
case "$rank" in 7) dim=':,:,:,:,:,:,:' ; esac
</xsl:text>
<xsl:text> for kind in $lkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DL${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'logical'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $ikinds</xsl:text>
@ -177,6 +344,68 @@ do
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'integer'"/>
<xsl:with-param name="void_kind" select="'INTEGER'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $rkinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DR${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'real'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
<xsl:if test="@name = 'ierr'">
<xsl:text> echo " integer, intent(out) :: ierr"</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>
echo "end subroutine ${proc}"
echo
done
</xsl:text>
<xsl:text> for kind in $ckinds</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> do</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> proc="${procedure}${rank}DC${kind}"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo "subroutine ${proc}(</xsl:text>
<xsl:call-template name="arg-list"/> <xsl:text>)"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:text> echo " use mpi_kinds"</xsl:text>
<xsl:value-of select="$nl"/>
<xsl:call-template name="decl-construct-list">
<xsl:with-param name="ws" select="' '"/>
<xsl:with-param name="void_type" select="'complex'"/>
<xsl:with-param name="void_kind" select="'REAL'"/>
</xsl:call-template>
<xsl:for-each select="return[1]">
@ -227,9 +456,15 @@ echo
-->
<xsl:template name="decl-construct-list">
<xsl:param name="ws" select="' '"/>
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:for-each select="arg">
<xsl:call-template name="type-decl-stmt">
<xsl:with-param name="ws" select="$ws"/>
<xsl:with-param name="void_type" select="$void_type"/>
<xsl:with-param name="void_kind" select="$void_kind"/>
<xsl:with-param name="has_dim" select="$has_dim"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
@ -240,35 +475,124 @@ echo
-->
<xsl:template name="type-decl-stmt">
<xsl:param name="ws" select="' '"/>
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:value-of select="$ws"/>
<xsl:text>echo " </xsl:text>
<xsl:for-each select="type[1]">
<xsl:call-template name="decl-type-spec"/>
<xsl:call-template name="decl-type-spec">
<xsl:with-param name="void_type" select="$void_type"/>
<xsl:with-param name="void_kind" select="$void_kind"/>
<xsl:with-param name="has_dim" select="$has_dim"/>
</xsl:call-template>
</xsl:for-each>
<xsl:for-each select="type[1]">
<xsl:call-template name="decl-type-intent"/>
</xsl:for-each>
<xsl:if test="type/@kind != 'void'">
<xsl:value-of select="concat(', intent(', @intent, ')')"/>
</xsl:if>
<xsl:value-of select="concat(' :: ', @name, '&quot;', $nl)"/>
</xsl:template>
<!--
- decl-type-intent <type>
-->
<xsl:template name="decl-type-intent">
<xsl:choose>
<!-- C++ types -->
<xsl:when test="@kind = 'void'"/>
<xsl:when test="@kind = 'ptr'">
<xsl:choose>
<xsl:when
test="indirect/type/@usertype='MPI_Comm_errhandler_fn'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Comm_copy_attr_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Comm_delete_attr_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Handler_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_File_errhandler_fn'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Grequest_query_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Grequest_free_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Grequest_cancel_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Copy_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Delete_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_User_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Datarep_conversion_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Datarep_extent_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Type_copy_attr_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Type_delete_attr_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Win_errhandler_fn'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Win_copy_attr_function'"/>
<xsl:when
test="indirect/type/@usertype='MPI_Win_delete_attr_function'"/>
<xsl:otherwise>
<xsl:value-of select="concat(', intent(', ../@intent, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(', intent(', ../@intent, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
- decl-type-spec <type>
-->
<xsl:template name="decl-type-spec">
<xsl:param name="void_type"/>
<xsl:param name="void_kind"/>
<xsl:param name="has_dim" select="1"/>
<xsl:choose>
<!-- idl types (annotate xml to specify what this type is) -->
<xsl:when test="@idl = 'MPI_ARGV'">
<xsl:text>character(len=*), dimension(*)</xsl:text>
</xsl:when>
<xsl:when test="@idl = 'MPI_A_ARGV'">
<xsl:text>character(len=*), dimension(</xsl:text>
<xsl:value-of select="array/dimension[2]/@extent"/>
<xsl:text>,*)</xsl:text>
</xsl:when>
<xsl:when test="@idl = 'MPI_Aint'">
<xsl:text>integer(kind=MPI_ADDRESS_KIND)</xsl:text>
</xsl:when>
<!-- C++ types -->
<xsl:when test="@kind = 'void'">
<xsl:choose>
<xsl:when test="../../../../@template = 'yes'">
<xsl:text>integer(kind=MPI_INTEGER${kind}_KIND)</xsl:text>
<xsl:text>, dimension(${dim})</xsl:text>
<xsl:value-of select="$void_type"/>
<xsl:text>(kind=MPI_</xsl:text>
<xsl:value-of select="$void_kind"/>
<xsl:text>${kind}_KIND)</xsl:text>
<xsl:if test="$has_dim">
<xsl:text>, dimension(${dim})</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>integer</xsl:text>