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
ddfe21dc
Commit
ddfe21dc
authored
9 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
added make_cdilib_nc
parent
a70ff7ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
src/make_cdilib_nc
+177
-0
177 additions, 0 deletions
src/make_cdilib_nc
src/stream.c
+6
-0
6 additions, 0 deletions
src/stream.c
with
184 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
ddfe21dc
...
...
@@ -272,6 +272,7 @@ src/iterator_fallback.h -text
src/iterator_grib.c -text
src/iterator_grib.h -text
src/make_cdilib -text
src/make_cdilib_nc -text
src/make_fint.c -text
src/mo_cdi.f90 -text
src/model.c -text
...
...
This diff is collapsed.
Click to expand it.
src/make_cdilib_nc
0 → 100755
+
177
−
0
View file @
ddfe21dc
#!/bin/sh
#
# combine source code into one module
# easier to compile -- no make file needed
#
# pretty generic script -- just echos, cats and greps.
#
#
srcdir
=
.
if
[
!
-z
$1
]
;
then
srcdir
=
$1
fi
PROG
=
cdilib.c
echo
"combining source code into one module"
echo
"output is
${
PROG
}
"
#set -x
rm
-f
${
PROG
}
DATE
=
`
date
+%F
`
if
test
-f
../configure.ac
;
then
CDILIBVERSION
=
\"
`
sed
-n
'/^AC_INIT(/s/AC_INIT *( *[^,]*,[[ ]*\([^],]*\).*/\1/ p'
../configure.ac
`
\"
else
echo
"error: cannot find configure.ac"
>
&2
exit
1
fi
cat
>
${
PROG
}
<<
EOR
/* Automatically generated by
$USER
at
$DATE
, do not edit */
/* CDILIB_VERSION=
${
CDILIBVERSION
}
*/
/* netCDF only version !!! */
#define HAVE_LIBNETCDF
#ifdef _ARCH_PWR6
#pragma options nostrict
#endif
#if defined (HAVE_CONFIG_H)
# include "config.h"
#endif
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef _SX
#include <aio.h>
#endif
#include <stdbool.h>
#include <assert.h>
#if defined (HAVE_LIBGRIB_API)
# include <grib_api.h>
#endif
#if defined (HAVE_MMAP)
# include <sys/mman.h> /* mmap() is defined in this header */
#endif
#if defined (HAVE_LIBPTHREAD)
# include <pthread.h>
#endif
#if defined (HAVE_LIBSZ)
# include <szlib.h>
#endif
static void tableDefault(void) {}
EOR
files
=
"basetime.c
\
calendar.c
\
cdf.c
\
cdf_int.c
\
cdi_cksum.c
\
cdi_error.c
\
cdi_int.c
\
cdi_util.c
\
cksum.c
\
dmemory.c
\
error.c
\
file.c
\
gaussgrid.c
\
grid.c
\
institution.c
\
model.c
\
namespace.c
\
referenceCounting.c
\
resource_handle.c
\
serialize.c
\
stream.c
\
stream_write.c
\
stream_read.c
\
stream_cdf.c
\
stream_history.c
\
stream_record.c
\
stream_var.c
\
cdf_write.c
\
cdf_read.c
\
subtype.c
\
table.c
\
taxis.c
\
timebase.c
\
tsteps.c
\
util.c
\
varscan.c
\
vlist.c
\
vlist_att.c
\
vlist_var.c
\
zaxis.c"
car
()
{
echo
"
$1
"
}
cdr
()
{
shift
echo
"
$@
"
}
listIncludes
()
{
grep
'^ *# *include *"'
"
$1
"
|
sed
's/^ *# *include *"\(.*\)".*$/\1/'
}
scanlist
=
"
$files
"
fileList
=
until
test
"foo
$scanlist
"
=
"foo"
;
do
curFile
=
"
$(
car
$scanlist
)
"
scanlist
=
"
$(
cdr
$scanlist
)
"
case
$curFile
in
(
\<
*
\>
)
fileList
=
"
$fileList
$(
echo
"
$curFile
"
|
sed
's/<\(.*\)>/\1/'
)
"
;;
(
*
)
if
echo
"
$fileList
"
|
grep
-q
'\<'
"
$curFile
"
'\>'
;
then
true
#Nothing to do, we have already scanned this header.
else
#Prepend the includes of the current header to the scanlist so that we will scan them in the order that the preprocessor would.
scanlist
=
"
$(
listIncludes
"
$curFile
"
)
<
$curFile
>
$scanlist
"
fi
;;
esac
done
echo
file list:
echo
$fileList
for
file
in
$fileList
;
do
if
[
"
$file
"
=
"config.h"
-o
"
$file
"
=
"cgribex.h"
-o
"
$file
"
=
"gribapi.h"
-o
"
$file
"
=
"table.h"
]
;
then
echo
"skipped file:
$file
"
else
cat
$srcdir
/
$file
|
grep
-v
'^ *# *include *"'
>>
${
PROG
}
fi
done
cpp
-P
-DVERSION
=
"
${
CDILIBVERSION
}
"
-DCDI_H_
\
$srcdir
/version.c
>>
${
PROG
}
exit
This diff is collapsed.
Click to expand it.
src/stream.c
+
6
−
0
View file @
ddfe21dc
...
...
@@ -144,6 +144,7 @@ int cdiGetFiletype(const char *filename, int *byteorder)
if
(
CDI_Debug
)
Message
(
"found IEG file = %s"
,
filename
);
}
#endif
#if defined (HAVE_LIBCGRIBEX)
else
if
(
gribCheckSeek
(
fileID
,
&
recpos
,
&
version
)
==
0
)
{
if
(
version
<=
1
)
...
...
@@ -157,6 +158,7 @@ int cdiGetFiletype(const char *filename, int *byteorder)
if
(
CDI_Debug
)
Message
(
"found seeked GRIB2 file = %s"
,
filename
);
}
}
#endif
fileClose
(
fileID
);
...
...
@@ -1576,10 +1578,14 @@ cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
}
break
;
#endif
#ifdef HAVE_LIBGRIB
case
FILETYPE_GRB
:
case
FILETYPE_GRB2
:
gribContainersNew
(
streamptr
);
break
;
#endif
default:
;
}
}
...
...
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