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
abdf4da2
Commit
abdf4da2
authored
Nov 14, 2017
by
Uwe Schulzweida
Browse files
Changed type of gridsize to size_t.
parent
421a43e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Rotuv.cc
View file @
abdf4da2
...
...
@@ -36,8 +36,8 @@ void rot_uv_back(int gridID, double *us, double *vs)
if
(
gridInqType
(
gridID
)
==
GRID_PROJECTION
&&
gridInqProjType
(
gridID
)
==
CDI_PROJ_RLL
)
gridInqParamRLL
(
gridID
,
&
xpole
,
&
ypole
,
&
angle
);
long
nlon
=
gridInqXsize
(
gridID
);
long
nlat
=
gridInqYsize
(
gridID
);
size_t
nlon
=
gridInqXsize
(
gridID
);
size_t
nlat
=
gridInqYsize
(
gridID
);
double
*
xvals
=
(
double
*
)
Malloc
(
nlon
*
sizeof
(
double
));
double
*
yvals
=
(
double
*
)
Malloc
(
nlat
*
sizeof
(
double
));
...
...
@@ -54,10 +54,10 @@ void rot_uv_back(int gridID, double *us, double *vs)
grid_to_degree
(
units
,
nlat
,
yvals
,
"grid center lat"
);
double
u
,
v
;
for
(
long
ilat
=
0
;
ilat
<
nlat
;
ilat
++
)
for
(
long
ilon
=
0
;
ilon
<
nlon
;
ilon
++
)
for
(
size_t
ilat
=
0
;
ilat
<
nlat
;
ilat
++
)
for
(
size_t
ilon
=
0
;
ilon
<
nlon
;
ilon
++
)
{
long
i
=
ilat
*
nlon
+
ilon
;
size_t
i
=
ilat
*
nlon
+
ilon
;
double
xval
=
lamrot_to_lam
(
yvals
[
ilat
],
xvals
[
ilon
],
ypole
,
xpole
,
angle
);
double
yval
=
phirot_to_phi
(
yvals
[
ilat
],
xvals
[
ilon
],
ypole
,
angle
);
...
...
@@ -78,9 +78,8 @@ void *Rotuv(void *argument)
{
int
varID
,
levelID
;
int
varID1
,
varID2
,
nlevel1
,
nlevel2
;
in
t
gridsize
;
size_
t
gridsize
;
int
code
,
gridID
;
int
offset
;
int
nlevel
;
int
chcodes
[
MAXARG
];
char
*
chvars
[
MAXARG
];
...
...
@@ -189,7 +188,7 @@ void *Rotuv(void *argument)
recLevelID
[
recID
]
=
levelID
;
gridsize
=
gridInqSize
(
vlistInqVarGrid
(
vlistID1
,
varID
));
offset
=
gridsize
*
levelID
;
size_t
offset
=
gridsize
*
levelID
;
single
=
vardata
[
varID
]
+
offset
;
pstreamReadRecord
(
streamID1
,
single
,
&
varnmiss
[
varID
][
levelID
]);
if
(
varnmiss
[
varID
][
levelID
]
)
...
...
@@ -266,7 +265,7 @@ void *Rotuv(void *argument)
for
(
levelID
=
0
;
levelID
<
nlevel1
;
levelID
++
)
{
offset
=
gridsize
*
levelID
;
size_t
offset
=
gridsize
*
levelID
;
rot_uv_back
(
gridID
,
usvar
+
offset
,
vsvar
+
offset
);
}
}
...
...
@@ -276,7 +275,7 @@ void *Rotuv(void *argument)
varID
=
recVarID
[
recID
];
levelID
=
recLevelID
[
recID
];
gridsize
=
gridInqSize
(
vlistInqVarGrid
(
vlistID1
,
varID
));
offset
=
gridsize
*
levelID
;
size_t
offset
=
gridsize
*
levelID
;
single
=
vardata
[
varID
]
+
offset
;
pstreamDefRecord
(
streamID2
,
varID
,
levelID
);
...
...
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