Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
7cfd43ac
Commit
7cfd43ac
authored
May 23, 2017
by
Oliver Heidmann
Browse files
Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop
parents
e24fa377
cceb96dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
config/default
View file @
7cfd43ac
...
...
@@ -53,6 +53,18 @@ case "${HOSTNAME}" in
$CDOLIBS
\
CXX
=
clang++
CXXFLAGS
=
"-g -Wall -O3"
\
CC
=
clang
CFLAGS
=
"-g -Wall -O3"
elif
test
"
$COMP
"
=
gnu4.9
;
then
${
CONFPATH
}
configure
--prefix
=
$HOME
/local
\
--enable-maintainer-mode
\
$CDOLIBS
\
CXX
=
g++-mp-4.9
CXXFLAGS
=
"-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native -march=native"
\
CC
=
gcc-mp-4.9
CFLAGS
=
"-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native -march=native"
elif
test
"
$COMP
"
=
gnu5
;
then
${
CONFPATH
}
configure
--prefix
=
$HOME
/local
\
--enable-maintainer-mode
\
$CDOLIBS
\
CXX
=
g++-mp-5
CXXFLAGS
=
"-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native -march=native"
\
CC
=
gcc-mp-5
CFLAGS
=
"-g -Wall -W -Wfloat-equal -pedantic -O3 -march=native -march=native"
elif
test
"
$COMP
"
=
gnu
;
then
${
CONFPATH
}
configure
--prefix
=
$HOME
/local
\
--enable-maintainer-mode
\
...
...
doc/tex/makedoc
View file @
7cfd43ac
...
...
@@ -305,7 +305,7 @@ while (<MOFILE>) {
}
print
HELPFILE
"
\n
";
print
HELPFILE
"
st
atic const char *
${mname}
Help
[]
= {
\n
";
print
HELPFILE
"
st
d::vector<std::string>
${mname}
Help = {
\n
";
@hkeys
=
split
("
",
$moperators
);
# print "$#hkeys @hkeys \n";
...
...
@@ -1019,7 +1019,6 @@ while (<MOFILE>) {
# print HELPFILE " \"\",\n";
# print HELPFILE " \"\@End_${operator}\",\n";
print
HELPFILE
"
NULL
\n
";
print
HELPFILE
"
};
\n
";
print
TCFILE
"
\\
end{tabular*}
\n
";
...
...
src/Samplegridicon.cc
View file @
7cfd43ac
...
...
@@ -2,6 +2,7 @@
#include "cdo_int.h"
#include "grid.h"
#define MAX_CHILDS 9
typedef
struct
{
int
ncells
;
...
...
@@ -74,7 +75,7 @@ cellindex_type *read_cellindex(const char *filename)
// cellindex->neighbor = (int*) Malloc(3*ncells*sizeof(int));
cellindex
->
parent
=
(
int
*
)
Malloc
(
ncells
*
sizeof
(
int
));
cellindex
->
child
=
NULL
;
// cellindex->child = (cid != CDI_UNDEFID) ? (int*) Malloc(
4
*ncells*sizeof(int)) : NULL;
// cellindex->child = (cid != CDI_UNDEFID) ? (int*) Malloc(
MAX_CHILDS
*ncells*sizeof(int)) : NULL;
double
*
data
=
(
double
*
)
Malloc
(
ncells
*
sizeof
(
double
));
int
nrecs
=
streamInqTimestep
(
streamID
,
0
);
...
...
@@ -214,18 +215,18 @@ void compute_child(cellindex_type *cellindex1, cellindex_type *cellindex2)
}
int
ncells2
=
cellindex2
->
ncells
;
int
*
child2
=
(
int
*
)
Malloc
(
4
*
ncells2
*
sizeof
(
int
));
int
*
child2
=
(
int
*
)
Malloc
(
MAX_CHILDS
*
ncells2
*
sizeof
(
int
));
cellindex2
->
child
=
child2
;
for
(
int
i
=
0
;
i
<
ncells2
;
++
i
)
{
for
(
int
k
=
0
;
k
<
4
;
++
k
)
child2
[
i
*
4
+
k
]
=
-
1
;
for
(
int
k
=
0
;
k
<
MAX_CHILDS
;
++
k
)
child2
[
i
*
MAX_CHILDS
+
k
]
=
-
1
;
int
j
=
find_index
(
i
,
ncells1
,
parent1
);
if
(
j
<
0
)
continue
;
for
(
int
k
=
0
;
k
<
4
;
++
k
)
for
(
int
k
=
0
;
k
<
MAX_CHILDS
;
++
k
)
{
if
(
i
!=
parent1
[
j
+
k
]
)
break
;
// child2[i*
4
+k] = j+k;
child2
[
i
*
4
+
k
]
=
idx1
[
j
+
k
];
// child2[i*
MAX_CHILDS
+k] = j+k;
child2
[
i
*
MAX_CHILDS
+
k
]
=
idx1
[
j
+
k
];
}
// if ( i%10000 == 0 ) printf("%d %d %d %d %d %d\n", i, j, parent1[j], parent1[j+1], parent1[j+2], parent1[j+3]);
}
...
...
@@ -239,9 +240,9 @@ void compute_sum(int i, int *n, double *sum, double *sumq, int kci, cellindex_ty
int
ncells2
=
cellindex
[
kci
]
->
ncells
;
if
(
i
<
0
||
i
>
ncells2
)
cdoAbort
(
"Child grid cell index %d out of bounds %d!"
,
i
,
ncells2
);
for
(
int
k
=
0
;
k
<
4
;
++
k
)
for
(
int
k
=
0
;
k
<
MAX_CHILDS
;
++
k
)
{
int
index
=
cellindex
[
kci
]
->
child
[
i
*
4
+
k
];
int
index
=
cellindex
[
kci
]
->
child
[
i
*
MAX_CHILDS
+
k
];
if
(
index
==
-
1
)
break
;
if
(
kci
==
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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