Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
8a426006
Commit
8a426006
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Verifygrid: add healpix support
parent
134d3fba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Verifygrid.cc
+19
-5
19 additions, 5 deletions
src/Verifygrid.cc
with
19 additions
and
5 deletions
src/Verifygrid.cc
+
19
−
5
View file @
8a426006
...
...
@@ -247,7 +247,10 @@ is_simple_polygon_convex(const Varray<Point> &cellCorners, int numCorners)
{
if
(
IS_NOT_EQUAL
(
direction
,
0.0
))
return
false
;
}
else
{
direction
=
turnsTo
;
}
else
{
direction
=
turnsTo
;
}
}
return
true
;
...
...
@@ -365,7 +368,10 @@ get_no_unique_center_points(size_t gridsize, size_t nx, const Varray<double> &gr
fprintf
(
stdout
,
"
\n
"
);
}
}
else
{
no_unique_center_points
++
;
}
else
{
no_unique_center_points
++
;
}
}
return
no_unique_center_points
;
...
...
@@ -695,7 +701,10 @@ verify_grid(size_t gridsize, size_t nx, int ncorner, const Varray<double> &grid_
fprintf
(
stdout
,
"
\n
"
);
}
}
else
{
no_counterclockwise_cells
++
;
}
else
{
no_counterclockwise_cells
++
;
}
// The winding numbers algorithm is used to test whether the presumed center point is within the bounds of the cell.
auto
windingNumber
=
winding_numbers_algorithm
(
cellCornersPlaneProjection
,
actualNumberOfCorners
+
1
,
centerPoint2D
);
...
...
@@ -793,8 +802,10 @@ Verifygrid(void *argument)
auto
gridID
=
vlistGrid
(
vlistID
,
gridno
);
auto
gridtype
=
gridInqType
(
gridID
);
auto
isHealpixGrid
=
(
gridtype
==
GRID_PROJECTION
&&
gridInqProjType
(
gridID
)
==
CDI_PROJ_HEALPIX
);
if
(
gridtype
==
GRID_GENERIC
||
gridtype
==
GRID_SPECTRAL
)
lgeo
=
false
;
if
(
isHealpixGrid
)
lgeo
=
false
;
if
(
gridtype
==
GRID_GME
)
gridID
=
gridToUnstructured
(
gridID
,
1
);
...
...
@@ -847,7 +858,10 @@ Verifygrid(void *argument)
verify_grid
(
gridsize
,
nx
,
ncorner
,
grid_center_lon
,
grid_center_lat
,
grid_corner_lon
,
grid_corner_lat
);
}
else
{
cdo_warning
(
"Grid cell corner coordinates missing!"
);
}
else
{
cdo_warning
(
"Grid cell corner coordinates missing!"
);
}
int
dig
=
Options
::
CDO_flt_digits
;
print_lonlat
(
dig
,
gridID
,
gridsize
,
grid_center_lon
,
grid_center_lat
);
...
...
@@ -855,7 +869,7 @@ Verifygrid(void *argument)
else
{
if
(
ngrids
==
1
)
cdo_print
(
Blue
(
"Grid consists of %zu points (type: %s)"
),
gridsize
,
gridNamePtr
(
gridtype
));
cdo_print
(
Blue
(
"Grid consists of %zu points (type: %s)"
),
gridsize
,
isHealpixGrid
?
"healpix"
:
gridNamePtr
(
gridtype
));
else
cdo_print
(
Blue
(
"Grid no %u (of %u) consists of %zu points (type: %s)"
),
gridno
+
1
,
ngrids
,
gridsize
,
gridNamePtr
(
gridtype
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment