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
7f2fa6e1
Commit
7f2fa6e1
authored
Sep 29, 2014
by
Uwe Schulzweida
Browse files
cgribexlib update
parent
ebab4578
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
7f2fa6e1
...
...
@@ -352,7 +352,7 @@ void streamWriteRecordF(int streamID, const float *data_vec, int nmiss);
void
streamReadRecord
(
int
streamID
,
double
*
data_vec
,
int
*
nmiss
);
void
streamCopyRecord
(
int
streamIDdest
,
int
streamIDsrc
);
void
streamInqGinfo
(
int
streamID
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
);
void
streamInqG
RIB
info
(
int
streamID
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
);
/* VLIST routines */
...
...
src/cdi.inc
View file @
7f2fa6e1
...
...
@@ -4,7 +4,7 @@
!
!
Author
:
!
-------
!
Uwe
Schulzweida
,
MPI
-
MET
,
Hamburg
,
August
2014
!
Uwe
Schulzweida
,
MPI
-
MET
,
Hamburg
,
September
2014
!
INTEGER
CDI_MAX_NAME
...
...
src/cgribex.h
View file @
7f2fa6e1
...
...
@@ -247,7 +247,7 @@ int gribFileSeek(int fileID, long *offset);
int
gribReadSize
(
int
fileID
);
int
gribVersion
(
unsigned
char
*
buffer
,
size_t
buffersize
);
int
grib
G
info
(
off_t
recpos
,
long
recsize
,
unsigned
char
*
gribbuffer
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
);
int
grib
_
info
_for_grads
(
off_t
recpos
,
long
recsize
,
unsigned
char
*
gribbuffer
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
);
double
calculate_pfactor
(
const
double
*
spectralField
,
long
fieldTruncation
,
long
subsetTruncation
);
...
...
src/cgribexlib.c
View file @
7f2fa6e1
/* Automatically generated by m214003 at 2014-09-
16
, do not edit */
/* Automatically generated by m214003 at 2014-09-
29
, do not edit */
/* CGRIBEXLIB_VERSION="1.7.0" */
...
...
@@ -5840,8 +5840,8 @@ int grib2Sections(unsigned char *gribbuffer, long bufsize, unsigned char **idsp,
}
int
grib
G
info
(
off_t
recpos
,
long
recsize
,
unsigned
char
*
gribbuffer
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
)
int
grib
_
info
_for_grads
(
off_t
recpos
,
long
recsize
,
unsigned
char
*
gribbuffer
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
)
{
unsigned
char
*
pds
,
*
gds
,
*
bms
,
*
bds
;
unsigned
char
*
bufpointer
,
*
is
,
*
section
;
...
...
@@ -5948,17 +5948,20 @@ void grib1PrintALL(int nrec, long offset, long recpos, long recsize, unsigned ch
unsigned
char
*
is
=
NULL
,
*
pds
=
NULL
,
*
gds
=
NULL
,
*
bms
=
NULL
,
*
bds
=
NULL
;
double
cr
=
1
;
int
bdslen
;
int
llarge
=
0
;
if
(
header
)
{
fprintf
(
stdout
,
" Rec : Off Position Size : V PDS GDS BMS BDS : Code Level : LType GType: CR
\n
"
);
" Rec : Off Position Size : V PDS GDS BMS BDS : Code Level : LType GType: CR
LL
\n
"
);
/* ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
header
=
0
;
}
is
=
gribbuffer
;
if
(
gribrec_len
(
is
[
4
],
is
[
5
],
is
[
6
])
>
JP23SET
)
llarge
=
1
;
nerr
=
grib1Sections
(
gribbuffer
,
recsize
,
&
pds
,
&
gds
,
&
bms
,
&
bds
);
if
(
nerr
)
{
...
...
@@ -5991,10 +5994,10 @@ void grib1PrintALL(int nrec, long offset, long recpos, long recsize, unsigned ch
cr
=
((
double
)
s1
)
/
s2
;
}
fprintf
(
stdout
,
"%5d :%4ld %8ld %6ld :%2d%4d%5d
%7d%7
d : %3d
%7
d : %5d %5d %6.4g
\n
"
,
fprintf
(
stdout
,
"%5d :%4ld %8ld %6ld :%2d%4d%5d
%6d %6
d : %3d
%6
d : %5d %5d %6.4g
%c
\n
"
,
nrec
,
offset
,
recpos
,
recsize
,
GRIB_EDITION
(
is
),
PDS_Len
,
GDS_Len
,
BMS_Len
,
bdslen
,
PDS_Parameter
,
level
,
PDS_LevelType
,
GridType
,
cr
);
PDS_Parameter
,
level
,
PDS_LevelType
,
GridType
,
cr
,
llarge
?
'T'
:
'F'
);
}
...
...
@@ -14125,7 +14128,7 @@ void encode_dummy(void)
(
void
)
encode_array_unrolled_double
(
0
,
0
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
);
(
void
)
encode_array_unrolled_float
(
0
,
0
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
);
}
static
const
char
grb_libvers
[]
=
"1.7.0"
" of ""Sep
16
2014"" ""14:
09:08
"
;
static
const
char
grb_libvers
[]
=
"1.7.0"
" of ""Sep
29
2014"" ""14:
24:37
"
;
const
char
*
cgribexLibraryVersion
(
void
)
{
...
...
src/mo_cdi.f90
View file @
7f2fa6e1
...
...
@@ -184,47 +184,6 @@ module mo_cdi
integer
(
kind
=
c_int
)
::
getchar_unlocked
end
function
getchar_unlocked
end
interface
interface
function
putchar
(
p__c
)
bind
(
c
,
name
=
'putchar'
)
import
::
c_int
integer
(
kind
=
c_int
),
value
::
p__c
integer
(
kind
=
c_int
)
::
putchar
end
function
putchar
end
interface
interface
function
putchar_unlocked
(
p__c
)
bind
(
c
,
name
=
'putchar_unlocked'
)
import
::
c_int
integer
(
kind
=
c_int
),
value
::
p__c
integer
(
kind
=
c_int
)
::
putchar_unlocked
end
function
putchar_unlocked
end
interface
interface
function
puts
(
p__s
)
bind
(
c
,
name
=
'puts'
)
import
::
c_char
,
c_int
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__s
integer
(
kind
=
c_int
)
::
puts
end
function
puts
end
interface
interface
subroutine
perror
(
p__s
)
bind
(
c
,
name
=
'perror'
)
import
::
c_char
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__s
end
subroutine
perror
end
interface
interface
function
gnu_dev_major
(
p__dev
)
bind
(
c
,
name
=
'gnu_dev_major'
)
import
::
c_int
integer
(
kind
=
c_int
),
value
::
p__dev
integer
(
kind
=
c_int
)
::
gnu_dev_major
end
function
gnu_dev_major
end
interface
interface
function
gnu_dev_minor
(
p__dev
)
bind
(
c
,
name
=
'gnu_dev_minor'
)
import
::
c_int
integer
(
kind
=
c_int
),
value
::
p__dev
integer
(
kind
=
c_int
)
::
gnu_dev_minor
end
function
gnu_dev_minor
end
interface
interface
subroutine
cdiReset
()
bind
(
c
,
name
=
'cdiReset'
)
end
subroutine
cdiReset
...
...
@@ -2968,16 +2927,8 @@ module mo_cdi
end
interface
public
::
strlen
public
::
tempnam
public
::
getchar
public
::
getchar_unlocked
public
::
putchar
public
::
putchar_unlocked
public
::
gets
public
::
puts
public
::
perror
public
::
gnu_dev_major
public
::
gnu_dev_minor
public
::
cdiReset
public
::
cdiStringError
public
::
cdiDebug
...
...
@@ -3514,45 +3465,6 @@ module mo_cdi
public
::
CALENDAR_NONE
contains
function
tempnam
(
p__dir
,
p__pfx
)
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__dir
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__pfx
interface
function
tempnam_c
(
p__dir
,
p__pfx
)
bind
(
c
,
name
=
'tempnam'
)
import
::
c_ptr
,
c_char
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__dir
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__pfx
type
(
c_ptr
)
::
tempnam_c
end
function
tempnam_c
end
interface
character
(
len
=
1
,
kind
=
c_char
),
pointer
::
tempnam
(:)
type
(
c_ptr
)
::
cptr
integer
::
slen
(
1
)
cptr
=
tempnam_c
(
p__dir
,&
p__pfx
)
tempnam
=>
null
()
slen
(
1
)
=
int
(
strlen
(
cptr
))
call
c_f_pointer
(
cptr
,
tempnam
,
slen
)
end
function
tempnam
function
gets
(
p__s
)
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__s
interface
function
gets_c
(
p__s
)
bind
(
c
,
name
=
'gets'
)
import
::
c_ptr
,
c_char
character
(
kind
=
c_char
),
dimension
(
*
)
::
p__s
type
(
c_ptr
)
::
gets_c
end
function
gets_c
end
interface
character
(
len
=
1
,
kind
=
c_char
),
pointer
::
gets
(:)
type
(
c_ptr
)
::
cptr
integer
::
slen
(
1
)
cptr
=
gets_c
(
p__s
)
gets
=>
null
()
slen
(
1
)
=
int
(
strlen
(
cptr
))
call
c_f_pointer
(
cptr
,
gets
,
slen
)
end
function
gets
function
cdiStringError
(
cdiErrno
)
integer
(
kind
=
c_int
),
value
::
cdiErrno
interface
...
...
src/stream_grb.c
View file @
7f2fa6e1
...
...
@@ -684,7 +684,7 @@ void grb_write_record(stream_t * streamptr, int memtype, const void *data, int n
}
void
streamInqGinfo
(
int
streamID
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
)
void
streamInqG
RIB
info
(
int
streamID
,
int
*
intnum
,
float
*
fltnum
,
off_t
*
bignum
)
{
stream_t
*
streamptr
=
stream_to_pointer
(
streamID
);
...
...
@@ -706,7 +706,7 @@ void streamInqGinfo(int streamID, int *intnum, float *fltnum, off_t *bignum)
if
(
zip
>
0
)
Error
(
"Compressed GRIB records unsupported!"
);
else
grib
G
info
(
recpos
,
(
long
)
gribbuffersize
,
(
unsigned
char
*
)
gribbuffer
,
intnum
,
fltnum
,
bignum
);
grib
_
info
_for_grads
(
recpos
,
(
long
)
gribbuffersize
,
(
unsigned
char
*
)
gribbuffer
,
intnum
,
fltnum
,
bignum
);
}
}
/*
...
...
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