Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
3fe8560c
Commit
3fe8560c
authored
Apr 29, 2019
by
Uwe Schulzweida
Browse files
GRID_GAUSSIAN_REDUCED: added support for xvals.
parent
14e0aa29
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
3fe8560c
...
@@ -1194,8 +1194,8 @@ void gridDefXsize(int gridID, size_t xsize)
...
@@ -1194,8 +1194,8 @@ void gridDefXsize(int gridID, size_t xsize)
Error
(
"xsize %zu is greater then gridsize %zu"
,
xsize
,
gridSize
);
Error
(
"xsize %zu is greater then gridsize %zu"
,
xsize
,
gridSize
);
const
int
gridType
=
gridInqType
(
gridID
);
const
int
gridType
=
gridInqType
(
gridID
);
if
(
gridType
==
GRID_UNSTRUCTURED
&&
xsize
!=
gridSize
)
if
(
(
gridType
==
GRID_UNSTRUCTURED
||
gridType
==
GRID_GAUSSIAN_REDUCED
)
&&
xsize
!=
gridSize
)
Error
(
"xsize %zu must be equal to gridsize %zu for gridtype:
UNSTRUCTURED"
,
xsize
,
gridSize
);
Error
(
"xsize %zu must be equal to gridsize %zu for gridtype:
%s"
,
gridNamePtr
(
gridType
)
,
xsize
,
gridSize
);
if
(
gridptr
->
x
.
size
!=
xsize
)
if
(
gridptr
->
x
.
size
!=
xsize
)
{
{
...
@@ -1203,7 +1203,7 @@ void gridDefXsize(int gridID, size_t xsize)
...
@@ -1203,7 +1203,7 @@ void gridDefXsize(int gridID, size_t xsize)
gridptr
->
x
.
size
=
xsize
;
gridptr
->
x
.
size
=
xsize
;
}
}
if
(
gridType
!=
GRID_UNSTRUCTURED
&&
gridType
!=
GRID_PROJECTION
)
if
(
gridType
!=
GRID_UNSTRUCTURED
&&
gridType
!=
GRID_GAUSSIAN_REDUCED
&&
gridType
!=
GRID_PROJECTION
)
{
{
const
size_t
axisproduct
=
gridptr
->
x
.
size
*
gridptr
->
y
.
size
;
const
size_t
axisproduct
=
gridptr
->
x
.
size
*
gridptr
->
y
.
size
;
if
(
axisproduct
>
0
&&
axisproduct
!=
gridSize
)
if
(
axisproduct
>
0
&&
axisproduct
!=
gridSize
)
...
@@ -1296,7 +1296,7 @@ void gridDefYsize(int gridID, size_t ysize)
...
@@ -1296,7 +1296,7 @@ void gridDefYsize(int gridID, size_t ysize)
const
int
gridType
=
gridInqType
(
gridID
);
const
int
gridType
=
gridInqType
(
gridID
);
if
(
gridType
==
GRID_UNSTRUCTURED
&&
ysize
!=
gridSize
)
if
(
gridType
==
GRID_UNSTRUCTURED
&&
ysize
!=
gridSize
)
Error
(
"ysize %zu must be equal gridsize %zu for gridtype:
UNSTRUCTURED"
,
ysize
,
gridSize
);
Error
(
"ysize %zu must be equal gridsize %zu for gridtype:
%s"
,
gridNamePtr
(
gridType
)
,
ysize
,
gridSize
);
if
(
gridptr
->
y
.
size
!=
ysize
)
if
(
gridptr
->
y
.
size
!=
ysize
)
{
{
...
@@ -1304,7 +1304,7 @@ void gridDefYsize(int gridID, size_t ysize)
...
@@ -1304,7 +1304,7 @@ void gridDefYsize(int gridID, size_t ysize)
gridptr
->
y
.
size
=
ysize
;
gridptr
->
y
.
size
=
ysize
;
}
}
if
(
gridType
!=
GRID_UNSTRUCTURED
&&
gridType
!=
GRID_PROJECTION
)
if
(
gridType
!=
GRID_UNSTRUCTURED
&&
gridType
!=
GRID_GAUSSIAN_REDUCED
&&
gridType
!=
GRID_PROJECTION
)
{
{
const
size_t
axisproduct
=
gridptr
->
x
.
size
*
gridptr
->
y
.
size
;
const
size_t
axisproduct
=
gridptr
->
x
.
size
*
gridptr
->
y
.
size
;
if
(
axisproduct
>
0
&&
axisproduct
!=
gridSize
)
if
(
axisproduct
>
0
&&
axisproduct
!=
gridSize
)
...
@@ -1531,8 +1531,6 @@ size_t gridInqXValsSerial(grid_t *gridptr, double *xvals)
...
@@ -1531,8 +1531,6 @@ size_t gridInqXValsSerial(grid_t *gridptr, double *xvals)
size_t
size
;
size_t
size
;
if
(
gridptr
->
type
==
GRID_CURVILINEAR
||
gridptr
->
type
==
GRID_UNSTRUCTURED
)
if
(
gridptr
->
type
==
GRID_CURVILINEAR
||
gridptr
->
type
==
GRID_UNSTRUCTURED
)
size
=
gridptr
->
size
;
size
=
gridptr
->
size
;
else
if
(
gridptr
->
type
==
GRID_GAUSSIAN_REDUCED
)
size
=
2
;
else
else
size
=
gridptr
->
x
.
size
;
size
=
gridptr
->
x
.
size
;
...
@@ -1559,8 +1557,6 @@ size_t gridInqXValsPartSerial(grid_t *gridptr, int start, size_t length, double
...
@@ -1559,8 +1557,6 @@ size_t gridInqXValsPartSerial(grid_t *gridptr, int start, size_t length, double
size_t
size
;
size_t
size
;
if
(
gridptr
->
type
==
GRID_CURVILINEAR
||
gridptr
->
type
==
GRID_UNSTRUCTURED
)
if
(
gridptr
->
type
==
GRID_CURVILINEAR
||
gridptr
->
type
==
GRID_UNSTRUCTURED
)
size
=
gridptr
->
size
;
size
=
gridptr
->
size
;
else
if
(
gridptr
->
type
==
GRID_GAUSSIAN_REDUCED
)
size
=
2
;
else
else
size
=
gridptr
->
x
.
size
;
size
=
gridptr
->
x
.
size
;
...
@@ -1676,8 +1672,6 @@ void gridDefXValsSerial(grid_t *gridptr, const double *xvals)
...
@@ -1676,8 +1672,6 @@ void gridDefXValsSerial(grid_t *gridptr, const double *xvals)
size_t
size
;
size_t
size
;
if
(
gridtype
==
GRID_UNSTRUCTURED
||
gridtype
==
GRID_CURVILINEAR
)
if
(
gridtype
==
GRID_UNSTRUCTURED
||
gridtype
==
GRID_CURVILINEAR
)
size
=
gridptr
->
size
;
size
=
gridptr
->
size
;
else
if
(
gridtype
==
GRID_GAUSSIAN_REDUCED
)
size
=
2
;
else
else
size
=
gridptr
->
x
.
size
;
size
=
gridptr
->
x
.
size
;
...
@@ -2724,6 +2718,7 @@ void gridComplete(grid_t *grid)
...
@@ -2724,6 +2718,7 @@ void gridComplete(grid_t *grid)
if
(
grid
->
x
.
flag
==
2
)
if
(
grid
->
x
.
flag
==
2
)
{
{
double
xvals
[
2
]
=
{
grid
->
x
.
first
,
grid
->
x
.
last
};
double
xvals
[
2
]
=
{
grid
->
x
.
first
,
grid
->
x
.
last
};
gridDefXsize
(
gridID
,
2
);
gridDefXvals
(
gridID
,
xvals
);
gridDefXvals
(
gridID
,
xvals
);
}
}
...
...
Write
Preview
Supports
Markdown
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