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
libcdi
Commits
aa369b0d
Commit
aa369b0d
authored
Nov 19, 2013
by
Thomas Jahns
🤸
Browse files
Move storage of variable-related IDs to heap in test program.
parent
e9ac69b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/simple_model.c
View file @
aa369b0d
...
...
@@ -72,8 +72,8 @@ modelRun(struct model_config setup, MPI_Comm comm)
{
static
const
char
*
const
fname_prefix
=
"example"
;
int
gridID
,
zaxisID
[
nVars
]
,
taxisID
;
int
vlistID
,
varIDs
[
nVars
]
,
streamID
,
tsID
,
tfID
=
0
;
int
gridID
,
*
zaxisID
,
taxisID
;
int
vlistID
,
*
varIDs
,
streamID
,
tsID
,
tfID
=
0
;
int
i
,
nmiss
=
0
;
double
*
lons
,
*
lats
;
double
*
var
=
NULL
,
*
varslice
=
NULL
;
...
...
@@ -126,7 +126,8 @@ modelRun(struct model_config setup, MPI_Comm comm)
levs
[
i
]
=
101300
.
0
-
3940
.
3
*
(
exp
(
1
.
3579
*
(
double
)(
i
)
/
(
setup
.
max_nlev
-
1
))
-
1
.
0
);
nlev
=
xmalloc
(
2
*
nVars
*
sizeof
(
nlev
[
0
]));
nlev
=
xmalloc
(
4
*
nVars
*
sizeof
(
nlev
[
0
]));
zaxisID
=
nlev
+
3
*
nVars
;
for
(
int
varIdx
=
0
;
varIdx
<
nVars
;
varIdx
++
)
{
int
varLevs
=
random
()
%
4
;
...
...
@@ -162,6 +163,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
vlistID
=
vlistCreate
();
varIDs
=
nlev
+
2
*
nVars
;
for
(
i
=
0
;
i
<
nVars
;
i
++
)
{
varIDs
[
i
]
=
vlistDefVar
(
vlistID
,
gridID
,
zaxisID
[
i
],
TIME_VARIABLE
);
...
...
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