Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
libcdi
Commits
f302a1da
Commit
f302a1da
authored
4 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
cdi.h: removed function gaussianLatitudes() from cdi interface.
parent
103f655f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Replaced gridDefDatatype()/gridInqDatatype() by cdiDefKeyInt()/cdiInqKeyInt()...
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
src/cdi.h
+0
-2
0 additions, 2 deletions
src/cdi.h
src/gaussgrid.c
+7
-25
7 additions, 25 deletions
src/gaussgrid.c
src/grid.h
+1
-0
1 addition, 0 deletions
src/grid.h
with
12 additions
and
27 deletions
ChangeLog
+
4
−
0
View file @
f302a1da
2019-11-26 Uwe Schulzweida
* cdi.h: removed function gaussianLatitudes() from cdi interface
2019-10-09 Uwe Schulzweida
* using CGRIBEX library version 1.9.5
...
...
This diff is collapsed.
Click to expand it.
src/cdi.h
+
0
−
2
View file @
f302a1da
...
...
@@ -1283,8 +1283,6 @@ void gribapiLibraryVersion(int *major_version, int *minor_version, int *revision
extern
"C"
{
#endif
void
gaussianLatitudes
(
double
*
latitudes
,
double
*
weights
,
size_t
nlat
);
#define HAVE_CDI_PROJ_FUNCS 1
extern
int
(
*
proj_lonlat_to_lcc_func
)(
double
,
double
,
double
,
double
,
double
,
double
,
double
,
size_t
,
double
*
,
double
*
);
extern
int
(
*
proj_lcc_to_lonlat_func
)(
double
,
double
,
double
,
double
,
double
,
double
,
double
,
double
,
double
,
size_t
,
double
*
,
double
*
);
...
...
This diff is collapsed.
Click to expand it.
src/gaussgrid.c
+
7
−
25
View file @
f302a1da
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<stdio.h>
#include
<stdlib.h>
#include
<float.h>
...
...
@@ -11,9 +7,6 @@
#define M_SQRT2 1.41421356237309504880168872420969808
#endif
#include
"cdi_int.h"
static
void
cpledn
(
size_t
kn
,
size_t
kodd
,
double
*
pfn
,
double
pdx
,
int
kflag
,
double
*
pw
,
double
*
pdxn
,
double
*
pxmod
)
...
...
@@ -71,9 +64,9 @@ void gawl(double *pfn, double *pl, double *pw, size_t kn)
int
iflag
=
0
;
int
itemax
=
20
;
size_t
iodd
=
(
kn
%
2
);
size_t
iodd
=
(
kn
%
2
);
double
zdlx
=
*
pl
;
double
zdlx
=
*
pl
;
// 2.0 Newton iteration
...
...
@@ -118,7 +111,7 @@ void gauaw(size_t kn, double *restrict pl, double *restrict pw)
for
(
size_t
jgl
=
2
;
jgl
<=
jn
-
iodd
;
jgl
+=
2
)
{
zfn
[
jn
*
(
kn
+
1
)
+
jn
-
jgl
]
=
zfn
[
jn
*
(
kn
+
1
)
+
jn
-
jgl
+
2
]
*
((
double
)((
jgl
-
1
)
*
(
2
*
jn
-
jgl
+
2
)))
/
((
double
)(
jgl
*
(
2
*
jn
-
jgl
+
1
)));
*
((
double
)((
jgl
-
1
)
*
(
2
*
jn
-
jgl
+
2
)))
/
((
double
)(
jgl
*
(
2
*
jn
-
jgl
+
1
)));
}
}
...
...
@@ -136,12 +129,11 @@ void gauaw(size_t kn, double *restrict pl, double *restrict pw)
// 2.1 Find first approximation of the roots of the Legendre polynomial of degree kn
size_t
ins2
=
kn
/
2
+
(
kn
%
2
);
double
z
;
for
(
size_t
jgl
=
1
;
jgl
<=
ins2
;
jgl
++
)
{
z
=
((
double
)(
4
*
jgl
-
1
))
*
M_PI
/
((
double
)(
4
*
kn
+
2
));
pl
[
jgl
-
1
]
=
z
+
1
.
0
/
(
tan
(
z
)
*
((
double
)(
8
*
kn
*
kn
)));
double
z
=
((
double
)(
4
*
jgl
-
1
))
*
M_PI
/
((
double
)(
4
*
kn
+
2
));
pl
[
jgl
-
1
]
=
z
+
1
.
0
/
(
tan
(
z
)
*
((
double
)(
8
*
kn
*
kn
)));
}
// 2.2 Computes roots and weights for transformed theta
...
...
@@ -159,8 +151,8 @@ void gauaw(size_t kn, double *restrict pl, double *restrict pw)
for
(
size_t
jgl
=
1
;
jgl
<=
kn
/
2
;
jgl
++
)
{
size_t
jglm1
=
jgl
-
1
;
size_t
isym
=
kn
-
jgl
;
pl
[
isym
]
=
-
pl
[
jglm1
];
size_t
isym
=
kn
-
jgl
;
pl
[
isym
]
=
-
pl
[
jglm1
];
pw
[
isym
]
=
pw
[
jglm1
];
}
...
...
@@ -175,13 +167,3 @@ void gaussianLatitudes(double *latitudes, double *weights, size_t nlat)
{
gauaw
(
nlat
,
latitudes
,
weights
);
}
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
This diff is collapsed.
Click to expand it.
src/grid.h
+
1
−
0
View file @
f302a1da
...
...
@@ -155,6 +155,7 @@ int gridVerifyGribParamSTERE(double missval, double *lon_0, double *lat_ts, doub
double
*
a
,
double
*
xval_0
,
double
*
yval_0
,
double
*
x_0
,
double
*
y_0
);
bool
isGaussLat
(
size_t
ysize
,
double
yinc
,
const
double
*
yvals
);
void
gaussianLatitudes
(
double
*
latitudes
,
double
*
weights
,
size_t
nlat
);
#endif
/*
...
...
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