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
e9e9f1c5
Commit
e9e9f1c5
authored
1 year ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
remove cdo_remap_conserv_test2
parent
a6a45ed6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!187
M214003/develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/yac/cdo_remap_conserv_test2.cc
+0
-75
0 additions, 75 deletions
src/lib/yac/cdo_remap_conserv_test2.cc
with
0 additions
and
75 deletions
src/lib/yac/cdo_remap_conserv_test2.cc
deleted
100644 → 0
+
0
−
75
View file @
a6a45ed6
/*
gcc -DYAC_FOR_CDO -Wall -g -O3 -c *.c
g++ -DYAC_FOR_CDO -Drestrict= -Wall -g -O3 *.cc *.o
*/
#include
"cdo_remap.h"
static
void
compute_testfield
(
Varray
<
double
>
&
array
,
const
Varray
<
double
>
&
cellCentersLon
,
const
Varray
<
double
>
&
cellCentersLat
)
{
double
xyz
[
3
];
const
auto
numCells
=
array
.
size
();
for
(
size_t
i
=
0
;
i
<
numCells
;
++
i
)
{
LL_to_XYZ
(
cellCentersLon
[
i
],
cellCentersLat
[
i
],
xyz
);
const
auto
x
=
xyz
[
0
];
const
auto
y
=
xyz
[
1
];
const
auto
z
=
xyz
[
2
];
array
[
i
]
=
1.0
+
std
::
pow
(
x
,
8.0
)
+
std
::
exp
(
2.0
*
y
*
y
*
y
)
+
std
::
exp
(
2.0
*
x
*
x
)
+
10.0
*
x
*
y
*
z
;
}
}
static
void
output_ext
(
const
Varray
<
double
>
&
array
)
{
const
auto
numCells
=
array
.
size
();
fprintf
(
stdout
,
"%8d %4d %8g %8zu
\n
"
,
010101
,
1
,
0.0
,
numCells
);
int
nout
=
0
;
for
(
size_t
i
=
0
;
i
<
numCells
;
i
++
)
{
if
(
nout
==
6
)
{
nout
=
0
;
fprintf
(
stdout
,
"
\n
"
);
}
fprintf
(
stdout
,
" %12.6g"
,
array
[
i
]);
nout
++
;
}
fprintf
(
stdout
,
"
\n
"
);
}
static
void
grid_init_regular
(
GridInfo
&
grid
,
double
increment
)
{
generate_grid_lonlat
(
grid
,
increment
,
-
180
,
180
,
-
90
,
90
);
}
int
main
(
void
)
{
const
double
missval
=
-
9.e33
;
RemapSearch
remapSearch
;
auto
&
srcGrid
=
remapSearch
.
srcGrid
;
auto
&
tgtGrid
=
remapSearch
.
tgtGrid
;
grid_init_regular
(
srcGrid
,
0.5
);
grid_init_regular
(
tgtGrid
,
2.5
);
Varray
<
double
>
srcArray
(
srcGrid
.
numCells
);
Varray
<
double
>
tgtArray
(
tgtGrid
.
numCells
);
compute_testfield
(
srcArray
,
srcGrid
.
cellCentersLon
,
srcGrid
.
cellCentersLat
);
gridcell_search_create
(
remapSearch
.
gcs
,
srcGrid
.
numCells
,
srcGrid
.
numCorners
,
srcGrid
.
cellCornersLon
,
srcGrid
.
cellCornersLat
);
remap_conserv
(
NormOpt
::
FRACAREA
,
remapSearch
,
srcArray
,
tgtArray
,
missval
);
// output_ext(srcArray);
// output_ext(tgtArray);
gridcell_search_delete
(
remapSearch
.
gcs
);
return
0
;
}
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