/************************************************************/ /* /***********************************************************/ #include #include #include #include #include #include #define MAX_FILE_NAME_LEN 250 // Max. file name length #define DAYS_1958_1970 4383 #define MILLI_PER_DAY 86400000 /************************** Function prototypes **************************/ /*--------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { t_err err; int i, RecCount, VarCount; t_variable *cef_time, *var; double ddTime0, ddTimeN, step, SHIFT; SHIFT = (double)DAYS_1958_1970 * (double)MILLI_PER_DAY; /*********************** Open CEF file *****************************/ err = Read_CEF_file(argv[1]); RecCount = Records_count(); VarCount = Variables_count(); for (i = 0; i < VarCount; i++) { var = Get_variable_number(i); if (var->type == CEF_ISO_TIME ) break; } cef_time = Get_variable(var->name); ddTime0 = ((T1D(cef_time, 0, 0) - SHIFT) / 1000.0); ddTimeN = ((T1D(cef_time, RecCount-1, 0) - SHIFT) / 1000.0); step = ((T1D(cef_time, 1, 0) - SHIFT) / 1000.0) - ddTime0; printf("%lf %lf %f", ddTime0, ddTimeN, step); err = Close_CEF_file(); }