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
b2e3fa89
Commit
b2e3fa89
authored
Aug 17, 2009
by
Uwe Schulzweida
Browse files
cgribexlib update
parent
bacac1cb
Changes
8
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
b2e3fa89
...
...
@@ -5,6 +5,7 @@
* changed time format from hhmm to hhmmss
* changed encode/decode_time to seconds
* ieg: added support for Gaussian grids [request: Ralf Podzun]
* cdfDefLonLat2D: added attributes for Panoply
* added support for netCDF timeseries without grid
* added support for netCDF timeseries with only one grid axis
* julday_add_seconds: bug fix for adjusting negative seconds
...
...
src/Makefile.am
View file @
b2e3fa89
...
...
@@ -43,7 +43,7 @@ libcdi_a_SOURCES = \
file.c
\
binary.c
\
swap.c
\
griblib.c
\
c
grib
ex
lib.c
\
gribapi.c
\
cfortran.h
\
binary.h
\
...
...
@@ -69,7 +69,7 @@ libcdi_a_SOURCES = \
stream_ieg.h
\
stream_int.h
\
basetime.h
\
grib.h
\
c
grib
ex
.h
\
gribapi.h
\
grid.h
\
service.h
\
...
...
src/Makefile.in
View file @
b2e3fa89
...
...
@@ -70,7 +70,7 @@ am_libcdi_a_OBJECTS = cdiFortran.$(OBJEXT) cdi_error.$(OBJEXT) \
tsteps.
$(OBJEXT)
stream_int.
$(OBJEXT)
servicelib.
$(OBJEXT)
\
extralib.
$(OBJEXT)
ieglib.
$(OBJEXT)
cdf.
$(OBJEXT)
\
cdf_int.
$(OBJEXT)
file.
$(OBJEXT)
binary.
$(OBJEXT)
\
swap.
$(OBJEXT)
griblib.
$(OBJEXT)
gribapi.
$(OBJEXT)
swap.
$(OBJEXT)
c
grib
ex
lib.
$(OBJEXT)
gribapi.
$(OBJEXT)
libcdi_a_OBJECTS
=
$(am_libcdi_a_OBJECTS)
DEFAULT_INCLUDES
=
-I
.@am__isrc@
depcomp
=
$(SHELL)
$(top_srcdir)
/config/depcomp
...
...
@@ -234,7 +234,7 @@ libcdi_a_SOURCES = \
file.c
\
binary.c
\
swap.c
\
griblib.c
\
c
grib
ex
lib.c
\
gribapi.c
\
cfortran.h
\
binary.h
\
...
...
@@ -260,7 +260,7 @@ libcdi_a_SOURCES = \
stream_ieg.h
\
stream_int.h
\
basetime.h
\
grib.h
\
c
grib
ex
.h
\
gribapi.h
\
grid.h
\
service.h
\
...
...
@@ -370,12 +370,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/cdf_int.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/cdiFortran.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/cdi_error.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/cgribexlib.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/dmemory.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/error.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/extralib.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/file.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/gribapi.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/griblib.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/grid.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/ieglib.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/institution.Po@am__quote@
...
...
src/make_cdilib
View file @
b2e3fa89
...
...
@@ -86,14 +86,14 @@ c="dmemory.c \
stream_record.c
\
tsteps.c
\
file.c
\
griblib.c
\
c
grib
ex
lib.c
\
gribapi.c
\
swap.c
\
binary.c
\
cdf.c
\
"
h
=
"cdi_limits.h taxis.h error.h dtypes.h file.h grib.h gribapi.h service.h extra.h
\
h
=
"cdi_limits.h taxis.h error.h dtypes.h file.h
c
grib
ex
.h gribapi.h service.h extra.h
\
ieg.h cdi.h timebase.h calendar.h
\
basetime.h stream_int.h stream_grb.h datetime.h stream_cdf.h
\
tablepar.h table.h util.h grid.h varscan.h binary.h swap.h
\
...
...
src/stream.c
View file @
b2e3fa89
...
...
@@ -14,7 +14,7 @@
#include
"stream_ext.h"
#include
"stream_ieg.h"
#include
"file.h"
#include
"grib.h"
#include
"
c
grib
ex
.h"
#include
"gribapi.h"
#include
"cdf.h"
#include
"service.h"
...
...
@@ -1951,7 +1951,7 @@ void cdiPrintVersion(void)
{
fprintf
(
stderr
,
" CDI library version : %s
\n
"
,
cdiLibraryVersion
());
#if defined (HAVE_LIBGRIB)
fprintf
(
stderr
,
"
GRIB library version : %s
\n
"
,
gribLibraryVersion
());
fprintf
(
stderr
,
"
C_
GRIB
EX
library version : %s
\n
"
,
c
grib
ex
LibraryVersion
());
#endif
#if defined (HAVE_LIBGRIB_API)
fprintf
(
stderr
,
"GRIB_API library version : %s
\n
"
,
gribapiLibraryVersion
());
...
...
src/stream_cdf.c
View file @
b2e3fa89
...
...
@@ -1543,6 +1543,9 @@ void cdfDefLonLat2D(int streamID, int gridID)
if
(
(
len
=
strlen
(
xstdname
))
)
cdf_put_att_text
(
fileID
,
ncxvarid
,
"standard_name"
,
len
,
xstdname
);
/* attribute for Panoply */
cdf_put_att_text
(
fileID
,
ncxvarid
,
"_CoordinateAxisType"
,
3
,
"Lon"
);
streamptr
->
ncxvarID
[
gridindex
]
=
ncxvarid
;
if
(
gridInqXboundsPtr
(
gridID
)
)
...
...
@@ -1566,6 +1569,9 @@ void cdfDefLonLat2D(int streamID, int gridID)
if
(
(
len
=
strlen
(
ystdname
))
)
cdf_put_att_text
(
fileID
,
ncyvarid
,
"standard_name"
,
len
,
ystdname
);
/* attribute for Panoply */
cdf_put_att_text
(
fileID
,
ncyvarid
,
"_CoordinateAxisType"
,
3
,
"Lat"
);
streamptr
->
ncyvarID
[
gridindex
]
=
ncyvarid
;
if
(
gridInqYboundsPtr
(
gridID
)
)
...
...
src/stream_grb.c
View file @
b2e3fa89
...
...
@@ -11,7 +11,7 @@
#include
"dmemory.h"
#include
"cdi.h"
#include
"stream_int.h"
#include
"grib.h"
#include
"
c
grib
ex
.h"
#include
"file.h"
#include
"varscan.h"
#include
"datetime.h"
...
...
@@ -1152,13 +1152,13 @@ void grbScanTimestep1(int streamID)
level1
=
ISEC1_Level1
;
level2
=
ISEC1_Level2
;
gribDateTime
(
isec1
,
&
vdate
,
&
vtime
);
if
(
ISEC4_NumBits
>
0
&&
ISEC4_NumBits
<=
32
)
prec
=
ISEC4_NumBits
;
else
prec
=
DATATYPE_PACK
;
gribDateTime
(
isec1
,
&
vdate
,
&
vtime
);
if
(
nrecs
==
0
)
{
datetime0
.
date
=
vdate
;
...
...
@@ -1738,20 +1738,20 @@ void grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *
}
static
void
gr
b
DefInstitut
(
int
*
isec1
,
int
center
,
int
subcenter
)
void
c
gr
ibex
DefInstitut
(
int
*
isec1
,
int
center
,
int
subcenter
)
{
ISEC1_CenterID
=
center
;
ISEC1_SubCenterID
=
subcenter
;
}
static
void
gr
b
DefModel
(
int
*
isec1
,
int
model
)
void
c
gr
ibex
DefModel
(
int
*
isec1
,
int
model
)
{
ISEC1_ModelID
=
model
;
}
static
void
gr
b
DefCode
(
int
*
isec1
,
int
code
,
int
codetable
)
void
c
gr
ibex
DefCode
(
int
*
isec1
,
int
code
,
int
codetable
)
{
ISEC1_CodeTable
=
codetable
;
if
(
code
<
0
)
code
=
-
code
;
...
...
@@ -1759,7 +1759,7 @@ void grbDefCode(int *isec1, int code, int codetable)
}
static
void
gr
b
DefTime
(
int
*
isec1
,
int
date
,
int
time
,
int
numavg
,
int
timeID
)
void
c
gr
ibex
DefTime
(
int
*
isec1
,
int
date
,
int
time
,
int
numavg
,
int
timeID
)
{
int
year
,
month
,
day
,
hour
,
minute
,
second
;
int
century
=
0
;
...
...
@@ -1893,9 +1893,9 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
}
static
void
gr
b
DefGrid
(
int
*
isec1
,
int
*
isec2
,
int
gridID
)
void
c
gr
ibex
DefGrid
(
int
*
isec1
,
int
*
isec2
,
int
gridID
)
{
static
char
func
[]
=
"gr
b
DefGrid"
;
static
char
func
[]
=
"
c
gr
ibex
DefGrid"
;
int
gridtype
;
static
short
lwarn
=
TRUE
;
...
...
@@ -2079,9 +2079,9 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
}
static
void
gr
b
DefLevel
(
int
*
isec1
,
int
*
isec2
,
double
*
fsec2
,
int
zaxisID
,
int
levelID
)
void
c
gr
ibex
DefLevel
(
int
*
isec1
,
int
*
isec2
,
double
*
fsec2
,
int
zaxisID
,
int
levelID
)
{
static
char
func
[]
=
"gr
b
DefLevel"
;
static
char
func
[]
=
"
c
gr
ibex
DefLevel"
;
double
level
;
int
ilevel
,
zaxistype
,
ltype
;
static
int
warning
=
1
;
...
...
@@ -2278,12 +2278,12 @@ void grbDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID
}
static
void
gr
b
DefMask
(
int
*
isec3
)
void
c
gr
ibex
DefMask
(
int
*
isec3
)
{
}
static
void
gr
b
DefData
(
int
datatype
,
int
*
isec4
,
int
gridID
)
void
c
gr
ibex
DefData
(
int
datatype
,
int
*
isec4
,
int
gridID
)
{
ISEC4_NumValues
=
gridInqSize
(
gridID
);
...
...
@@ -2301,14 +2301,14 @@ void grbDefData(int datatype, int *isec4, int gridID)
}
static
void
gr
b
DefaultSec0
(
int
*
isec0
)
void
c
gr
ibex
DefaultSec0
(
int
*
isec0
)
{
ISEC0_GRIB_Len
=
0
;
ISEC0_GRIB_Version
=
0
;
}
static
void
gr
b
DefaultSec1
(
int
*
isec1
)
void
c
gr
ibex
DefaultSec1
(
int
*
isec1
)
{
ISEC1_CenterID
=
0
;
ISEC1_SubCenterID
=
0
;
...
...
@@ -2316,7 +2316,7 @@ void grbDefaultSec1(int *isec1)
}
static
void
gr
b
DefaultSec4
(
int
*
isec4
)
void
c
gr
ibex
DefaultSec4
(
int
*
isec4
)
{
isec4
[
2
]
=
0
;
isec4
[
3
]
=
0
;
...
...
@@ -2380,9 +2380,9 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
gribbuffer
=
(
unsigned
char
*
)
malloc
(
gribbuffersize
);
gribsize
=
gribbuffersize
/
sizeof
(
int
);
gr
b
DefaultSec0
(
isec0
);
gr
b
DefaultSec1
(
isec1
);
gr
b
DefaultSec4
(
isec4
);
c
gr
ibex
DefaultSec0
(
isec0
);
c
gr
ibex
DefaultSec1
(
isec1
);
c
gr
ibex
DefaultSec4
(
isec4
);
if
(
vlistInqInstitut
(
vlistID
)
!=
UNDEFID
)
instID
=
vlistInqInstitut
(
vlistID
);
...
...
@@ -2394,7 +2394,7 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
int
center
,
subcenter
;
center
=
institutInqCenter
(
instID
);
subcenter
=
institutInqSubcenter
(
instID
);
gr
b
DefInstitut
(
isec1
,
center
,
subcenter
);
c
gr
ibex
DefInstitut
(
isec1
,
center
,
subcenter
);
}
if
(
vlistInqModel
(
vlistID
)
!=
UNDEFID
)
...
...
@@ -2403,17 +2403,17 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
modelID
=
vlistInqVarModel
(
vlistID
,
varID
);
if
(
modelID
!=
UNDEFID
)
gr
b
DefModel
(
isec1
,
modelInqGribID
(
modelID
));
c
gr
ibex
DefModel
(
isec1
,
modelInqGribID
(
modelID
));
tableID
=
vlistInqVarTable
(
vlistID
,
varID
);
datatype
=
vlistInqVarDatatype
(
vlistID
,
varID
);
gr
b
DefCode
(
isec1
,
code
,
tableInqNum
(
tableID
));
gr
b
DefTime
(
isec1
,
date
,
time
,
numavg
,
vlistInqTaxis
(
vlistID
));
gr
b
DefGrid
(
isec1
,
isec2
,
gridID
);
gr
b
DefLevel
(
isec1
,
isec2
,
fsec2
,
zaxisID
,
levelID
);
gr
b
DefMask
(
isec3
);
gr
b
DefData
(
datatype
,
isec4
,
gridID
);
c
gr
ibex
DefCode
(
isec1
,
code
,
tableInqNum
(
tableID
));
c
gr
ibex
DefTime
(
isec1
,
date
,
time
,
numavg
,
vlistInqTaxis
(
vlistID
));
c
gr
ibex
DefGrid
(
isec1
,
isec2
,
gridID
);
c
gr
ibex
DefLevel
(
isec1
,
isec2
,
fsec2
,
zaxisID
,
levelID
);
c
gr
ibex
DefMask
(
isec3
);
c
gr
ibex
DefData
(
datatype
,
isec4
,
gridID
);
if
(
nmiss
>
0
)
{
...
...
src/stream_grb.h
View file @
b2e3fa89
#ifndef _STREAM_GRB_H
#define _STREAM_GRB_H
#ifndef _GRIB_H
# include "grib.h"
#ifndef _
C
GRIB
EX
_H
# include "
c
grib
ex
.h"
#endif
int
grbInqContents
(
int
streamID
);
...
...
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