Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
b1034dce
Commit
b1034dce
authored
Apr 23, 2013
by
Uwe Schulzweida
Browse files
vlistXXXAttTxt: use cdi fortran datatype CBUF (char *) for the last argument (bug fix)
parent
45b39eb7
Changes
12
Hide whitespace changes
Inline
Side-by-side
.gitattributes
View file @
b1034dce
...
...
@@ -180,6 +180,7 @@ src/cdf_int.h -text
src/cdi.h -text
src/cdi.inc -text
src/cdiFortran.c -text
src/cdiFortran.h -text
src/cdi_error.c -text
src/cdi_limits.h -text
src/cdi_util.c -text
...
...
ChangeLog
View file @
b1034dce
2013-04-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistXXXAttTxt: use cdi fortran datatype CBUF (char *) for the last argument (bug fix) [report: Luis Kornblueh]
2013-04-19 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_gribapi: replaced function getLevelFactor() [Bug #3446]
...
...
configure
View file @
b1034dce
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdi 1.6.
0
.
# Generated by GNU Autoconf 2.68 for cdi 1.6.
1rc1
.
#
# Report bugs to <http://code.zmaw.de/projects/cdi>.
#
...
...
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cdi'
PACKAGE_TARNAME='cdi'
PACKAGE_VERSION='1.6.
0
'
PACKAGE_STRING='cdi 1.6.
0
'
PACKAGE_VERSION='1.6.
1rc1
'
PACKAGE_STRING='cdi 1.6.
1rc1
'
PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdi'
PACKAGE_URL=''
...
...
@@ -1403,7 +1403,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures cdi 1.6.
0
to adapt to many kinds of systems.
\`configure' configures cdi 1.6.
1rc1
to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
...
...
@@ -1473,7 +1473,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdi 1.6.
0
:";;
short | recursive ) echo "Configuration of cdi 1.6.
1rc1
:";;
esac
cat <<\_ACEOF
...
...
@@ -1630,7 +1630,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdi configure 1.6.
0
cdi configure 1.6.
1rc1
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
...
...
@@ -2391,7 +2391,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cdi $as_me 1.6.
0
, which was
It was created by cdi $as_me 1.6.
1rc1
, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
...
...
@@ -3323,7 +3323,7 @@ fi
# Define the identity of the package.
PACKAGE='cdi'
VERSION='1.6.
0
'
VERSION='1.6.
1rc1
'
cat >>confdefs.h <<_ACEOF
...
...
@@ -27424,7 +27424,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdi $as_me 1.6.
0
, which was
This file was extended by cdi $as_me 1.6.
1rc1
, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
...
...
@@ -27490,7 +27490,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
cdi config.status 1.6.
0
cdi config.status 1.6.
1rc1
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
...
...
configure.ac
View file @
b1034dce
# Process this file with autoconf to produce a configure script.
AC_INIT([cdi], [1.6.
0
], [http://code.zmaw.de/projects/cdi])
AC_INIT([cdi], [1.6.
1rc1
], [http://code.zmaw.de/projects/cdi])
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
...
...
doc/tex/c_quick_ref.tex
View file @
b1034dce
...
...
@@ -696,7 +696,7 @@ Define an integer attribute.
\begin{verbatim}
int vlistDefAttTxt (int vlistID, int varID, const char *name, int len,
const char *tp);
const char *tp
_
cbuf
);
\end{verbatim}
Define a text attribute.
...
...
@@ -747,6 +747,15 @@ Define the data type of a Variable.
Set an arbitrary keyword/double value pair for GRIB API.
\section*
{
\tt
\htmlref
{
vlistDefVarExtra
}{
vlistDefVarExtra
}}
\begin{verbatim}
void vlistDefVarExtra (int vlistID, int varID, const char *extra);
\end{verbatim}
Define extra information of a Variable.
\section*
{
\tt
\htmlref
{
vlistDefVarIntKey
}{
vlistDefVarIntKey
}}
\begin{verbatim}
...
...
@@ -861,7 +870,8 @@ Get the value(s) of an integer attribute.
\section*
{
\tt
\htmlref
{
vlistInqAttTxt
}{
vlistInqAttTxt
}}
\begin{verbatim}
int vlistInqAttTxt (int vlistID, int varID, const char *name, int mlen, char *tp);
int vlistInqAttTxt (int vlistID, int varID, const char *name, int mlen,
char *tp
_
cbuf);
\end{verbatim}
Get the value(s) of a text attribute.
...
...
@@ -912,6 +922,15 @@ Get the data type of a Variable.
raw access to GRIB meta-data.
\section*
{
\tt
\htmlref
{
vlistInqVarExtra
}{
vlistInqVarExtra
}}
\begin{verbatim}
void vlistInqVarExtra (int vlistID, int varID, char *extra);
\end{verbatim}
Get extra information of a Variable.
\section*
{
\tt
\htmlref
{
vlistInqVarIntKey
}{
vlistInqVarIntKey
}}
\begin{verbatim}
...
...
doc/tex/f_quick_ref.tex
View file @
b1034dce
...
...
@@ -701,7 +701,7 @@ Define an integer attribute.
\begin{verbatim}
INTEGER FUNCTION vlistDefAttTxt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER len,
CHARACTER*(*) tp)
CHARACTER*(*) tp
_
cbuf
)
\end{verbatim}
Define a text attribute.
...
...
@@ -754,6 +754,15 @@ Define the data type of a Variable.
Set an arbitrary keyword/double value pair for GRIB API.
\section*
{
\tt
\htmlref
{
vlistDefVarExtra
}{
vlistDefVarExtra
}}
\begin{verbatim}
SUBROUTINE vlistDefVarExtra (INTEGER vlistID, INTEGER varID, CHARACTER*(*) extra)
\end{verbatim}
Define extra information of a Variable.
\section*
{
\tt
\htmlref
{
vlistDefVarIntKey
}{
vlistDefVarIntKey
}}
\begin{verbatim}
...
...
@@ -876,7 +885,7 @@ Get the value(s) of an integer attribute.
\begin{verbatim}
INTEGER FUNCTION vlistInqAttTxt (INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen,
CHARACTER*(*) tp)
CHARACTER*(*) tp
_
cbuf
)
\end{verbatim}
Get the value(s) of a text attribute.
...
...
@@ -927,6 +936,15 @@ Get the data type of a Variable.
raw access to GRIB meta-data.
\section*
{
\tt
\htmlref
{
vlistInqVarExtra
}{
vlistInqVarExtra
}}
\begin{verbatim}
SUBROUTINE vlistInqVarExtra (INTEGER vlistID, INTEGER varID, CHARACTER*(*) extra)
\end{verbatim}
Get extra information of a Variable.
\section*
{
\tt
\htmlref
{
vlistInqVarIntKey
}{
vlistInqVarIntKey
}}
\begin{verbatim}
...
...
src/cdi.h
View file @
b1034dce
...
...
@@ -570,14 +570,14 @@ int vlistDefAttInt(int vlistID, int varID, const char *name, int type, int l
/* vlistDefAttFlt: Define a floating point attribute */
int
vlistDefAttFlt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
type
,
int
len
,
const
double
*
dp_vec
);
/* vlistDefAttTxt: Define a text attribute */
int
vlistDefAttTxt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
len
,
const
char
*
tp
);
int
vlistDefAttTxt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
len
,
const
char
*
tp
_cbuf
);
/* vlistInqAttInt: Get the value(s) of an integer attribute */
int
vlistInqAttInt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
mlen
,
int
*
ip_vec
);
/* vlistInqAttFlt: Get the value(s) of a floating point attribute */
int
vlistInqAttFlt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
mlen
,
double
*
dp_vec
);
/* vlistInqAttTxt: Get the value(s) of a text attribute */
int
vlistInqAttTxt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
mlen
,
char
*
tp
);
int
vlistInqAttTxt
(
int
vlistID
,
int
varID
,
const
char
*
name
,
int
mlen
,
char
*
tp
_cbuf
);
/* GRID routines */
...
...
src/cdi.inc
View file @
b1034dce
!
This
file
was
automatically
generated
,
don
'
t
edit
!
!
!
Fortran
interface
for
CDI
library
version
1.6.
0
!
Fortran
interface
for
CDI
library
version
1.6.
1
rc1
!
!
Author
:
!
-------
...
...
@@ -1067,6 +1067,18 @@
!
INTEGER
varID
)
EXTERNAL
vlistInqVarMissval
!
vlistDefVarExtra
!
(
INTEGER
vlistID
,
!
INTEGER
varID
,
!
CHARACTER
*
(
*
)
extra
)
EXTERNAL
vlistDefVarExtra
!
vlistInqVarExtra
!
(
INTEGER
vlistID
,
!
INTEGER
varID
,
!
CHARACTER
*
(
*
)
extra
)
EXTERNAL
vlistInqVarExtra
!
vlistDefVarScalefactor
!
(
INTEGER
vlistID
,
!
INTEGER
varID
,
...
...
@@ -1281,7 +1293,7 @@
!
INTEGER
varID
,
!
CHARACTER
*
(
*
)
name
,
!
INTEGER
len
,
!
CHARACTER
*
(
*
)
tp
)
!
CHARACTER
*
(
*
)
tp
_cbuf
)
EXTERNAL
vlistDefAttTxt
INTEGER
vlistInqAttInt
...
...
@@ -1305,7 +1317,7 @@
!
INTEGER
varID
,
!
CHARACTER
*
(
*
)
name
,
!
INTEGER
mlen
,
!
CHARACTER
*
(
*
)
tp
)
!
CHARACTER
*
(
*
)
tp
_cbuf
)
EXTERNAL
vlistInqAttTxt
!
...
...
src/cdiFortran.c
View file @
b1034dce
...
...
@@ -14,6 +14,10 @@
# include "cfortran.h"
#endif
#if ! defined (_CDIFORTRAN_H)
# include "cdifortran.h"
#endif
/* Byte order */
...
...
@@ -225,6 +229,8 @@ FCALLSCSUB3 (vlistDefVarUnits, VLISTDEFVARUNITS, vlistdefvarunits, INT, INT, STR
FCALLSCSUB3
(
vlistInqVarUnits
,
VLISTINQVARUNITS
,
vlistinqvarunits
,
INT
,
INT
,
PSTRING
)
FCALLSCSUB3
(
vlistDefVarMissval
,
VLISTDEFVARMISSVAL
,
vlistdefvarmissval
,
INT
,
INT
,
DOUBLE
)
FCALLSCFUN2
(
DOUBLE
,
vlistInqVarMissval
,
VLISTINQVARMISSVAL
,
vlistinqvarmissval
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarExtra
,
VLISTDEFVAREXTRA
,
vlistdefvarextra
,
INT
,
INT
,
STRING
)
FCALLSCSUB3
(
vlistInqVarExtra
,
VLISTINQVAREXTRA
,
vlistinqvarextra
,
INT
,
INT
,
PSTRING
)
FCALLSCSUB3
(
vlistDefVarScalefactor
,
VLISTDEFVARSCALEFACTOR
,
vlistdefvarscalefactor
,
INT
,
INT
,
DOUBLE
)
FCALLSCFUN2
(
DOUBLE
,
vlistInqVarScalefactor
,
VLISTINQVARSCALEFACTOR
,
vlistinqvarscalefactor
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarAddoffset
,
VLISTDEFVARADDOFFSET
,
vlistdefvaraddoffset
,
INT
,
INT
,
DOUBLE
)
...
...
@@ -279,10 +285,10 @@ FCALLSCFUN6 (INT, vlistInqAtt, VLISTINQATT, vlistinqatt, INT, INT, INT, PSTRING,
FCALLSCFUN3
(
INT
,
vlistDelAtt
,
VLISTDELATT
,
vlistdelatt
,
INT
,
INT
,
STRING
)
FCALLSCFUN6
(
INT
,
vlistDefAttInt
,
VLISTDEFATTINT
,
vlistdefattint
,
INT
,
INT
,
STRING
,
INT
,
INT
,
PINT
)
FCALLSCFUN6
(
INT
,
vlistDefAttFlt
,
VLISTDEFATTFLT
,
vlistdefattflt
,
INT
,
INT
,
STRING
,
INT
,
INT
,
PDOUBLE
)
FCALLSCFUN5
(
INT
,
vlistDefAttTxt
,
VLISTDEFATTTXT
,
vlistdefatttxt
,
INT
,
INT
,
STRING
,
INT
,
STRING
)
FCALLSCFUN5
(
INT
,
vlistDefAttTxt
,
VLISTDEFATTTXT
,
vlistdefatttxt
,
INT
,
INT
,
STRING
,
INT
,
CBUF
)
FCALLSCFUN5
(
INT
,
vlistInqAttInt
,
VLISTINQATTINT
,
vlistinqattint
,
INT
,
INT
,
STRING
,
INT
,
PINT
)
FCALLSCFUN5
(
INT
,
vlistInqAttFlt
,
VLISTINQATTFLT
,
vlistinqattflt
,
INT
,
INT
,
STRING
,
INT
,
PDOUBLE
)
FCALLSCFUN5
(
INT
,
vlistInqAttTxt
,
VLISTINQATTTXT
,
vlistinqatttxt
,
INT
,
INT
,
STRING
,
INT
,
PSTRING
)
FCALLSCFUN5
(
INT
,
vlistInqAttTxt
,
VLISTINQATTTXT
,
vlistinqatttxt
,
INT
,
INT
,
STRING
,
INT
,
CBUF
)
/* GRID routines */
...
...
src/cdiFortran.h
0 → 100644
View file @
b1034dce
#ifndef _CDIFORTRAN_H
#define _CDIFORTRAN_H
/*******************************************************************************
* Character buffer:
*/
#define CBUF_cfINT(N,A,B,X,Y,Z) STRING_cfINT(N,A,B,X,Y,Z)
#define CBUF_cfSEP(T, B) STRING_cfSEP(T,B)
#define CBUF_cfN( T,A) STRING_cfN(T,A)
#define CBUF_cfSTR(N,T,A,B,C,D,E) STRING_cfSTR(N,T,A,B,C,D,E)
#if defined(vmsFortran)
# define CBUF_cfT(M,I,A,B,D) A->dsc$a_pointer
#elif defined(CRAYFortran)
# define CBUF_cfT(M,I,A,B,D) _fcdtocp(A)
#else
# define CBUF_cfT(M,I,A,B,D) A
#endif
#endif
src/make_cdilib
View file @
b1034dce
...
...
@@ -175,6 +175,7 @@ echo "#undef calloc" >> ${PROG}
echo
"#undef free"
>>
${
PROG
}
echo
"#undef DOUBLE_PRECISION"
>>
${
PROG
}
cat
$srcdir
/cfortran.h
>>
${
PROG
}
cat
$srcdir
/cdiFortran.h
>>
${
PROG
}
echo
"#endif"
>>
${
PROG
}
cat
$srcdir
/cdiFortran.c
>>
${
PROG
}
...
...
src/make_fint.c
View file @
b1034dce
...
...
@@ -101,6 +101,7 @@ static struct symbol funArgSym[] = {
{
"INTEGER"
,
"INTVV"
,
"int[][]"
,
"^"
WS
"*(const"
WS
"+)?int("
WS
"+"
SYMRE
")?"
WS
"*
\\
[[^]]*
\\
]"
WS
"*
\\
[[^]]*
\\
]"
WS
"*[,
\\
)]"
,
3
},
{
"REAL"
,
"PFLOAT"
,
"float *"
,
"^"
WS
"*(const"
WS
"+)?float"
WS
"+
\\
*"
SYMRE
"?"
WS
"*[,
\\
)]"
,
2
},
{
"DOUBLEPRECISION"
,
"PDOUBLE"
,
"double *"
,
"^"
WS
"*(const"
WS
"+)?double"
WS
"+
\\
*"
SYMRE
"?"
WS
"*[,
\\
)]"
,
2
},
// { "CHARACTER*(*)", "CBUF", "char *", "^"WS"*(const"WS"+)?char"WS"+\\*+tp_cbuf"WS"*[,\\)]", 1 },
{
"CHARACTER*(*)"
,
"STRING"
,
"char *"
,
"^"
WS
"*const"
WS
"+char"
WS
"+
\\
*"
WS
"*"
SYMRE
"?"
WS
"*[,
\\
)]"
,
1
},
{
"CHARACTER*(*)"
,
"PSTRING"
,
"char *"
,
"^"
WS
"*char"
WS
"+
\\
*"
SYMRE
"?"
WS
"*[,
\\
)]"
,
1
},
};
...
...
@@ -276,6 +277,10 @@ void fortran_interface(char *fname, char *fnameinc, char *fnameint)
fprintf
(
fpint
,
"# include
\"
cfortran.h
\"\n
"
);
fprintf
(
fpint
,
"#endif
\n
"
);
fprintf
(
fpint
,
"
\n
"
);
fprintf
(
fpint
,
"#if ! defined (_CDIFORTRAN_H)
\n
"
);
fprintf
(
fpint
,
"# include
\"
cdifortran.h
\"\n
"
);
fprintf
(
fpint
,
"#endif
\n
"
);
fprintf
(
fpint
,
"
\n
"
);
ssize_t
lineLen
;
while
((
lineLen
=
getline
(
&
line
,
&
lineBufSize
,
fpin
))
>=
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment