Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
3e67e6f4
Commit
3e67e6f4
authored
Jan 12, 2018
by
Uwe Schulzweida
Browse files
Removed function expand_lonlat_grid().
parent
fd3419ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Remap.cc
View file @
3e67e6f4
...
...
@@ -1063,8 +1063,7 @@ void *Remap(void *argument)
if
(
gridInqType
(
gridID1
)
==
GRID_GME
)
{
size_t
j
=
0
;
for
(
size_t
i
=
0
;
i
<
gridsize
;
i
++
)
for
(
size_t
i
=
0
,
j
=
0
;
i
<
gridsize
;
i
++
)
if
(
remaps
[
r
].
src_grid
.
vgpm
[
i
]
)
imask
[
j
++
]
=
imask
[
i
];
}
...
...
src/remaplib.cc
View file @
3e67e6f4
...
...
@@ -410,52 +410,12 @@ void check_lat_boundbox_range(size_t nlats, restr_t *restrict bound_box, double
}
}
static
int
expand_lonlat_grid
(
int
gridID
)
{
if
(
cdoVerbose
)
cdoPrint
(
"expand_lonlat_grid"
);
size_t
nx
=
gridInqXsize
(
gridID
);
size_t
ny
=
gridInqYsize
(
gridID
);
size_t
nxp4
=
nx
+
4
;
size_t
nyp4
=
ny
+
4
;
double
*
xvals
=
(
double
*
)
Malloc
(
nxp4
*
sizeof
(
double
));
double
*
yvals
=
(
double
*
)
Malloc
(
nyp4
*
sizeof
(
double
));
gridInqXvals
(
gridID
,
xvals
+
2
);
gridInqYvals
(
gridID
,
yvals
+
2
);
int
gridtype
=
gridInqType
(
gridID
);
int
gridIDnew
=
gridCreate
(
gridtype
,
nxp4
*
nyp4
);
gridDefXsize
(
gridIDnew
,
nxp4
);
gridDefYsize
(
gridIDnew
,
nyp4
);
grid_copy_attributes
(
gridID
,
gridIDnew
);
xvals
[
0
]
=
xvals
[
2
]
-
2
*
gridInqXinc
(
gridID
);
xvals
[
1
]
=
xvals
[
2
]
-
gridInqXinc
(
gridID
);
xvals
[
nxp4
-
2
]
=
xvals
[
nx
+
1
]
+
gridInqXinc
(
gridID
);
xvals
[
nxp4
-
1
]
=
xvals
[
nx
+
1
]
+
2
*
gridInqXinc
(
gridID
);
yvals
[
0
]
=
yvals
[
2
]
-
2
*
gridInqYinc
(
gridID
);
yvals
[
1
]
=
yvals
[
2
]
-
gridInqYinc
(
gridID
);
yvals
[
nyp4
-
2
]
=
yvals
[
ny
+
1
]
+
gridInqYinc
(
gridID
);
yvals
[
nyp4
-
1
]
=
yvals
[
ny
+
1
]
+
2
*
gridInqYinc
(
gridID
);
gridDefXvals
(
gridIDnew
,
xvals
);
gridDefYvals
(
gridIDnew
,
yvals
);
Free
(
xvals
);
Free
(
yvals
);
return
gridIDnew
;
}
/*****************************************************************************/
static
void
grid_check_lat_borders_rad
(
size_t
n
,
double
*
ybounds
)
{
#define
YLIM
(
88*DEG2RAD
)
constexpr
double
YLIM
=
88
*
DEG2RAD
;
if
(
ybounds
[
0
]
>
ybounds
[
n
-
1
]
)
{
if
(
ybounds
[
0
]
>
YLIM
)
ybounds
[
0
]
=
PIH
;
...
...
@@ -731,7 +691,7 @@ void remap_grids_init(RemapType mapType, bool lextrapolate, int gridID1, remapgr
if
(
tgt_grid
->
remap_grid_type
!=
REMAP_GRID_TYPE_REG2D
)
{
tgt_grid
->
luse_cell_corners
=
true
;
tgt_grid
->
luse_cell_corners
=
true
;
tgt_grid
->
lneed_cell_corners
=
true
;
}
}
...
...
@@ -739,14 +699,6 @@ void remap_grids_init(RemapType mapType, bool lextrapolate, int gridID1, remapgr
src_grid
->
gridID
=
gridID1
;
tgt_grid
->
gridID
=
gridID2
;
if
(
!
src_grid
->
lextrapolate
&&
gridInqSize
(
src_grid
->
gridID
)
>
1
&&
mapType
==
RemapType
::
DISTWGT
&&
(
gridInqType
(
gridID1
)
==
GRID_LONLAT
&&
src_grid
->
non_global
)
)
{
src_grid
->
gridID
=
gridID1
=
expand_lonlat_grid
(
gridID1
);
reg2d_src_gridID
=
gridID1
;
}
if
(
gridInqType
(
gridID1
)
==
GRID_UNSTRUCTURED
)
{
if
(
gridInqYvals
(
gridID1
,
NULL
)
==
0
||
gridInqXvals
(
gridID1
,
NULL
)
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment