Commit 6b880ad4 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Sinfo: print availability of vct and ps

parent 69dd10f9
...@@ -16,14 +16,11 @@ int cdiUUIDIsNull(const unsigned char uuid[CDI_UUID_SIZE]) ...@@ -16,14 +16,11 @@ int cdiUUIDIsNull(const unsigned char uuid[CDI_UUID_SIZE])
void datetime2str(int date, int time, char *datetimestr, int maxlen) void datetime2str(int date, int time, char *datetimestr, int maxlen)
{ {
int year, month, day; int year, month, day;
int hour, minute, second;
int len;
cdiDecodeDate(date, &year, &month, &day); cdiDecodeDate(date, &year, &month, &day);
int hour, minute, second;
cdiDecodeTime(time, &hour, &minute, &second); cdiDecodeTime(time, &hour, &minute, &second);
len = sprintf(datetimestr, DATE_FORMAT "T" TIME_FORMAT, year, month, day, hour, minute, second); int len = sprintf(datetimestr, DATE_FORMAT "T" TIME_FORMAT, year, month, day, hour, minute, second);
if ( len > ( maxlen-1) ) if ( len > ( maxlen-1) )
fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__); fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
} }
...@@ -32,12 +29,9 @@ void datetime2str(int date, int time, char *datetimestr, int maxlen) ...@@ -32,12 +29,9 @@ void datetime2str(int date, int time, char *datetimestr, int maxlen)
void date2str(int date, char *datestr, int maxlen) void date2str(int date, char *datestr, int maxlen)
{ {
int year, month, day; int year, month, day;
int len;
cdiDecodeDate(date, &year, &month, &day); cdiDecodeDate(date, &year, &month, &day);
len = sprintf(datestr, DATE_FORMAT, year, month, day); int len = sprintf(datestr, DATE_FORMAT, year, month, day);
if ( len > ( maxlen-1) ) if ( len > ( maxlen-1) )
fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__); fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
} }
...@@ -46,12 +40,9 @@ void date2str(int date, char *datestr, int maxlen) ...@@ -46,12 +40,9 @@ void date2str(int date, char *datestr, int maxlen)
void time2str(int time, char *timestr, int maxlen) void time2str(int time, char *timestr, int maxlen)
{ {
int hour, minute, second; int hour, minute, second;
int len;
cdiDecodeTime(time, &hour, &minute, &second); cdiDecodeTime(time, &hour, &minute, &second);
len = sprintf(timestr, TIME_FORMAT, hour, minute, second); int len = sprintf(timestr, TIME_FORMAT, hour, minute, second);
if ( len > ( maxlen-1) ) if ( len > ( maxlen-1) )
fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__); fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
} }
...@@ -59,9 +50,7 @@ void time2str(int time, char *timestr, int maxlen) ...@@ -59,9 +50,7 @@ void time2str(int time, char *timestr, int maxlen)
void printFiletype(int streamID, int vlistID) void printFiletype(int streamID, int vlistID)
{ {
int filetype; int filetype = streamInqFiletype(streamID);
filetype = streamInqFiletype(streamID);
switch ( filetype ) switch ( filetype )
{ {
...@@ -134,12 +123,9 @@ void printFiletype(int streamID, int vlistID) ...@@ -134,12 +123,9 @@ void printFiletype(int streamID, int vlistID)
if ( filetype == FILETYPE_GRB2 ) if ( filetype == FILETYPE_GRB2 )
{ {
int nvars, varID;
int comptype; int comptype;
int nvars = vlistNvars(vlistID);
nvars = vlistNvars(vlistID); for ( int varID = 0; varID < nvars; varID++ )
for ( varID = 0; varID < nvars; varID++ )
{ {
comptype = vlistInqVarCompType(vlistID, varID); comptype = vlistInqVarCompType(vlistID, varID);
if ( comptype ) if ( comptype )
...@@ -484,6 +470,21 @@ void printZaxisInfo(int vlistID) ...@@ -484,6 +470,21 @@ void printZaxisInfo(int vlistID)
fprintf(stdout, "\n"); fprintf(stdout, "\n");
} }
if ( zaxistype == ZAXIS_HYBRID )
{
char psname[CDI_MAX_NAME];
psname[0] = 0;
zaxisInqPsName(zaxisID, psname);
int vctsize = zaxisInqVctSize(zaxisID);
if ( vctsize || psname[0] )
{
fprintf(stdout, "%33s :", "available");
if ( vctsize ) fprintf(stdout, " vct");
if ( psname[0] ) fprintf(stdout, " ps: %s", psname);
fprintf(stdout, "\n");
}
}
if ( zaxistype == ZAXIS_REFERENCE ) if ( zaxistype == ZAXIS_REFERENCE )
{ {
int number = zaxisInqNumber(zaxisID); int number = zaxisInqNumber(zaxisID);
...@@ -522,7 +523,6 @@ void printSubtypeInfo(int vlistID) ...@@ -522,7 +523,6 @@ void printSubtypeInfo(int vlistID)
fprintf(stdout, " %4d : %-24s :", vlistSubtypeIndex(vlistID, subtypeID)+1, "tiles"); fprintf(stdout, " %4d : %-24s :", vlistSubtypeIndex(vlistID, subtypeID)+1, "tiles");
fprintf(stdout, " ntiles=%d", subtypesize); fprintf(stdout, " ntiles=%d", subtypesize);
fprintf(stdout, "\n"); fprintf(stdout, "\n");
} }
} }
...@@ -551,7 +551,6 @@ int printDateTime(int ntimeout, int vdate, int vtime) ...@@ -551,7 +551,6 @@ int printDateTime(int ntimeout, int vdate, int vtime)
static static
int printDot(int ndotout, int *nfact, int *ncout) int printDot(int ndotout, int *nfact, int *ncout)
{ {
//printf("ncout %d %d %d\n",*ncout, (*ncout)%(*nfact), *nfact); //printf("ncout %d %d %d\n",*ncout, (*ncout)%(*nfact), *nfact);
if ( (*ncout)%(*nfact) == 0 ) if ( (*ncout)%(*nfact) == 0 )
{ {
...@@ -570,7 +569,7 @@ int printDot(int ndotout, int *nfact, int *ncout) ...@@ -570,7 +569,7 @@ int printDot(int ndotout, int *nfact, int *ncout)
(*ncout)++; (*ncout)++;
return (ndotout); return ndotout;
} }
static static
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment