awips2/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/dgdriv_c/gdcgtmf.c
Steve Harris 4c8e604619 13.1.2-7 baseline
Former-commit-id: 0b15dff12b [formerly a8d90da9c0] [formerly 4f86b07eb0] [formerly 42189b5f88 [formerly 4f86b07eb0 [formerly 0c4514d3be8e7dee89a2abe903b51155a2895fd4]]]
Former-commit-id: 42189b5f88
Former-commit-id: 14e868b80bdcdb7270336e9346e3a2f321283073 [formerly b7f1dbe72b]
Former-commit-id: f1256f2a9e
2013-01-11 16:12:09 -05:00

48 lines
1.7 KiB
C

#include "geminc.h"
#include "gemprm.h"
void gdc_gtmf ( char *gdfile, char *cycle, char *availableTimes, int *iret )
/************************************************************************
C* Input parameters: *
C* GDFILE CHAR* Grid file name *
C* CYCLE CHAR* Cycle(Gempak format) *
C* Output parameters: *
C* AVAILABLETIMES CHAR* List of GEMPAK times *
C* IRET INTEGER Return code *
C* 0 = normal return *
************************************************************************/
{
int ngdftm,ier=0;
int maxt = 500;
char gdatim[4]="";
char mtime_list[500][20];
/*----------------------------------------------------------------------*/
*iret = 0;
gd_gtmf (gdfile, gdatim, cycle, &maxt, &ngdftm, mtime_list,
&ier,strlen (gdfile), strlen (gdatim), strlen (cycle),
20 /* mtime_list size */ );
if ( ier == 0 && ngdftm > 0 ) {
int jj;
for ( jj = 0; jj < ngdftm; jj ++ ) {
int lens;
mtime_list[jj][19] = '\0';
lens = strcspn (mtime_list[jj], "\t \0");
mtime_list[jj][lens] = '\0';
if ( jj == 0 ) {
strcpy ( availableTimes, mtime_list[jj]);
}
else {
strcat ( availableTimes, mtime_list[jj]);
}
if ( jj < ngdftm - 1 ) {
strcat ( availableTimes,"|" );
}
}
}
else {
*iret = ier;
}
return;
}