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
e640e510
Commit
e640e510
authored
8 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
collgrid: added support for 1x1 generic grids.
parent
d3f8822d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Collgrid.c
+9
-7
9 additions, 7 deletions
src/Collgrid.c
with
9 additions
and
7 deletions
src/Collgrid.c
+
9
−
7
View file @
e640e510
...
...
@@ -83,7 +83,7 @@ int cmpxy_gt(const void *s1, const void *s2)
}
static
int
genGrid
(
int
nfiles
,
ens_file_t
*
ef
,
bool
ginit
,
int
igrid
,
int
nxblocks
)
int
genGrid
(
int
ngrids
,
int
nfiles
,
ens_file_t
*
ef
,
bool
ginit
,
int
igrid
,
int
nxblocks
)
{
bool
lsouthnorth
=
true
;
bool
lregular
=
false
;
...
...
@@ -96,7 +96,7 @@ int genGrid(int nfiles, ens_file_t *ef, bool ginit, int igrid, int nxblocks)
int
gridID
=
vlistGrid
(
ef
[
0
].
vlistID
,
igrid
);
int
gridtype
=
gridInqType
(
gridID
);
if
(
gridtype
==
GRID_GENERIC
&&
gridInqXsize
(
gridID
)
==
0
&&
gridInqYsize
(
gridID
)
==
0
)
if
(
ngrids
>
1
&&
gridtype
==
GRID_GENERIC
&&
gridInqXsize
(
gridID
)
==
0
&&
gridInqYsize
(
gridID
)
==
0
)
return
gridID2
;
int
*
xsize
=
(
int
*
)
Malloc
(
nfiles
*
sizeof
(
int
));
...
...
@@ -113,13 +113,15 @@ int genGrid(int nfiles, ens_file_t *ef, bool ginit, int igrid, int nxblocks)
lregular
=
true
;
else
if
(
gridtype
==
GRID_CURVILINEAR
)
lcurvilinear
=
true
;
else
if
(
gridtype
==
GRID_GENERIC
&&
gridInqXsize
(
gridID
)
>
0
&&
gridInqYsize
(
gridID
)
>
0
)
else
if
(
gridtype
==
GRID_GENERIC
/*
&& gridInqXsize(gridID) > 0 && gridInqYsize(gridID) > 0
*/
)
;
else
cdoAbort
(
"Unsupported grid type: %s!"
,
gridNamePtr
(
gridtype
));
xsize
[
fileID
]
=
gridInqXsize
(
gridID
);
ysize
[
fileID
]
=
gridInqYsize
(
gridID
);
if
(
xsize
[
fileID
]
==
0
)
xsize
[
fileID
]
=
1
;
if
(
ysize
[
fileID
]
==
0
)
ysize
[
fileID
]
=
1
;
if
(
lregular
)
{
...
...
@@ -330,9 +332,9 @@ void *Collgrid(void *argument)
vlistCompare
(
vlistID1
,
ef
[
fileID
].
vlistID
,
CMP_NAME
|
CMP_NLEVEL
);
int
nvars
=
vlistNvars
(
vlistID1
);
bool
*
vars
=
(
bool
*
)
Malloc
(
nvars
*
sizeof
(
bool
));
bool
*
vars
=
(
bool
*
)
Malloc
(
nvars
*
sizeof
(
bool
));
for
(
varID
=
0
;
varID
<
nvars
;
varID
++
)
vars
[
varID
]
=
false
;
bool
*
vars1
=
(
bool
*
)
Malloc
(
nvars
*
sizeof
(
bool
));
bool
*
vars1
=
(
bool
*
)
Malloc
(
nvars
*
sizeof
(
bool
));
for
(
varID
=
0
;
varID
<
nvars
;
varID
++
)
vars1
[
varID
]
=
false
;
int
nsel
=
operatorArgc
();
...
...
@@ -437,11 +439,11 @@ void *Collgrid(void *argument)
if
(
!
ginit
)
{
gridIDs
[
i2
]
=
genGrid
(
nfiles
,
ef
,
ginit
,
i1
,
nxblocks
);
gridIDs
[
i2
]
=
genGrid
(
ngrids2
,
nfiles
,
ef
,
ginit
,
i1
,
nxblocks
);
if
(
gridIDs
[
i2
]
!=
-
1
)
ginit
=
true
;
}
else
gridIDs
[
i2
]
=
genGrid
(
nfiles
,
ef
,
ginit
,
i1
,
nxblocks
);
gridIDs
[
i2
]
=
genGrid
(
ngrids2
,
nfiles
,
ef
,
ginit
,
i1
,
nxblocks
);
}
...
...
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