Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
b798a706
Commit
b798a706
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Removed function hdfLibraryVersion().
parent
28a6be63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!42
Develop
,
!35
M214003/develop
Pipeline
#30821
passed
2 years ago
Stage: external
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cdf.c
+7
-82
7 additions, 82 deletions
src/cdf.c
src/cdf.h
+0
-1
0 additions, 1 deletion
src/cdf.h
src/cdi_int.c
+0
-3
0 additions, 3 deletions
src/cdi_int.c
with
7 additions
and
86 deletions
src/cdf.c
+
7
−
82
View file @
b798a706
...
...
@@ -16,42 +16,7 @@ cdfLibraryVersion(void)
return
nc_inq_libvers
();
}
#ifdef HAVE_H5GET_LIBVERSION
#ifdef __cplusplus
extern
"C"
{
#endif
int
H5get_libversion
(
unsigned
*
,
unsigned
*
,
unsigned
*
);
#ifdef __cplusplus
}
#endif
#endif
const
char
*
hdfLibraryVersion
(
void
)
{
#ifdef HAVE_H5GET_LIBVERSION
static
char
hdf_libvers
[
256
];
static
int
linit
=
0
;
if
(
!
linit
)
{
linit
=
1
;
unsigned
majnum
,
minnum
,
relnum
;
H5get_libversion
(
&
majnum
,
&
minnum
,
&
relnum
);
#ifdef HAVE_NC4HDF5_THREADSAFE
snprintf
(
hdf_libvers
,
sizeof
(
hdf_libvers
),
"%u.%u.%u threadsafe"
,
majnum
,
minnum
,
relnum
);
#else
snprintf
(
hdf_libvers
,
sizeof
(
hdf_libvers
),
"%u.%u.%u"
,
majnum
,
minnum
,
relnum
);
#endif
}
return
hdf_libvers
;
#else
return
"library undefined"
;
#endif
}
int
CDF_Debug
=
0
;
/* If set to 1, debugging */
int
CDF_Debug
=
0
;
// If set to 1, debugging
void
cdfDebug
(
int
debug
)
...
...
@@ -88,7 +53,7 @@ has_uri_scheme(const char *uri)
const
char
*
pos
=
strstr
(
uri
,
"://"
);
if
(
pos
)
{
const
int
len
=
pos
-
uri
;
int
len
=
pos
-
uri
;
if
(
strncmp
(
uri
,
"file"
,
len
)
==
0
||
strncmp
(
uri
,
"https"
,
len
)
==
0
||
strncmp
(
uri
,
"s3"
,
len
)
==
0
)
return
true
;
}
...
...
@@ -99,7 +64,7 @@ static int
cdfOpenFile
(
const
char
*
filename
,
const
char
*
mode
,
int
*
filetype
)
{
int
ncid
=
-
1
;
const
int
fmode
=
tolower
(
*
mode
);
int
fmode
=
tolower
(
*
mode
);
int
writemode
=
NC_CLOBBER
;
int
readmode
=
NC_NOWRITE
;
...
...
@@ -111,7 +76,7 @@ cdfOpenFile(const char *filename, const char *mode, int *filetype)
{
case
'r'
:
{
const
int
status
=
cdf_open
(
filename
,
readmode
,
&
ncid
);
int
status
=
cdf_open
(
filename
,
readmode
,
&
ncid
);
if
(
status
>
0
&&
ncid
<
0
)
ncid
=
CDI_ESYSTEM
;
#ifdef HAVE_NETCDF4
else
...
...
@@ -192,55 +157,15 @@ cdfOpen(const char *filename, const char *mode, int filetype)
return
fileID
;
}
static
int
cdf4CheckLibVersions
(
void
)
{
int
status
=
0
;
#ifdef HAVE_NETCDF4
#ifdef HAVE_H5GET_LIBVERSION
static
int
checked
=
0
;
if
(
!
checked
)
{
checked
=
1
;
unsigned
majnum
,
minnum
,
relnum
;
sscanf
(
nc_inq_libvers
(),
"%u.%u.%u"
,
&
majnum
,
&
minnum
,
&
relnum
);
// printf("netCDF %u.%u.%u\n", majnum, minnum, relnum);
const
unsigned
ncmaxver
=
4
*
1000000
+
4
*
1000
;
const
unsigned
nclibver
=
majnum
*
1000000
+
minnum
*
1000
+
relnum
;
if
(
nclibver
<=
ncmaxver
)
{
H5get_libversion
(
&
majnum
,
&
minnum
,
&
relnum
);
const
unsigned
hdf5maxver
=
1
*
1000000
+
10
*
1000
;
const
unsigned
hdf5libver
=
majnum
*
1000000
+
minnum
*
1000
+
relnum
;
if
(
hdf5libver
>=
hdf5maxver
)
{
fprintf
(
stderr
,
"NetCDF library 4.4.0 or earlier, combined with libhdf5 1.10.0 or greater not supported!
\n
"
);
status
=
1
;
}
}
}
#endif
#endif
return
status
;
}
int
cdf4Open
(
const
char
*
filename
,
const
char
*
mode
,
int
*
filetype
)
{
if
(
CDF_Debug
)
Message
(
"Open %s with mode %c"
,
filename
,
*
mode
);
#ifdef HAVE_NETCDF4
if
(
cdf4CheckLibVersions
()
==
0
)
{
const
int
fileID
=
cdfOpenFile
(
filename
,
mode
,
filetype
);
if
(
CDF_Debug
)
Message
(
"File %s opened with id %d"
,
filename
,
fileID
);
return
fileID
;
}
return
CDI_EUFTYPE
;
int
fileID
=
cdfOpenFile
(
filename
,
mode
,
filetype
);
if
(
CDF_Debug
)
Message
(
"File %s opened with id %d"
,
filename
,
fileID
);
return
fileID
;
#else
return
CDI_ELIBNAVAIL
;
#endif
...
...
This diff is collapsed.
Click to expand it.
src/cdf.h
+
0
−
1
View file @
b798a706
...
...
@@ -6,7 +6,6 @@ void cdfDebug(int debug);
extern
int
CDF_Debug
;
const
char
*
cdfLibraryVersion
(
void
);
const
char
*
hdfLibraryVersion
(
void
);
int
cdfOpen
(
const
char
*
filename
,
const
char
*
mode
,
int
filetype
);
int
cdf4Open
(
const
char
*
filename
,
const
char
*
mode
,
int
*
filetype
);
...
...
This diff is collapsed.
Click to expand it.
src/cdi_int.c
+
0
−
3
View file @
b798a706
...
...
@@ -145,9 +145,6 @@ cdiPrintVersion(void)
#ifdef HAVE_LIBNETCDF
fprintf
(
stdout
,
" NetCDF library version : %s
\n
"
,
cdfLibraryVersion
());
#endif
#ifdef HAVE_NC4HDF5
// fprintf(stdout, " HDF5 library version : %s\n", hdfLibraryVersion());
#endif
#ifdef HAVE_LIBSERVICE
fprintf
(
stdout
,
" exse library version : %s
\n
"
,
srvLibraryVersion
());
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment