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
ff15af3b
Commit
ff15af3b
authored
3 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Rename dst to tgt.
parent
3052edc7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Runner for levante
Pipeline
#16414
passed
3 years ago
Stage: build
Stage: check
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/remap_search_latbins.cc
+7
-7
7 additions, 7 deletions
src/remap_search_latbins.cc
src/remap_search_reg2d.cc
+7
-7
7 additions, 7 deletions
src/remap_search_reg2d.cc
with
14 additions
and
14 deletions
src/remap_search_latbins.cc
+
7
−
7
View file @
ff15af3b
...
...
@@ -157,10 +157,10 @@ gridSearchSquareCurv2dNNScrip(size_t min_add, size_t max_add, size_t *nbr_add, d
{
int
search_result
=
0
;
const
double
coslat_ds
t
=
std
::
cos
(
plat
);
const
double
sinlat_ds
t
=
std
::
sin
(
plat
);
const
double
c
oslon
_dst
=
std
::
cos
(
plon
);
const
double
s
inlon
_dst
=
std
::
sin
(
plon
);
const
auto
tgtCosla
t
=
std
::
cos
(
plat
);
const
auto
tgtSinla
t
=
std
::
sin
(
plat
);
const
auto
tgtC
oslon
=
std
::
cos
(
plon
);
const
auto
tgtS
inlon
=
std
::
sin
(
plon
);
double
dist_min
=
DBL_MAX
;
for
(
unsigned
n
=
0
;
n
<
4
;
++
n
)
nbr_dist
[
n
]
=
DBL_MAX
;
...
...
@@ -168,9 +168,9 @@ gridSearchSquareCurv2dNNScrip(size_t min_add, size_t max_add, size_t *nbr_add, d
double
distance
;
for
(
size_t
srch_add
=
min_add
;
srch_add
<=
max_add
;
++
srch_add
)
{
distance
=
std
::
acos
(
coslat_ds
t
*
std
::
cos
(
src_center_lat
[
srch_add
])
*
(
c
oslon
_dst
*
std
::
cos
(
src_center_lon
[
srch_add
])
+
s
inlon
_dst
*
std
::
sin
(
src_center_lon
[
srch_add
]))
+
sinlat_ds
t
*
std
::
sin
(
src_center_lat
[
srch_add
]));
distance
=
std
::
acos
(
tgtCosla
t
*
std
::
cos
(
src_center_lat
[
srch_add
])
*
(
tgtC
oslon
*
std
::
cos
(
src_center_lon
[
srch_add
])
+
tgtS
inlon
*
std
::
sin
(
src_center_lon
[
srch_add
]))
+
tgtSinla
t
*
std
::
sin
(
src_center_lat
[
srch_add
]));
if
(
distance
<
dist_min
)
{
...
...
This diff is collapsed.
Click to expand it.
src/remap_search_reg2d.cc
+
7
−
7
View file @
ff15af3b
...
...
@@ -36,10 +36,10 @@ grid_search_square_reg_2d_NN(size_t nx, size_t ny, size_t *nbr_add, double *nbr_
{
int
search_result
=
0
;
const
auto
coslat_ds
t
=
std
::
cos
(
plat
);
const
auto
sinlat_ds
t
=
std
::
sin
(
plat
);
const
auto
c
oslon
_dst
=
std
::
cos
(
plon
);
const
auto
s
inlon
_dst
=
std
::
sin
(
plon
);
const
auto
tgtCosla
t
=
std
::
cos
(
plat
);
const
auto
tgtSinla
t
=
std
::
sin
(
plat
);
const
auto
tgtC
oslon
=
std
::
cos
(
plon
);
const
auto
tgtS
inlon
=
std
::
sin
(
plon
);
double
dist_min
=
DBL_MAX
;
for
(
unsigned
n
=
0
;
n
<
4
;
++
n
)
nbr_dist
[
n
]
=
DBL_MAX
;
...
...
@@ -66,12 +66,12 @@ grid_search_square_reg_2d_NN(size_t nx, size_t ny, size_t *nbr_add, double *nbr_
std
::
vector
<
double
>
sincoslon
(
nx
);
for
(
size_t
ii
=
0
;
ii
<
nx
;
++
ii
)
sincoslon
[
ii
]
=
c
oslon
_dst
*
std
::
cos
(
src_center_lon
[
ii
])
+
s
inlon
_dst
*
std
::
sin
(
src_center_lon
[
ii
]);
sincoslon
[
ii
]
=
tgtC
oslon
*
std
::
cos
(
src_center_lon
[
ii
])
+
tgtS
inlon
*
std
::
sin
(
src_center_lon
[
ii
]);
for
(
size_t
jj
=
jjf
;
jj
<=
jjl
;
++
jj
)
{
const
auto
coslat
=
coslat_ds
t
*
std
::
cos
(
src_center_lat
[
jj
]);
const
auto
sinlat
=
sinlat_ds
t
*
std
::
sin
(
src_center_lat
[
jj
]);
const
auto
coslat
=
tgtCosla
t
*
std
::
cos
(
src_center_lat
[
jj
]);
const
auto
sinlat
=
tgtSinla
t
*
std
::
sin
(
src_center_lat
[
jj
]);
const
auto
jjskip
=
(
jj
>
1
&&
jj
<
(
ny
-
2
));
...
...
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