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
cdo
Commits
d0369052
Commit
d0369052
authored
Apr 16, 2014
by
Uwe Schulzweida
Browse files
seltimestep: add support for negative timesteps [patch from: Etienne Tourigny]
parent
49e273d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
d0369052
...
...
@@ -3,6 +3,10 @@
* using CDI library version 1.6.4
* Version 1.6.4 released
2014-04-15 Uwe Schulzweida
* seltimestep: add support for negative timesteps [patch from: Etienne Tourigny]
2014-04-14 Uwe Schulzweida
* New operator: sealevelpressure - sea level pressure
...
...
src/Seltime.c
View file @
d0369052
...
...
@@ -211,7 +211,7 @@ void *Seltime(void *argument)
LIST
*
ilist
=
listNew
(
INT_LIST
);
LIST
*
flist
=
listNew
(
FLT_LIST
);
int
gridID
;
int
nvars
,
nlevel
;
int
nvars
,
nlevel
,
ntsteps
;
int
nconst
,
lconstout
=
FALSE
;
int
process_nts1
=
FALSE
,
process_nts2
=
FALSE
;
int
*
vdate_list
=
NULL
,
*
vtime_list
=
NULL
;
...
...
@@ -305,15 +305,6 @@ void *Seltime(void *argument)
for
(
i
=
0
;
i
<
nsel
;
i
++
)
selfound
[
i
]
=
FALSE
;
}
if
(
cdoVerbose
)
{
for
(
i
=
0
;
i
<
nsel
;
i
++
)
if
(
operatorID
==
SELDATE
)
cdoPrint
(
"fltarr entry: %d %14.4f"
,
i
+
1
,
fltarr
[
i
]);
else
cdoPrint
(
"intarr entry: %d %d"
,
i
+
1
,
intarr
[
i
]);
}
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
vlistID1
=
streamInqVlist
(
streamID1
);
...
...
@@ -333,6 +324,31 @@ void *Seltime(void *argument)
array
=
(
double
*
)
malloc
(
gridsize
*
sizeof
(
double
));
}
ntsteps
=
vlistNtsteps
(
vlistID1
);
/* add support for negative timestep values */
if
(
operatorID
==
SELTIMESTEP
&&
ntsteps
>
0
)
{
for
(
i
=
0
;
i
<
nsel
;
i
++
)
{
if
(
intarr
[
i
]
<
0
)
{
if
(
cdoVerbose
)
cdoPrint
(
"timestep %d changed to %d"
,
intarr
[
i
],
ntsteps
+
1
+
intarr
[
i
]);
intarr
[
i
]
=
ntsteps
+
1
+
intarr
[
i
];
}
}
}
if
(
cdoVerbose
)
{
for
(
i
=
0
;
i
<
nsel
;
i
++
)
if
(
operatorID
==
SELDATE
)
cdoPrint
(
"fltarr entry: %d %14.4f"
,
i
+
1
,
fltarr
[
i
]);
else
cdoPrint
(
"intarr entry: %d %d"
,
i
+
1
,
intarr
[
i
]);
}
nvars
=
vlistNvars
(
vlistID1
);
nconst
=
0
;
for
(
varID
=
0
;
varID
<
nvars
;
varID
++
)
...
...
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