Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
1b0ebd86
Commit
1b0ebd86
authored
Jan 23, 2009
by
Uwe Schulzweida
Browse files
gridFromName: define GRID with one point lon=<LON>_lat=<LAT>
parent
27a64932
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
1b0ebd86
...
...
@@ -3,6 +3,7 @@
* using CDI library version 1.3.1
* add support for GRID type Lambert Conformal Conic
* Sinusoidal and Lambert Azimuthal Equal Area grids with units [km]
* gridFromName: define GRID with one point lon=<LON>_lat=<LAT>
* remap: read grid corners only if needed
* Version 1.3.1 released
...
...
src/griddes.c
View file @
1b0ebd86
...
...
@@ -1509,6 +1509,7 @@ int compNlon(int nlat)
int
gridFromName
(
const
char
*
gridname
)
{
static
char
func
[]
=
"gridFromName"
;
const
char
*
pline
;
int
gridID
=
UNDEFID
;
GRID
grid
;
...
...
@@ -1571,6 +1572,28 @@ int gridFromName(const char *gridname)
grid
.
def_yfirst
=
TRUE
;
}
}
else
if
(
gridname
[
0
]
==
'l'
&&
gridname
[
1
]
==
'o'
&&
gridname
[
2
]
==
'n'
)
/* lon=<LON>_lat=<LAT> */
{
/* only one gridpoint */
pline
=
&
gridname
[
3
];
if
(
*
pline
==
'='
)
pline
++
;
if
(
isdigit
((
int
)
*
pline
)
)
{
grid
.
type
=
GRID_LONLAT
;
grid
.
xsize
=
1
;
grid
.
ysize
=
1
;
grid
.
xvals
=
(
double
*
)
malloc
(
sizeof
(
double
));
grid
.
yvals
=
(
double
*
)
malloc
(
sizeof
(
double
));
grid
.
xvals
[
0
]
=
atof
(
pline
);
while
(
isdigit
((
int
)
*
pline
)
||
ispunct
((
int
)
*
pline
)
||
*
pline
==
'-'
)
pline
++
;
if
(
*
pline
==
'_'
)
pline
++
;
if
(
!
(
pline
[
0
]
==
'l'
&&
pline
[
1
]
==
'a'
&&
pline
[
2
]
==
't'
)
)
return
(
gridID
);
pline
+=
3
;
if
(
*
pline
==
'='
)
pline
++
;
if
(
!
isdigit
((
int
)
*
pline
)
)
return
(
gridID
);
grid
.
yvals
[
0
]
=
atof
(
pline
);
}
}
else
if
(
gridname
[
0
]
==
'g'
&&
gridname
[
1
]
==
'm'
&&
gridname
[
2
]
==
'e'
)
/* gme<NI> */
{
pline
=
&
gridname
[
3
];
...
...
Write
Preview
Supports
Markdown
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