Skip to content

Commit

Permalink
Use non-breaking space in "FORTRAN 77"
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Apr 30, 2020
1 parent 097846b commit dada5db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions chapters/functions.tex
Expand Up @@ -1692,9 +1692,9 @@ \section{External Function Interface}\doublelabel{external-function-interface}
\begin{itemize}
\item
Support for external functions written in C (specifically C89) and
FORTRAN 77. Other languages, e.g. C++ and Fortran 90, may be supported
FORTRAN~77. Other languages, e.g. C++ and Fortran 90, may be supported
in the future, and provided the function is link-compatible with C89
or FORTRAN 77 it can be written in any language.
or FORTRAN~77 it can be written in any language.
\item
Mapping of argument types from Modelica to the target language and
back.
Expand Down Expand Up @@ -1842,9 +1842,9 @@ \subsubsection{Simple Types}\doublelabel{simple-types}
\lstinline!String! & \lstinline!Special! & \lstinline!Not Available!\\ \hline
\end{longtable}

Sending string literals to FORTRAN 77 subroutines/functions is supported
Sending string literals to FORTRAN~77 subroutines/functions is supported
for Lapack/Blas-routines, and the strings are NUL-terminated for
compatibility with C. Returning strings from FORTRAN 77
compatibility with C. Returning strings from FORTRAN~77
subroutines/functions is currently not supported.

Enumeration types used as arguments are mapped to type int when calling
Expand All @@ -1869,7 +1869,7 @@ \subsubsection{Arrays}\doublelabel{arrays-1}
\end{nonnormative}

Arrays are by default stored in row-major order when calling C functions
and in column-major order when calling FORTRAN 77 functions. These
and in column-major order when calling FORTRAN~77 functions. These
defaults can be overridden by the array layout annotation. See the
example below.

Expand Down Expand Up @@ -1936,15 +1936,15 @@ \subsubsection{Arrays}\doublelabel{arrays-1}
double foo(double *, size_t, size_t, size_t);
\end{lstlisting}

If the external function is written in FORTRAN 77, i.e.:
If the external function is written in FORTRAN~77, i.e.:
\begin{lstlisting}[language=modelica]
function foo
input Real a[:,:,:];
output Real x;
external "FORTRAN 77";
end foo;
\end{lstlisting}
the default assumptions correspond to a FORTRAN 77 function
the default assumptions correspond to a FORTRAN~77 function
defined as follows:
\begin{lstlisting}[language=fortran77]
FUNCTION foo(a, d1, d2, d3)
Expand All @@ -1963,7 +1963,7 @@ \subsubsection{Arrays}\doublelabel{arrays-1}

\begin{example}
This example shows how arrays can be passed explicitly to an
external FORTRAN 77 function when the default assumptions are
external FORTRAN~77 function when the default assumptions are
unsuitable.

\begin{lstlisting}[language=modelica]
Expand All @@ -1976,7 +1976,7 @@ \subsubsection{Arrays}\doublelabel{arrays-1}
external "FORTRAN 77" myfoo(x, y, size(x,1), size(y,2), u1, i, u2);
end foo;
\end{lstlisting}
The corresponding FORTRAN 77 subroutine would be declared as follows:
The corresponding FORTRAN~77 subroutine would be declared as follows:
\begin{lstlisting}[language=fortran77]
SUBROUTINE myfoo(x, y, n, m, u1, i, u2)
DOUBLE PRECISION(n) x
Expand Down Expand Up @@ -2063,7 +2063,7 @@ \subsection{Return Type Mapping}\doublelabel{return-type-mapping}
Return types are by default mapped as follows for C and FORTRAN~77:
\begin{longtable}[]{|l|l|l|}
\hline
\emph{Modelica} & \emph{C} & \emph{FORTRAN 77}\\ \hline
\tablehead{Modelica} & \tablehead{C} & \tablehead{FORTRAN~77}\\ \hline
\endhead
\lstinline!Real! & \lstinline!double! & \lstinline!DOUBLE PRECISION!\\ \hline
\lstinline!Integer! & \lstinline!int! & \lstinline!INTEGER!\\ \hline
Expand Down Expand Up @@ -2139,9 +2139,9 @@ \subsection{Aliasing}\doublelabel{aliasing}
\end{lstlisting}

Note that we discuss input arguments for Fortran-routines even
though FORTRAN 77 does not formally have input arguments and forbid
though FORTRAN~77 does not formally have input arguments and forbid
aliasing between any pair of arguments to a function (Section 15.9.3.6
of X3J3/90.4). For the few (if any) FORTRAN 77 compilers that strictly
of X3J3/90.4). For the few (if any) FORTRAN~77 compilers that strictly
follow the standard and are unable to handle aliasing between input
variables the tool must transform the first call of \lstinline!foo! into:
\begin{lstlisting}[language=C]
Expand Down
4 changes: 2 additions & 2 deletions chapters/revisions.tex
Expand Up @@ -329,7 +329,7 @@ \subsection{Main changes in Modelica 3.4}\doublelabel{main-changes-in-modelica-3
\autoref{simple-types}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1846}{\#1846}.
\item
Added that Strings can be sent to FORTRAN 77, \autoref{simple-types}. Ticket
Added that Strings can be sent to FORTRAN~77, \autoref{simple-types}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1971}{\#1971}.
\item
Allow multiple include directories, \autoref{annotations-for-external-libraries-and-include-files}. Ticket
Expand Down Expand Up @@ -608,7 +608,7 @@ \subsection{Main changes in Modelica 3.3 Revision 1}\doublelabel{main-changes-in
\autoref{external-function-interface}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/351}{\#351}.
\item
Corrected spelling to FORTRAN 77, \autoref{aliasing}. Ticket
Corrected spelling to FORTRAN~77, \autoref{aliasing}. Ticket
\href{https://github.com/modelica/ModelicaSpecification/issues/1278}{\#1278}.
\item
Clarified default directories, \autoref{annotations-for-external-libraries-and-include-files}. Ticket
Expand Down

0 comments on commit dada5db

Please sign in to comment.