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
7ae1a0af
Commit
7ae1a0af
authored
1 month ago
by
Moritz Hanke
Browse files
Options
Downloads
Patches
Plain Diff
refactoring of test_def_points.inc
parent
632d39c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/mci/test_def_points.inc
+54
-64
54 additions, 64 deletions
tests/mci/test_def_points.inc
with
54 additions
and
64 deletions
tests/mci/test_def_points.inc
+
54
−
64
View file @
7ae1a0af
...
...
@@ -19,96 +19,86 @@ program test_def_points
INTEGER
,
PARAMETER
::
dp
=
SELECTED_REAL_KIND
(
15
,
307
)
!<
double
precision
INTEGER
,
PARAMETER
::
wp
=
TEST_PRECISION
!<
selected
working
precision
REAL
(
wp
),
PARAMETER
::
YAC_RAD
=
0.017453292519943295769_
wp
!
M_PI
/
180
integer
::
comp_id
integer
::
grid_id
integer
::
point_id
integer
::
location
integer
,
parameter
::
nbr_points
=
2
integer
,
parameter
::
nbr_vertices
=
6
integer
,
parameter
::
nbr_cells
=
2
integer
,
parameter
::
nbr_vertices_per_cell
=
4
integer
::
cell_to_vertex
(
nbr_vertices_per_cell
,
nbr_cells
)
integer
,
parameter
::
nbr_vertices
(
2
)
=
(
/
3
,
3
/
)
integer
,
parameter
::
nbr_cells
(
2
)
=
(
/
2
,
2
/
)
integer
,
parameter
::
cyclic
(
2
)
=
(
/
0
,
0
/
)
real
(
wp
)
::
x_vertices
(
nbr_vertices
)
real
(
wp
)
::
y_vertices
(
nbr_vertices
)
real
(
wp
)
,
parameter
::
x_vertices
(
3
)
=
real
((
/-
1.0
,
0.0
,
1.0
/
),
wp
)
*
YAC_RAD
real
(
wp
)
,
parameter
::
y_vertices
(
3
)
=
real
((
/-
1.0
,
0.0
,
1.0
/
),
wp
)
*
YAC_RAD
real
(
wp
)
::
x_points
(
nbr_points
)
real
(
wp
)
::
y_points
(
nbr_points
)
real
(
wp
)
,
parameter
::
x_cells
(
2
)
=
real
((
/-
0.5
,
0.5
/
),
wp
)
*
YAC_RAD
real
(
wp
)
,
parameter
::
y_cells
(
2
)
=
real
((
/-
0.5
,
0.5
/
),
wp
)
*
YAC_RAD
call
yac_finit
(
)
!
set
up
dummy
component
call
yac_fdef_comp
(
"
ICON-ocean
"
,
comp_id
)
call
yac_fdef_comp
(
"
dummy-comp
"
,
comp_id
)
print
*
,
' def_comp returned comp_id '
,
comp_id
call
test
(
comp_id
/=
-
99
)
!
uniform
unstructured
grid
!
1
-------
2
!
|
|
!
|
1
|
!
|
|
!
3
-------
4
!
|
|
!
|
2
|
!
|
|
!
5
-------
6
x_vertices
(
1
)
=
-
0.5
;
y_vertices
(
1
)
=
1.0
x_vertices
(
2
)
=
0.5
;
y_vertices
(
2
)
=
1.0
x_vertices
(
3
)
=
-
0.5
;
y_vertices
(
3
)
=
0.0
x_vertices
(
4
)
=
0.5
;
y_vertices
(
4
)
=
0.0
x_vertices
(
5
)
=
-
0.5
;
y_vertices
(
5
)
=
-
1.0
x_vertices
(
6
)
=
0.5
;
y_vertices
(
6
)
=
-
1.0
cell_to_vertex
(
1
,
1
)
=
1
cell_to_vertex
(
2
,
1
)
=
3
cell_to_vertex
(
3
,
1
)
=
4
cell_to_vertex
(
4
,
1
)
=
2
cell_to_vertex
(
1
,
2
)
=
3
cell_to_vertex
(
2
,
2
)
=
5
cell_to_vertex
(
3
,
2
)
=
6
cell_to_vertex
(
4
,
2
)
=
4
!
regular
2
d
grid
!
7
-------
8
-------
9
!
|
|
|
!
|
3
|
4
|
!
|
|
|
!
4
-------
5
-------
6
!
|
|
|
!
|
1
|
2
|
!
|
|
|
!
1
-------
2
-------
3
grid_id
=
-
99
call
yac_fdef_grid
(
'grid1'
,
&
nbr_vertices
,
&
nbr_cells
,
&
nbr_vertices_per_cell
,
&
x_vertices
,
&
y_vertices
,
&
cell_to_vertex
,
&
call
yac_fdef_grid
(
'reg2d_grid'
,
&
nbr_vertices
,
&
cyclic
,
&
x_vertices
,
&
y_vertices
,
&
grid_id
)
print
*
,
' def_grid returned grid_id '
,
grid_id
call
test
(
grid_id
/=
-
99
)
call
test
(
grid_id
/=
-
99
)
call
test
(
yac_fget_grid_size
(
yac_location_cell
,
grid_id
)
==
4
)
call
test
(
yac_fget_grid_size
(
yac_location_corner
,
grid_id
)
==
9
)
call
test
(
yac_fget_grid_size
(
yac_location_edge
,
grid_id
)
==
12
)
call
start_test
(
"def_points"
)
location
=
YAC_LOCATION_CELL
!
one
point
per
cell
x_points
(
1
)
=
0.0
y_points
(
1
)
=
0.5
x_points
(
2
)
=
0.0
y_points
(
2
)
=
-
0.5
point_id
=
-
99
call
yac_fdef_points
(
grid_id
,
&
nbr_points
,
&
location
,
&
x_points
,
&
y_points
,
&
!
regular
2
d
points
call
yac_fdef_points
(
grid_id
,
&
nbr_vertices
,
&
yac_location_corner
,
&
x_vertices
,
&
y_vertices
,
&
point_id
)
print
*
,
' def_points returned point_id '
,
point_id
call
test
(
point_id
/=
-
99
)
call
test
(
point_id
/=
-
99
)
call
test
(
yac_fget_points_size
(
point_id
)
==
product
(
nbr_vertices
))
!
uniform
unstructed
2
d
points
call
yac_fdef_points
(
grid_id
,
&
nbr_cells
,
&
yac_location_cell
,
&
reshape
(
&
(
/-
0.5_
wp
,
0.5_
wp
,
-
0.5_
wp
,
0.5_
wp
/
),
&
nbr_cells
),
&
reshape
(
&
(
/-
0.5_
wp
,
-
0.5_
wp
,
0.5_
wp
,
0.5_
wp
/
),
&
nbr_cells
),
point_id
)
call
test
(
point_id
/=
-
99
)
call
test
(
yac_fget_points_size
(
point_id
)
==
product
(
nbr_cells
))
call
test
(
2
==
yac_fget_points_size
(
point_id
))
call
yac_ffinalize
(
)
...
...
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