Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dkrz-sw
YAC
Commits
49278381
Commit
49278381
authored
2 months ago
by
Moritz Hanke
Browse files
Options
Downloads
Patches
Plain Diff
small refactoring of routine lat_edge_correction
parent
e8019582
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/core/area.c
+6
-9
6 additions, 9 deletions
src/core/area.c
with
6 additions
and
9 deletions
src/core/area.c
+
6
−
9
View file @
49278381
...
...
@@ -269,6 +269,8 @@ static double lat_edge_correction(
// --> their sign indicates the ordering of vertices
double
scalar_base
=
scalar_product
(
norm_ab
,
base_vec
);
int
negative_correction_flag
;
// if the base point is on the same plane as a and b
if
(
fabs
(
scalar_base
)
<
1e-11
)
{
...
...
@@ -280,22 +282,17 @@ static double lat_edge_correction(
if
(
compute_norm_vector
(
middle_lat
,
pole
,
norm_middle
))
return
0
.
0
;
double
scalar_a
=
scalar_product
(
norm_middle
,
a
);
if
(
scalar_a
>
0
)
return
correction
;
else
return
-
correction
;
negative_correction_flag
=
scalar_a
<=
0
;
}
else
{
// compute the cosine between the edge norm vector and the lat edge middle
// point
double
scalar_middle_lat
=
scalar_product
(
norm_ab
,
middle_lat
);
if
(
scalar_middle_lat
<
0
)
return
correction
;
else
return
-
correction
;
negative_correction_flag
=
scalar_middle_lat
>=
0
;
}
return
negative_correction_flag
?-
correction
:
correction
;
}
double
yac_pole_area
(
struct
yac_grid_cell
cell
)
{
...
...
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