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
e1fde012
Commit
e1fde012
authored
Apr 21, 2006
by
Uwe Schulzweida
Browse files
add function tableInqParCode
parent
ef5209f5
Changes
7
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
e1fde012
...
...
@@ -5,6 +5,7 @@
* cdfInqContents: use coord vars from attr coordinates (bug report: Alberto Maurizi)
* gridPrint: print xfirst and xinc if xinc is constant
* gridGenYvals: try to calculate non global gaussian latitides
* add function tableInqParCode
* Version 0.9.7 released
2006-03-08 Uwe Schulzweida <schulzweida@dkrz.de>
...
...
config/default
View file @
e1fde012
...
...
@@ -28,18 +28,18 @@ case "${HOSTNAME}" in
--with-netcdf
=
/scratch/localA/m214003/local
\
CC
=
gcc
CFLAGS
=
"-ansi -g -O2 -Wall"
CFINT
=
-Df2cFortran
;;
# sparc-sun-solaris2.6
regen
|
gardiken
)
./configure
--prefix
=
$HOME
/local/SUN
\
--with-netcdf
=
/pf/m/m214089/local/SUN
\
CC
=
gcc
CFLAGS
=
"-g -O2 -Wall"
;;
# sparc-sun-solaris2.8
xxf
)
./configure
--prefix
=
$HOME
/local/SUN
\
--with-netcdf
=
/client
\
CC
=
cc
CFLAGS
=
"-fast"
;;
# sparc-sun-solaris2.9
executor
|
yang
|
yin
)
./configure
--prefix
=
$HOME
/local/SUN64
\
--with-netcdf
=
/scratch/small/m214/m214089/local/SunOS64
\
CC
=
cc
CFLAGS
=
"-g -mt -fast -xtarget=native -xarch=v9a"
;;
# sx6-nec-superux12.2
cs
*
)
./configure
--prefix
=
$HOME
/local
\
...
...
src/cdi.h
View file @
e1fde012
...
...
@@ -607,6 +607,7 @@ int tableInqModel(int tableID);
void
tableInqPar
(
int
tableID
,
int
code
,
char
*
name
,
char
*
longname
,
char
*
units
);
int
tableInqParCode
(
int
tableID
,
char
*
name
,
int
*
code
);
int
tableInqParName
(
int
tableID
,
int
code
,
char
*
name
);
int
tableInqParLongname
(
int
tableID
,
int
code
,
char
*
longname
);
int
tableInqParUnits
(
int
tableID
,
int
code
,
char
*
units
);
...
...
src/stream_cdf.c
View file @
e1fde012
...
...
@@ -265,6 +265,10 @@ static void cdfGetAttText(int fileID, int ncvarid, char *attname, char *atttext,
if
(
(
int
)
attlen
>
maxlen
)
attlen
=
maxlen
;
memcpy
(
atttext
,
attbuf
,
attlen
);
}
else
{
atttext
[
0
]
=
0
;
}
}
#endif
...
...
src/table.c
View file @
e1fde012
...
...
@@ -660,6 +660,7 @@ void tableWrite(const char *ptfile, int tableID)
fclose
(
ptfp
);
}
void
tableWriteC
(
const
char
*
filename
,
int
tableID
)
{
static
char
func
[]
=
"tableWriteC"
;
...
...
@@ -746,6 +747,36 @@ void tableWriteC(const char *filename, int tableID)
fclose
(
ptfp
);
}
int
tableInqParCode
(
int
tableID
,
char
*
varname
,
int
*
code
)
{
int
item
,
npars
;
int
err
=
0
;
npars
=
parTable
[
tableID
].
npars
;
if
(
tableID
==
UNDEFID
||
varname
==
NULL
)
{
err
=
1
;
}
else
{
for
(
item
=
0
;
item
<
npars
;
item
++
)
{
if
(
parTable
[
tableID
].
pars
[
item
].
name
)
if
(
strcmp
(
parTable
[
tableID
].
pars
[
item
].
name
,
varname
)
==
0
)
{
*
code
=
parTable
[
tableID
].
pars
[
item
].
id
;
break
;
}
}
if
(
item
==
npars
)
err
=
1
;
}
return
(
err
);
}
int
tableInqParName
(
int
tableID
,
int
code
,
char
*
varname
)
{
int
item
,
npars
;
...
...
@@ -774,6 +805,7 @@ int tableInqParName(int tableID, int code, char *varname)
return
(
err
);
}
char
*
tableInqParNamePtr
(
int
tableID
,
int
code
)
{
char
*
name
=
NULL
;
...
...
@@ -795,6 +827,7 @@ char *tableInqParNamePtr(int tableID, int code)
return
(
name
);
}
char
*
tableInqParLongnamePtr
(
int
tableID
,
int
code
)
{
char
*
longname
=
NULL
;
...
...
@@ -816,6 +849,7 @@ char *tableInqParLongnamePtr(int tableID, int code)
return
(
longname
);
}
char
*
tableInqParUnitsPtr
(
int
tableID
,
int
code
)
{
char
*
units
=
NULL
;
...
...
@@ -837,6 +871,7 @@ char *tableInqParUnitsPtr(int tableID, int code)
return
(
units
);
}
int
tableInqParLongname
(
int
tableID
,
int
code
,
char
*
longname
)
{
int
item
,
npars
;
...
...
@@ -865,6 +900,7 @@ int tableInqParLongname(int tableID, int code, char *longname)
return
(
err
);
}
int
tableInqParUnits
(
int
tableID
,
int
code
,
char
*
units
)
{
int
item
,
npars
;
...
...
@@ -893,6 +929,7 @@ int tableInqParUnits(int tableID, int code, char *units)
return
(
err
);
}
void
tableInqPar
(
int
tableID
,
int
code
,
char
*
name
,
char
*
longname
,
char
*
units
)
{
int
item
,
npars
;
...
...
src/vlist.h
View file @
e1fde012
...
...
@@ -5,7 +5,8 @@
# include "cdi_limits.h"
#endif
#define MAX_ATTRIBUTES 99
#define MAX_ATTRIBUTES 256
typedef
struct
{
...
...
@@ -15,6 +16,7 @@ typedef struct
}
LEVINFO
;
typedef
struct
{
int
flag
;
...
...
@@ -43,6 +45,7 @@ typedef struct
}
VARINFO
;
typedef
struct
{
int
self
;
...
...
@@ -66,6 +69,7 @@ typedef struct
}
VLIST
;
VLIST
*
vlist_to_pointer
(
int
vlistID
);
int
vlistNlock
(
int
vlistID
);
void
vlistLock
(
int
vlistID
);
...
...
src/vlist_var.c
View file @
e1fde012
...
...
@@ -318,12 +318,20 @@ int vlistInqVarCode(int vlistID, int varID)
{
static
char
func
[]
=
"vlistInqVarCode"
;
VLIST
*
vlistptr
;
int
code
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
vlistCheckVarID
(
func
,
vlistID
,
varID
);
return
(
vlistptr
->
vars
[
varID
].
code
);
code
=
vlistptr
->
vars
[
varID
].
code
;
if
(
code
<
0
&&
vlistptr
->
vars
[
varID
].
tableID
!=
-
1
&&
vlistptr
->
vars
[
varID
].
name
!=
NULL
)
{
tableInqParCode
(
vlistptr
->
vars
[
varID
].
tableID
,
vlistptr
->
vars
[
varID
].
name
,
&
code
);
}
return
(
code
);
}
...
...
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