Commit 6ede3251 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add array declarations to F77 documentation.

parent 2ca9847d
......@@ -97,7 +97,7 @@ Define the UUID of an unstructured grid.
\section*{\tt \htmlref{gridDefXbounds}{gridDefXbounds}}
\begin{verbatim}
SUBROUTINE gridDefXbounds (INTEGER gridID, DOUBLEPRECISION xbounds)
SUBROUTINE gridDefXbounds (INTEGER gridID, DOUBLEPRECISION xbounds(*))
\end{verbatim}
Define the bounds of a X-axis.
......@@ -142,7 +142,7 @@ Define the units of a X-axis.
\section*{\tt \htmlref{gridDefXvals}{gridDefXvals}}
\begin{verbatim}
SUBROUTINE gridDefXvals (INTEGER gridID, DOUBLEPRECISION xvals)
SUBROUTINE gridDefXvals (INTEGER gridID, DOUBLEPRECISION xvals(*))
\end{verbatim}
Define the values of a X-axis.
......@@ -151,7 +151,7 @@ Define the values of a X-axis.
\section*{\tt \htmlref{gridDefYbounds}{gridDefYbounds}}
\begin{verbatim}
SUBROUTINE gridDefYbounds (INTEGER gridID, DOUBLEPRECISION ybounds)
SUBROUTINE gridDefYbounds (INTEGER gridID, DOUBLEPRECISION ybounds(*))
\end{verbatim}
Define the bounds of a Y-axis.
......@@ -196,7 +196,7 @@ Define the units of a Y-axis.
\section*{\tt \htmlref{gridDefYvals}{gridDefYvals}}
\begin{verbatim}
SUBROUTINE gridDefYvals (INTEGER gridID, DOUBLEPRECISION yvals)
SUBROUTINE gridDefYvals (INTEGER gridID, DOUBLEPRECISION yvals(*))
\end{verbatim}
Define the values of a Y-axis.
......@@ -304,7 +304,7 @@ Get the UUID of an unstructured grid.
\section*{\tt \htmlref{gridInqXbounds}{gridInqXbounds}}
\begin{verbatim}
INTEGER FUNCTION gridInqXbounds (INTEGER gridID, DOUBLEPRECISION xbounds)
INTEGER FUNCTION gridInqXbounds (INTEGER gridID, DOUBLEPRECISION xbounds(*))
\end{verbatim}
Get the bounds of a X-axis.
......@@ -367,7 +367,7 @@ Get one value of a X-axis.
\section*{\tt \htmlref{gridInqXvals}{gridInqXvals}}
\begin{verbatim}
INTEGER FUNCTION gridInqXvals (INTEGER gridID, DOUBLEPRECISION xvals)
INTEGER FUNCTION gridInqXvals (INTEGER gridID, DOUBLEPRECISION xvals(*))
\end{verbatim}
Get all values of a X-axis.
......@@ -376,7 +376,7 @@ Get all values of a X-axis.
\section*{\tt \htmlref{gridInqYbounds}{gridInqYbounds}}
\begin{verbatim}
INTEGER FUNCTION gridInqYbounds (INTEGER gridID, DOUBLEPRECISION ybounds)
INTEGER FUNCTION gridInqYbounds (INTEGER gridID, DOUBLEPRECISION ybounds(*))
\end{verbatim}
Get the bounds of a Y-axis.
......@@ -439,7 +439,7 @@ Get one value of a Y-axis.
\section*{\tt \htmlref{gridInqYvals}{gridInqYvals}}
\begin{verbatim}
INTEGER FUNCTION gridInqYvals (INTEGER gridID, DOUBLEPRECISION yvals)
INTEGER FUNCTION gridInqYvals (INTEGER gridID, DOUBLEPRECISION yvals(*))
\end{verbatim}
Get all values of a Y-axis.
......@@ -574,8 +574,8 @@ Create a new dataset.
\section*{\tt \htmlref{streamReadVar}{streamReadVar}}
\begin{verbatim}
SUBROUTINE streamReadVar (INTEGER streamID, INTEGER varID, DOUBLEPRECISION data,
INTEGER nmiss)
SUBROUTINE streamReadVar (INTEGER streamID, INTEGER varID,
DOUBLEPRECISION data(*), INTEGER nmiss)
\end{verbatim}
Read a variable.
......@@ -585,7 +585,7 @@ Read a variable.
\begin{verbatim}
SUBROUTINE streamReadVarSlice (INTEGER streamID, INTEGER varID, INTEGER levelID,
DOUBLEPRECISION data, INTEGER nmiss)
DOUBLEPRECISION data(*), INTEGER nmiss)
\end{verbatim}
Read a horizontal slice of a variable.
......@@ -603,8 +603,8 @@ Synchronize an Open Dataset to Disk.
\section*{\tt \htmlref{streamWriteVar}{streamWriteVar}}
\begin{verbatim}
SUBROUTINE streamWriteVar (INTEGER streamID, INTEGER varID, DOUBLEPRECISION data,
INTEGER nmiss)
SUBROUTINE streamWriteVar (INTEGER streamID, INTEGER varID,
DOUBLEPRECISION data(*), INTEGER nmiss)
\end{verbatim}
Write a variable.
......@@ -614,7 +614,7 @@ Write a variable.
\begin{verbatim}
SUBROUTINE streamWriteVarSlice (INTEGER streamID, INTEGER varID, INTEGER levelID,
DOUBLEPRECISION data, INTEGER nmiss)
DOUBLEPRECISION data(*), INTEGER nmiss)
\end{verbatim}
Write a horizontal slice of a variable.
......@@ -887,7 +887,7 @@ Create a variable list.
\begin{verbatim}
INTEGER FUNCTION vlistDefAttFlt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER type, INTEGER len,
DOUBLEPRECISION dp)
DOUBLEPRECISION dp(*))
\end{verbatim}
Define a floating point attribute.
......@@ -898,7 +898,7 @@ Define a floating point attribute.
\begin{verbatim}
INTEGER FUNCTION vlistDefAttInt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER type, INTEGER len,
INTEGER ip)
INTEGER ip(*))
\end{verbatim}
Define an integer attribute.
......@@ -1092,7 +1092,7 @@ Get information about an attribute.
\begin{verbatim}
INTEGER FUNCTION vlistInqAttFlt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen,
DOUBLEPRECISION dp)
DOUBLEPRECISION dp(*))
\end{verbatim}
Get the value(s) of a floating point attribute.
......@@ -1102,7 +1102,7 @@ Get the value(s) of a floating point attribute.
\begin{verbatim}
INTEGER FUNCTION vlistInqAttInt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen, INTEGER ip)
CHARACTER*(*) name, INTEGER mlen, INTEGER ip(*))
\end{verbatim}
Get the value(s) of an integer attribute.
......@@ -1325,7 +1325,7 @@ Define one level of a Z-axis.
\section*{\tt \htmlref{zaxisDefLevels}{zaxisDefLevels}}
\begin{verbatim}
SUBROUTINE zaxisDefLevels (INTEGER zaxisID, DOUBLEPRECISION levels)
SUBROUTINE zaxisDefLevels (INTEGER zaxisID, DOUBLEPRECISION levels(*))
\end{verbatim}
Define the levels of a Z-axis.
......@@ -1415,7 +1415,7 @@ Get one level of a Z-axis.
\section*{\tt \htmlref{zaxisInqLevels}{zaxisInqLevels}}
\begin{verbatim}
SUBROUTINE zaxisInqLevels (INTEGER zaxisID, DOUBLEPRECISION levels)
SUBROUTINE zaxisInqLevels (INTEGER zaxisID, DOUBLEPRECISION levels(*))
\end{verbatim}
Get all levels of a Z-axis.
......
......@@ -93,6 +93,9 @@ enum cftype {ISVOID, ISCONSTSTRING, ISINT, ISREAL, ISDOUBLE, ISMPI_COMM,
VOIDFUNCVOID,
NUM_KNOWN_ARG_TYPES};
static inline int
isArrayArgType(int argType);
enum conversionType { CONV_ARG, CONV_RET };
......@@ -526,12 +529,7 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
else
fprintf(fpinc, ",\n!%36s ", "");
int argType = funcargtype[i];
int isArray = argType == ISFLOATV
|| argType == ISFLOATVV
|| argType == ISDOUBLEV
|| argType == ISDOUBLEVV
|| argType == ISINTV
|| argType == ISINTVV;
int isArray = isArrayArgType(argType);
fprintf(fpinc, "%-16s%.*s%s", funArgSym[argType].f77name,
(int)(funcargname[i].rm_eo - funcargname[i].rm_so),
line + funcargname[i].rm_so,
......@@ -724,12 +722,15 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
char farg[128];
/* FIXME: optional empty argument name unhandled */
int argType = funcargtype[i];
int isArray = isArrayArgType(argType);
int nchn
= snprintf(farg, sizeof (farg), "%s %.*s",
funArgSym[funcargtype[i]].f77name,
= snprintf(farg, sizeof (farg), "%s %.*s%s",
funArgSym[argType].f77name,
(int)(funcargname[i].rm_eo
- funcargname[i].rm_so),
line + funcargname[i].rm_so);
line + funcargname[i].rm_so,
isArray ? "(*)" : "");
if (nchn < 0)
abort();
if ( (xlineLen + (size_t)nchn) > 80 )
......@@ -1184,6 +1185,16 @@ static int detectComment(char **line_, ssize_t *lineLen, size_t *lineBufSize,
return matchType;
}
static inline int
isArrayArgType(int argType)
{
return argType == ISFLOATV
|| argType == ISFLOATVV
|| argType == ISDOUBLEV
|| argType == ISDOUBLEVV
|| argType == ISINTV
|| argType == ISINTVV;
}
/*
......
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