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
3432f15c
Commit
3432f15c
authored
Sep 27, 2017
by
Uwe Schulzweida
Browse files
after: remove copy of input data.
parent
8c424a95
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Afterburner.cc
View file @
3432f15c
...
...
@@ -386,6 +386,7 @@ int after_setNextDate(struct Control *globs)
static
int
num_recs
=
0
;
static
void
*
after_readTimestep
(
void
*
arg
)
{
...
...
@@ -448,12 +449,17 @@ void *after_readTimestep(void *arg)
globs
->
OldDate
.
yr
,
globs
->
OldDate
.
mo
,
globs
->
OldDate
.
dy
,
globs
->
OldDate
.
hr
,
globs
->
OldDate
.
mn
);
}
streamReadRecord
(
globs
->
istreamID
,
globs
->
Field
,
&
nmiss
);
if
(
analysisData
)
after_AnalysisAddRecord
(
globs
,
vars
,
code
,
gridID
,
zaxisID
,
levelID
,
nmiss
);
{
streamReadRecord
(
globs
->
istreamID
,
globs
->
Field
,
&
nmiss
);
after_AnalysisAddRecord
(
globs
,
vars
,
code
,
gridID
,
zaxisID
,
levelID
,
nmiss
);
}
else
after_EchamAddRecord
(
globs
,
vars
,
code
,
gridID
,
zaxisID
,
levelID
,
nmiss
);
{
double
*
dataptr
=
after_get_dataptr
(
vars
,
code
,
gridID
,
zaxisID
,
levelID
);
streamReadRecord
(
globs
->
istreamID
,
dataptr
,
&
nmiss
);
after_EchamAddRecord
(
globs
,
vars
,
code
,
gridID
,
zaxisID
,
levelID
,
nmiss
);
}
if
(
iVertID
!=
-
1
&&
oVertID
!=
-
1
&&
(
vars
[
code
].
izaxisID
==
iVertID
)
)
vars
[
code
].
ozaxisID
=
oVertID
;
...
...
src/afterburner.h
View file @
3432f15c
...
...
@@ -242,6 +242,7 @@ void after_processPL(struct Control *globs, struct Variable *vars);
void
after_processML
(
struct
Control
*
globs
,
struct
Variable
*
vars
);
void
after_AnalysisAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
);
double
*
after_get_dataptr
(
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
);
void
after_EchamAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
);
void
after_AnalysisDependencies
(
struct
Variable
*
vars
,
int
ncodes
);
...
...
src/afterburnerlib.cc
View file @
3432f15c
...
...
@@ -2477,28 +2477,48 @@ void after_AnalysisAddRecord(struct Control *globs, struct Variable *vars, int c
}
void
after_EchamAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
)
double
*
after_get_dataptr
(
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
)
{
int
dataSize
;
int
dataOffset
;
int
nlevel
;
int
gridSize
;
int
gridtype
,
level
type
;
int
gridtype
=
gridInqType
(
gridID
)
;
int
nlevel
=
zaxisInqSize
(
zaxisID
)
;
int
gridSize
=
gridInqSize
(
gridID
)
;
int
dataSize
=
gridSize
*
nlevel
;
int
dataOffset
=
gridSize
*
level
ID
;
gridtype
=
gridInqType
(
gridID
);
leveltype
=
zaxisInqType
(
zaxisID
);
nlevel
=
zaxisInqSize
(
zaxisID
);
gridSize
=
gridInqSize
(
gridID
);
dataSize
=
gridSize
*
nlevel
;
dataOffset
=
gridSize
*
levelID
;
double
*
dataptr
=
NULL
;
if
(
gridtype
==
GRID_SPECTRAL
)
{
if
(
vars
[
code
].
spectral0
==
NULL
)
vars
[
code
].
spectral0
=
alloc_dp
(
dataSize
,
FieldName
(
code
,
"spectral0"
));
dataptr
=
vars
[
code
].
spectral0
+
dataOffset
;
}
else
{
if
(
vars
[
code
].
hybrid0
==
NULL
)
vars
[
code
].
hybrid0
=
alloc_dp
(
dataSize
,
FieldName
(
code
,
"hybrid0"
));
dataptr
=
vars
[
code
].
hybrid0
+
dataOffset
;
}
return
dataptr
;
}
void
after_EchamAddRecord
(
struct
Control
*
globs
,
struct
Variable
*
vars
,
int
code
,
int
gridID
,
int
zaxisID
,
int
levelID
,
int
nmiss
)
{
int
gridtype
=
gridInqType
(
gridID
);
int
leveltype
=
zaxisInqType
(
zaxisID
);
int
nlevel
=
zaxisInqSize
(
zaxisID
);
int
gridSize
=
gridInqSize
(
gridID
);
int
dataSize
=
gridSize
*
nlevel
;
int
dataOffset
=
gridSize
*
levelID
;
vars
[
code
].
nmiss0
+=
nmiss
;
if
(
gridtype
==
GRID_SPECTRAL
)
{
/* ---------------------------------------------------------- */
/* Found spectral field ! If needed, allocate memory and copy */
/* ---------------------------------------------------------- */
vars
[
code
].
sfit
=
TRUE
;
vars
[
code
].
hlev
=
nlevel
;
vars
[
code
].
plev
=
1
;
...
...
@@ -2507,11 +2527,6 @@ void after_EchamAddRecord(struct Control *globs, struct Variable *vars, int code
if
(
gridInqTrunc
(
gridID
)
!=
globs
->
Truncation
)
Error
(
"Resolution error. Required %d - Found %d"
,
globs
->
Truncation
,
gridInqTrunc
(
gridID
));
if
(
vars
[
code
].
spectral0
==
NULL
)
vars
[
code
].
spectral0
=
alloc_dp
(
dataSize
,
FieldName
(
code
,
"spectral0"
));
after_copy_array
(
vars
[
code
].
spectral0
+
dataOffset
,
globs
->
Field
,
gridSize
);
}
else
{
...
...
@@ -2533,14 +2548,10 @@ void after_EchamAddRecord(struct Control *globs, struct Variable *vars, int code
for
(
i
=
0
;
i
<
dataSize
;
i
++
)
vars
[
code
].
samp
[
i
]
=
globs
->
MeanCount0
;
}
double
*
dataptr
=
vars
[
code
].
hybrid0
+
dataOffset
;
for
(
i
=
0
;
i
<
gridSize
;
i
++
)
if
(
IS_NOT_EQUAL
(
globs
->
Field
[
i
],
vars
[
code
].
missval
)
)
vars
[
code
].
samp
[
i
+
dataOffset
]
++
;
if
(
IS_NOT_EQUAL
(
dataptr
[
i
],
vars
[
code
].
missval
)
)
vars
[
code
].
samp
[
i
+
dataOffset
]
++
;
}
if
(
vars
[
code
].
hybrid0
==
NULL
)
vars
[
code
].
hybrid0
=
alloc_dp
(
dataSize
,
FieldName
(
code
,
"hybrid0"
));
after_copy_array
(
vars
[
code
].
hybrid0
+
dataOffset
,
globs
->
Field
,
gridSize
);
}
}
...
...
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