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
4a3554a1
Commit
4a3554a1
authored
2 years ago
by
Volker Neff
Browse files
Options
Downloads
Patches
Plain Diff
update to new field
parent
17b62cc1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Draft: [WIP] New Field Architekture
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/remap_distwgt.cc
+16
-11
16 additions, 11 deletions
src/remap_distwgt.cc
with
16 additions
and
11 deletions
src/remap_distwgt.cc
+
16
−
11
View file @
4a3554a1
...
...
@@ -147,26 +147,26 @@ remap_dist_wgt(size_t numNeighbors, RemapSearch &rsearch, const Varray<T> &srcAr
void
remap_dist_wgt
(
size_t
numNeighbors
,
RemapSearch
&
rsearch
,
const
Field_t
&
field1
,
Field_t
&
field2
)
{
if
(
field1
.
memType
!=
field2
.
memType
)
cdo_abort
(
"Interal error, memType of field1 and field2 differ!"
);
if
(
field1
.
memType
==
MemType
::
Float
)
remap_dist_wgt
(
numNeighbors
,
rsearch
,
field1
.
vec_f
,
field2
.
vec_f
,
(
float
)
field1
.
missval
);
else
remap_dist_wgt
(
numNeighbors
,
rsearch
,
field1
.
vec_d
,
field2
.
vec_d
,
field1
.
missval
);
const
auto
func
=
[](
LambdaField_T_
field1
,
LambdaField_T_
field2
,
size_t
numNeighbors
,
RemapSearch
&
rsearch
)
{
remap_dist_wgt
(
numNeighbors
,
rsearch
,
field1
.
vec
,
field2
.
vec
,
field1
.
getMissValue
());
};
field_operation2
(
func
,
field1
,
field2
,
numNeighbors
,
rsearch
);
}
void
remapInit
(
RemapType
&
remap
);
template
<
typename
T
>
void
intgriddis
(
Field
_t
&
field1
,
Field
_t
&
field2
,
size_t
numNeighbors
)
intgriddis
(
Field
<
T
>
&
field1
,
Field
<
T
>
&
field2
,
size_t
numNeighbors
)
{
auto
mapType
=
RemapMethod
::
DISTWGT
;
auto
gridID1
=
field1
.
grid
;
auto
gridID2
=
field2
.
grid
;
auto
src_missval
=
field1
.
m
iss
v
al
;
auto
tgt_missval
=
field2
.
m
iss
v
al
;
auto
srcArray
=
field1
.
vec
_d
.
data
();
auto
tgtArray
=
field2
.
vec
_d
.
data
();
auto
src_missval
=
field1
.
getM
iss
V
al
ue
()
;
auto
tgt_missval
=
field2
.
getM
iss
V
al
ue
()
;
auto
srcArray
=
field1
.
vec
.
data
();
auto
tgtArray
=
field2
.
vec
.
data
();
if
(
Options
::
cdoVerbose
)
cdo_print
(
"Called %s()"
,
__func__
);
...
...
@@ -234,6 +234,11 @@ intgriddis(Field_t &field1, Field_t &field2, size_t numNeighbors)
if
(
Options
::
cdoVerbose
)
cdo_print
(
"Point search nearest: %.2f seconds"
,
cdo_get_wtime
()
-
start
);
}
// intgriddis
void
intgriddis
(
Field_t
&
field1
,
Field_t
&
field2
,
size_t
numNeighbors
)
{
field_operation2
(
&
intgriddis
<
float
>
,
&
intgriddis
<
double
>
,
field1
,
field2
,
numNeighbors
);
}
void
intgridnn
(
Field_t
&
field1
,
Field_t
&
field2
)
{
...
...
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