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
libcdi
Commits
c496cb78
Commit
c496cb78
authored
Mar 16, 2017
by
Uwe Schulzweida
Browse files
Added function streamGrbChangeModeUvRelativeToGrid().
parent
b49bbfff
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
c496cb78
...
...
@@ -1831,6 +1831,18 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
break
;
}
}
if
(
cdiGribChangeModeUvRelativeToGrid
.
active
)
{
// this will overrule/change the UvRelativeToGrid flag;
// typically when the wind is rotated with respect to north pole
bool
uvRelativeToGrid
=
bit_get
(
ISEC2_ResFlag
,
3
);
if
(
uvRelativeToGrid
&&
!
cdiGribChangeModeUvRelativeToGrid
.
mode
)
ISEC2_ResFlag
-=
8
;
else
if
(
!
uvRelativeToGrid
&&
cdiGribChangeModeUvRelativeToGrid
.
mode
)
ISEC2_ResFlag
+=
8
;
}
}
static
...
...
src/stream_grb.c
View file @
c496cb78
...
...
@@ -15,7 +15,7 @@
// change if cdiGribChangeParameterID.active
struct
cdiGribParamChange
cdiGribChangeParameterID
;
// Used only
in
CDO
// Used only
for
CDO
module Selmulti
void
streamGrbChangeParameterIdentification
(
int
code
,
int
ltype
,
int
lev
)
{
// NOTE this is a "PROXY" function for gribapiChangeParameterIdentification();
...
...
@@ -29,6 +29,15 @@ void streamGrbChangeParameterIdentification(int code, int ltype, int lev)
cdiGribChangeParameterID
.
lev
=
lev
;
}
struct
cdiGribModeChange
cdiGribChangeModeUvRelativeToGrid
;
// Used only for CDO module WindTrans
void
streamGrbChangeModeUvRelativeToGrid
(
int
mode
)
{
cdiGribChangeModeUvRelativeToGrid
.
active
=
true
;
cdiGribChangeModeUvRelativeToGrid
.
mode
=
(
mode
>
0
);
}
int
grib1ltypeToZaxisType
(
int
grib_ltype
)
{
...
...
src/stream_grb.h
View file @
c496cb78
...
...
@@ -30,9 +30,17 @@ struct cdiGribParamChange
bool
active
;
};
struct
cdiGribModeChange
{
bool
mode
;
bool
active
;
};
extern
struct
cdiGribParamChange
cdiGribChangeParameterID
;
extern
struct
cdiGribModeChange
cdiGribChangeModeUvRelativeToGrid
;
void
streamGrbChangeParameterIdentification
(
int
code
,
int
ltype
,
int
lev
);
void
streamGrbChangeModeUvRelativeToGrid
(
int
mode
);
#endif
/* _STREAM_GRB_H */
/*
...
...
src/stream_gribapi.c
View file @
c496cb78
...
...
@@ -2677,6 +2677,13 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
GRIB_CHECK
(
my_grib_set_double
(
gh
,
"missingValue"
,
vlistInqVarMissval
(
vlistID
,
varID
)),
0
);
}
if
(
cdiGribChangeModeUvRelativeToGrid
.
active
)
{
// this will overrule/change the UvRelativeToGrid flag;
// typically when the wind is rotated with respect to north pole
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"uvRelativeToGrid"
,
(
long
)
cdiGribChangeModeUvRelativeToGrid
.
mode
),
0
);
}
GRIB_CHECK
(
grib_set_double_array
(
gh
,
"values"
,
data
,
(
size_t
)
datasize
),
0
);
/* get the size of coded message */
...
...
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