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
045ae96d
Commit
045ae96d
authored
8 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
printinfo.h update.
parent
b0ae97bb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/printinfo.h
+59
-13
59 additions, 13 deletions
app/printinfo.h
with
59 additions
and
13 deletions
app/printinfo.h
+
59
−
13
View file @
045ae96d
...
...
@@ -9,6 +9,20 @@
#define DATE_FORMAT "%5.4d-%2.2d-%2.2d"
#define TIME_FORMAT "%2.2d:%2.2d:%2.2d"
void
my_set_text_color
(
FILE
*
fp
,
int
attr
,
int
fg
)
{
#ifdef CDO
set_text_color
(
fp
,
attr
,
fg
);
#endif
}
void
my_reset_text_color
(
FILE
*
fp
)
{
#ifdef CDO
reset_text_color
(
fp
);
#endif
}
void
datetime2str
(
int
date
,
int
time
,
char
*
datetimestr
,
int
maxlen
)
{
int
year
,
month
,
day
;
...
...
@@ -284,7 +298,13 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
int
dig
=
7
;
if
(
!
lproj
)
fprintf
(
stdout
,
" %4d : %-24s"
,
index
+
1
,
gridNamePtr
(
gridtype
));
{
fprintf
(
stdout
,
" %4d : "
,
index
+
1
);
my_set_text_color
(
stdout
,
RESET
,
BLUE
);
fprintf
(
stdout
,
"%-24s"
,
gridNamePtr
(
gridtype
));
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
" : "
);
}
if
(
gridtype
==
GRID_LONLAT
||
gridtype
==
GRID_LCC2
||
...
...
@@ -297,7 +317,8 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
{
if
(
!
lproj
)
{
fprintf
(
stdout
,
" : points=%d"
,
gridsize
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"points=%d"
,
gridsize
);
if
(
gridtype
==
GRID_GAUSSIAN_REDUCED
)
fprintf
(
stdout
,
" nlat=%d"
,
ysize
);
else
if
(
xysize
)
...
...
@@ -305,6 +326,7 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
if
(
gridtype
==
GRID_GAUSSIAN
||
gridtype
==
GRID_GAUSSIAN_REDUCED
)
fprintf
(
stdout
,
" np=%d"
,
gridInqNP
(
gridID
));
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
"
\n
"
);
}
...
...
@@ -314,8 +336,13 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
if
(
gridtype
==
GRID_PROJECTION
||
name
[
0
]
)
{
if
(
name
[
0
]
==
0
)
strcpy
(
name
,
"undefined"
);
my_set_text_color
(
stdout
,
RESET
,
BLUE
);
fprintf
(
stdout
,
" %24s"
,
"mapping"
);
fprintf
(
stdout
,
" : %s
\n
"
,
name
);
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
" : "
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"%s
\n
"
,
name
);
my_reset_text_color
(
stdout
);
}
print_xvals
(
gridID
,
dig
);
...
...
@@ -357,29 +384,37 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
}
else
if
(
gridtype
==
GRID_SPECTRAL
)
{
fprintf
(
stdout
,
" : points=%d nsp=%d truncation=%d"
,
gridsize
,
gridsize
/
2
,
trunc
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"points=%d nsp=%d truncation=%d"
,
gridsize
,
gridsize
/
2
,
trunc
);
if
(
gridInqComplexPacking
(
gridID
)
)
fprintf
(
stdout
,
" complexPacking"
);
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
"
\n
"
);
}
else
if
(
gridtype
==
GRID_FOURIER
)
{
fprintf
(
stdout
,
" : points=%d nfc=%d truncation=%d
\n
"
,
gridsize
,
gridsize
/
2
,
trunc
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"points=%d nfc=%d truncation=%d
\n
"
,
gridsize
,
gridsize
/
2
,
trunc
);
my_reset_text_color
(
stdout
);
}
else
if
(
gridtype
==
GRID_GME
)
{
int
ni
=
gridInqGMEni
(
gridID
);
int
nd
=
gridInqGMEnd
(
gridID
);
fprintf
(
stdout
,
" : points=%d nd=%d ni=%d
\n
"
,
gridsize
,
nd
,
ni
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"points=%d nd=%d ni=%d
\n
"
,
gridsize
,
nd
,
ni
);
my_reset_text_color
(
stdout
);
}
else
if
(
gridtype
==
GRID_CURVILINEAR
||
gridtype
==
GRID_UNSTRUCTURED
)
{
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
if
(
gridtype
==
GRID_CURVILINEAR
)
fprintf
(
stdout
,
"
:
points=%d (%dx%d)"
,
gridsize
,
xsize
,
ysize
);
fprintf
(
stdout
,
"points=%d (%dx%d)"
,
gridsize
,
xsize
,
ysize
);
else
fprintf
(
stdout
,
"
:
points=%d"
,
gridsize
);
fprintf
(
stdout
,
"points=%d"
,
gridsize
);
if
(
gridtype
==
GRID_UNSTRUCTURED
&&
gridInqNvertex
(
gridID
)
>
0
)
fprintf
(
stdout
,
" nvertex=%d"
,
gridInqNvertex
(
gridID
));
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
"
\n
"
);
...
...
@@ -408,21 +443,25 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
gridInqLCC
(
gridID
,
&
originLon
,
&
originLat
,
&
lonParY
,
&
lat1
,
&
lat2
,
&
xincm
,
&
yincm
,
&
projflag
,
&
scanflag
);
fprintf
(
stdout
,
" : points=%d (%dx%d) "
,
gridsize
,
xsize
,
ysize
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
"points=%d (%dx%d) "
,
gridsize
,
xsize
,
ysize
);
if
(
(
projflag
&
128
)
==
0
)
fprintf
(
stdout
,
"North Pole
\n
"
);
else
fprintf
(
stdout
,
"South Pole
\n
"
);
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
"%33s : originLon=%g originLat=%g lonParY=%g
\n
"
,
" "
,
originLon
,
originLat
,
lonParY
);
fprintf
(
stdout
,
"%33s : lat1=%g lat2=%g xinc=%g m yinc=%g m
\n
"
,
" "
,
lat1
,
lat2
,
xincm
,
yincm
);
}
else
/* if ( gridtype == GRID_GENERIC ) */
{
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
if
(
ysize
==
0
)
fprintf
(
stdout
,
"
:
points=%d
\n
"
,
gridsize
);
fprintf
(
stdout
,
"points=%d
\n
"
,
gridsize
);
else
fprintf
(
stdout
,
" : points=%d (%dx%d)
\n
"
,
gridsize
,
xsize
,
ysize
);
fprintf
(
stdout
,
"points=%d (%dx%d)
\n
"
,
gridsize
,
xsize
,
ysize
);
my_reset_text_color
(
stdout
);
}
if
(
gridtype
==
GRID_CURVILINEAR
||
gridtype
==
GRID_UNSTRUCTURED
||
gridtype
==
GRID_LCC
)
...
...
@@ -487,12 +526,19 @@ void printZaxisInfo(int vlistID)
zaxisInqUnits
(
zaxisID
,
zunits
);
zunits
[
12
]
=
0
;
fprintf
(
stdout
,
" %4d : "
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
);
my_set_text_color
(
stdout
,
RESET
,
BLUE
);
if
(
zaxistype
==
ZAXIS_GENERIC
&&
ltype
!=
0
)
fprintf
(
stdout
,
"
%4d :
%-12s (ltype=%3d) :"
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
,
zaxisname
,
ltype
);
fprintf
(
stdout
,
"%-12s (ltype=%3d) :"
,
zaxisname
,
ltype
);
else
fprintf
(
stdout
,
" %4d : %-24s :"
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
,
zaxisname
);
fprintf
(
stdout
,
"%-24s"
,
zaxisname
);
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
" :"
);
my_set_text_color
(
stdout
,
RESET
,
GREEN
);
fprintf
(
stdout
,
" levels=%d"
,
levelsize
);
my_reset_text_color
(
stdout
);
fprintf
(
stdout
,
"
\n
"
);
double
*
levels
=
(
double
*
)
malloc
((
size_t
)
levelsize
*
sizeof
(
double
));
...
...
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