ocssw
V2022
|
nccmp.cpp
Go to the documentation of this file.
104 for (p1 = in1, p2 = in2; (*p1 == *p2) || ((*p1 == m1) && (*p2 == m2)) || (std::isnan(*p1) && std::isnan(*p2)); ++p1, ++p2)
126 template <typename T> int cmp_var(int ncid1, int ncid2, nccmpopts* opts, int rec, size_t *odomax,
149 /* printf("start = %d %d %d %d, count = %d %d %d %d\n", (int)start[0], (int)start[1], (int)start[2], (int)start[3], (int)count[0], (int)count[1], (int)count[2], (int)count[3]); */ \
197 //printf("%d nitems=%d, cmplen=%d, diff=%d do_missing=%d\n", __LINE__, nitems, cmplen, diff, opts->missing);
213 template <typename T> int cmp_vartol(int ncid1, int ncid2, nccmpopts* opts, int rec, size_t *odomax,
222 string message("DIFFER : VARIABLE : %s%s : POSITION : %s : VALUES : %s <> %s : PERCENT : %g\n");
237 /* printf("start = %d %d %d %d, count = %d %d %d %d\n", (int)start[0], (int)start[1], (int)start[2], (int)start[3], (int)count[0], (int)count[1], (int)count[2], (int)count[3]); */ \
252 if (opts->abstolerance ? (absdelta > opts->tolerance) : (double) absdelta * 100. / (fabs((double) P1[i]) > fabs((double) P2[i]) ? fabs((double) P1[i]) : fabs((double) P2[i])) > opts->tolerance) \
279 fprintf(stderr, message.c_str(), getGroupPath(), v1->name, idxstr, value1str, value2str, (double) absdelta * 100. / (fabs((double) P1[i]) > fabs((double) P2[i]) ? fabs((double) P1[i]) : fabs((double) P2[i])));
294 template <typename T> int cmp_var_ut(int ncid1, int ncid2, nccmpopts* opts, int rec, size_t *odomax,
317 /* printf("start = %d %d %d %d, count = %d %d %d %d\n", (int)start[0], (int)start[1], (int)start[2], (int)start[3], (int)count[0], (int)count[1], (int)count[2], (int)count[3]); */ \
365 //printf("%d nitems=%d, cmplen=%d, diff=%d do_missing=%d\n", __LINE__, nitems, cmplen, diff, opts->missing);
381 template <typename T> int cmp_vartol_ut(void *P1, void *P2, int offset1, int offset2, int size1, int size2, char* name, nccmpopts* opts, int rec, size_t *odomax,
390 string message("DIFFER : VARIABLE : %s%s(%s) : POSITION : %s : VALUES : %s <> %s : PERCENT : %g\n");
414 if (opts->abstolerance ? (absdelta > opts->tolerance) : (double) absdelta * 100. / (fabs((double) value1) > fabs((double) value2) ? fabs((double) value1) : fabs((double) value2)) > opts->tolerance) \
439 fprintf(stderr, message.c_str(), getGroupPath(), v1->name, name, idxstr, value1str, value2str, (double) absdelta * 100. / (fabs((double) value1) > fabs((double) value2) ? fabs((double) value1) : fabs((double) value2)));
608 fprintf(stderr, "ERROR : QUERYING ATTRIBUTE \"%s\" FOR VARIABLE \"%s%s\"\n", name, getGroupPath(), varname);
820 fprintf(stderr, "DIFFER : VARIABLE \"%s%s\" IS MISSING ATTRIBUTE WITH NAME \"%s\" IN FILE \"%s\"\n", getGroupPath(), varname, name, opts->file1);
830 fprintf(stderr, "DIFFER : VARIABLE \"%s%s\" IS MISSING ATTRIBUTE WITH NAME \"%s\" IN FILE \"%s\"\n", getGroupPath(), varname, name, opts->file2);
841 fprintf(stderr, "DIFFER : TYPES : ATTRIBUTE : %s : VARIABLE : %s%s : %s <> %s\n", name, getGroupPath(), varname, typestr1, typestr2);
853 fprintf(stderr, "DIFFER : LENGTHS : ATTRIBUTE : %s : VARIABLE : %s%s : %lu <> %lu : VALUES : ", name, getGroupPath(), varname, (unsigned long) lenp1, (unsigned long) lenp2);
881 fprintf(stderr, "DIFFER : VARIABLE : %s%s : ATTRIBUTE : %s : VALUES : ", getGroupPath(), varname, name);
1317 fprintf(stderr, "DIFFER : LENGTHS OF RECORDS : %s (%d) <> %s (%d)\n", name1, (int) nrec1, name2, (int) nrec2);
1467 status = nc_get_att_ulonglong(ncid, var->varid, attname, (unsigned long long *)&var->missing.ul);
1489 nccmp_user_type_t* getvarinfo(int ncid, varstruct* vars, int* nvars, int verbose, int *nuser_types) {
1612 status = excludevars(ncid1, ncid2, opts->cmpvarlist, opts->ncmpvarlist, opts->excludelist, opts->nexclude);
1780 fprintf(stderr, "DIFFER : NAME OF GLOBAL ATTRIBUTE : %s : GLOBAL ATTRIBUTE DOESN'T EXIST IN \"%s\"\n", name1, opts->file2);
1791 fprintf(stderr, "DIFFER : GLOBAL ATTRIBUTE TYPES : %s : %s <> %s\n", name1, typestr1, typestr2);
1802 fprintf(stderr, "DIFFER : LENGTHS OF GLOBAL ATTRIBUTE : %s : %lu <> %lu : VALUES : %s <> %s\n", name1,
1815 fprintf(stderr, "DIFFER : VALUES OF GLOBAL ATTRIBUTE : %s : %s <> %s\n", name1, typestr1, typestr2);
1855 fprintf(stderr, "DIFFER : NAME OF GLOBAL ATTRIBUTE : %s : GLOBAL ATTRIBUTE DOESN'T EXIST IN %s\n", name2, opts->file1);
1866 fprintf(stderr, "DIFFER : GLOBAL ATTRIBUTE TYPE : %s : %s <> %s\n", name1, typestr1, typestr2);
1878 fprintf(stderr, "DIFFER : LENGTHS OF GLOBAL ATTRIBUTE : %s : %lu <> %lu : VALUES : ", name1, (unsigned long) len1, (unsigned long) len2);
1911 fprintf(stderr, "DIFFER : VALUES OF GLOBAL ATTRIBUTE : %s : %s <> %s\n", name1, typestr1, typestr2);
1930 int i, j, j1, j2, status, ncstatus, dimid1, dimid2, tmp1, tmp2, attid1, attid2, natts1, natts2;
1932 char name1[NC_MAX_NAME], name2[NC_MAX_NAME], recname1[NC_MAX_NAME], recname2[NC_MAX_NAME], typestr1[1024], typestr2[1024];
1985 fprintf(stderr, "DIFFER : NAME : DIMENSION : %s : DIMENSION DOESN'T EXIST IN \"%s\"\n", name1, opts->file2);
2023 fprintf(stderr, "DIFFER : NAME : VARIABLE : %s%s : VARIABLE DOESN'T EXIST IN \"%s\"\n", getGroupPath(), opts->cmpvarlist[i], opts->file1);
2034 fprintf(stderr, "DIFFER : NAME : VARIABLE : %s%s : VARIABLE DOESN'T EXIST IN \"%s\"\n", getGroupPath(), opts->cmpvarlist[i], opts->file2);
2046 fprintf(stderr, "DIFFER : TYPES : VARIABLE : %s%s : %s <> %s\n", getGroupPath(), opts->cmpvarlist[i], typestr1, typestr2);
2056 fprintf(stderr, "DIFFER : NUMBER : DIMENSIONS : VARIABLE : %s%s : %d <> %d\n", getGroupPath(), opts->cmpvarlist[i], ndims1, ndims2);
2086 /*printf("DEBUG : %d : %s, %s, %s\n", __LINE__, opts->cmpvarlist[i], dims1[dimid1].name, dims2[dimid2].name);*/
2089 fprintf(stderr, "DIFFER : DIMENSION NAMES FOR VARIABLE %s%s : %s <> %s\n", getGroupPath(), opts->cmpvarlist[i], dims1[dimid1].name, dims2[dimid2].name);
2102 fprintf(stderr, "DIFFER : VARIABLE : %s%s : DIMENSION %s IS RECORD IN FILE \"%s\" BUT NOT IN \"%s\"\n", getGroupPath(), vars1[j1].name, dims1[dimid1].name, opts->file1, opts->file2);
2110 fprintf(stderr, "DIFFER : VARIABLE : %s%s : DIMENSION %s IS RECORD IN FILE \"%s\" BUT NOT IN \"%s\"\n", getGroupPath(), vars1[j1].name, dims2[dimid2].name, opts->file2, opts->file1);
2156 if (instringlist(opts->excludeattlist, name1, opts->nexcludeatt) || instringlist(processedatts, name1, NC_MAX_VARS))
2163 ncstatus = cmpatt(ncid1, ncid2, vars1[j1].varid, vars2[j2].varid, name1, vars1[j1].name, opts);
2175 fprintf(stderr, "Failed to query variable %s%s attribute in file \"%s\"\n", getGroupPath(), vars2[j2].name, opts->file2);
2197 ncstatus = cmpatt(ncid1, ncid2, vars1[j1].varid, vars2[j2].varid, name2, vars2[j2].name, opts);
2206 fprintf(stderr, "DIFFER : NUMBER OF ATTRIBUTES : VARIABLE : %s%s : %d <> %d\n", getGroupPath(), opts->cmpvarlist[i], natts1, natts2);
2241 int cmpvar(char* name, int rec, nccmpopts* opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2261 fprintf(stderr, "DIFFER : SIZE OF VARIABLE \"%s%s\" : %d <> %d\n", getGroupPath(), name, (int) v1->len, (int) v2->len);
2318 //cmp_var<int8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.b, v2->missing.b);
2320 diffstatus = cmp_vartol<int8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2325 // cmp_var<char>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.c, v2->missing.c);
2327 diffstatus = cmp_vartol<char>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2332 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2334 diffstatus = cmp_vartol<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2339 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2341 diffstatus = cmp_vartol<uint16_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2346 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2348 diffstatus = cmp_vartol<uint8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2354 diffstatus = cmp_vartol<int>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.i, v2->missing.i);
2360 diffstatus = cmp_vartol<uint>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ui, v2->missing.ui);
2366 diffstatus = cmp_vartol<long>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.l, v2->missing.l);
2372 diffstatus = cmp_vartol<uint64_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ul, v2->missing.ul);
2379 diffstatus = cmp_vartol<float>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2384 diffstatus = cmp_vartol<float>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2392 diffstatus = cmp_var<double>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2397 diffstatus = cmp_vartol<double>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2416 data1 = (unsigned char *) malloc(sizeof (unsigned char)*user_types1[ut_nidx1].size * (nitems + 1));
2417 data2 = (unsigned char *) malloc(sizeof (unsigned char)*user_types2[ut_nidx2].size * (nitems + 1));
2431 //cmp_var<int8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.b, v2->missing.b);
2433 diffstatus = cmp_vartol_ut<int8_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.b, v2->missing.b);
2438 // cmp_var<char>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.c, v2->missing.c);
2440 diffstatus = cmp_vartol_ut<char>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.c, v2->missing.c);
2445 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2447 diffstatus = cmp_vartol<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2452 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2454 diffstatus = cmp_vartol<uint16_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.us, v2->missing.us);
2459 // cmp_var<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2461 diffstatus = cmp_vartol_ut<uint8_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ub, v2->missing.ub);
2467 diffstatus = cmp_vartol_ut<int>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.i, v2->missing.i);
2473 diffstatus = cmp_vartol_ut<uint>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ui, v2->missing.ui);
2479 diffstatus = cmp_vartol_ut<long>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.l, v2->missing.l);
2485 diffstatus = cmp_vartol_ut<uint64_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ul, v2->missing.ul);
2492 diffstatus = cmp_vartol_ut<float>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2497 diffstatus = cmp_vartol_ut<float>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2505 diffstatus = cmp_vartol_ut<double>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2510 diffstatus = cmp_vartol_ut<double>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2521 printf("INFO: Increase NC_MAX_TYPES > %d to avoid this message. \n", user_types1[ut_nidx1].fields[i].type_id);
2538 int cmpvartol(char* name, int rec, nccmpopts* opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2551 printf("INFO: Comparing data for variable \"%s%s\" at record %d.\n", getGroupPath(), name, (int) rec);
2561 fprintf(stderr, "DIFFER : Failed to find variable \"%s%s\" in file \"%s\".\n", getGroupPath(), name, opts->file1);
2571 fprintf(stderr, "DIFFER : Failed to find variable \"%s%s\" in file \"%s\".\n", getGroupPath(), name, opts->file2);
2583 fprintf(stderr, "DIFFER : SIZE OF VARIABLE \"%s%s\" : %d <> %d\n", getGroupPath(), name, (int) v1->len, (int) v2->len);
2619 /* todo: make cmpvar and cmpvartol same function to re-use code immediately above; just use conditional to choose CMP_VAR or CMP_VARTOL macro. */
2625 diffstatus = cmp_vartol<int8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.b, v2->missing.b);
2630 diffstatus = cmp_vartol<uint8_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ub, v2->missing.ub);
2635 diffstatus = cmp_vartol<char>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.c, v2->missing.c);
2640 diffstatus = cmp_vartol<short>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2645 diffstatus = cmp_vartol<uint16_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.us, v2->missing.us);
2650 diffstatus = cmp_vartol<int>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.i, v2->missing.i);
2655 diffstatus = cmp_vartol<uint>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ui, v2->missing.ui);
2660 diffstatus = cmp_vartol<long>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.l, v2->missing.l);
2665 diffstatus = cmp_vartol<uint64_t>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ul, v2->missing.ul);
2670 diffstatus = cmp_vartol<float>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2675 diffstatus = cmp_vartol<double>(ncid1, ncid2, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2692 data1 = (unsigned char *) malloc(sizeof (unsigned char)*user_types1[ut_nidx1].size * (nitems + 1));
2693 data2 = (unsigned char *) malloc(sizeof (unsigned char)*user_types2[ut_nidx2].size * (nitems + 1));
2708 diffstatus = cmp_vartol_ut<int8_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.b, v2->missing.b);
2714 diffstatus = cmp_vartol_ut<uint8_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ub, v2->missing.ub);
2720 diffstatus = cmp_vartol_ut<char>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.c, v2->missing.c);
2725 diffstatus = cmp_vartol_ut<short>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.s, v2->missing.s);
2730 diffstatus = cmp_vartol_ut<uint16_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.us, v2->missing.us);
2735 diffstatus = cmp_vartol_ut<int>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.i, v2->missing.i);
2740 diffstatus = cmp_vartol_ut<uint>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ui, v2->missing.ui);
2745 diffstatus = cmp_vartol_ut<long>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.l, v2->missing.l);
2750 diffstatus = cmp_vartol_ut<uint64_t>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.ul, v2->missing.ul);
2755 diffstatus = cmp_vartol_ut<float>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.f, v2->missing.f);
2760 diffstatus = cmp_vartol_ut<double>(data1, data2, offset1, offset2, size1, size2, user_types1[ut_nidx1].fields[i].name, opts, rec, odomax, nitems, count, start, v1, v2, v1->missing.d, v2->missing.d);
2769 printf("INFO: Increase NC_MAX_TYPES > %d to avoid this message. \n", user_types1[ut_nidx1].fields[i].type_id);
2784 size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2789 cmpstatus = cmpvartol(varname, recstart, opts, ncid1, ncid2, user_types1, user_types2) || status;
2805 size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2824 int nccmpdatatol(int ncid1, int ncid2, nccmpopts* opts, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2855 cmpstatus = nccmpdatarecvartol(ncid1, ncid2, opts->cmpvarlist[i], opts, 0, nrec1 - 1, user_types1, user_types2);
2883 int nccmpdata(nccmpopts* opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2) {
2921 fprintf(stderr, "DIFFER : Failed to find variable \"%s%s\" in file \"%s\".\n", getGroupPath(), opts->cmpvarlist[i], opts->file1);
2933 fprintf(stderr, "DIFFER : Failed to find variable \"%s%s\" in file \"%s\".\n", getGroupPath(), opts->cmpvarlist[i], opts->file2);
2944 fprintf(stderr, "DIFFER : SIZE OF VARIABLE \"%s%s\" : %d <> %d\n", getGroupPath(), opts->cmpvarlist[i], (int) vars1[idx1].len, (int) vars2[idx2].len);
2957 fprintf(stderr, "DIFFER : TYPE OF VARIABLE \"%s%s\" : %s <> %s\n", getGroupPath(), opts->cmpvarlist[i], str1, str2);
2974 cmpstatus = nccmpdatarecvar(ncid1, ncid2, opts->cmpvarlist[i], opts, 0, nrec1 - 1, user_types1, user_types2);
3138 printf("DIFFER : GROUP : %s%s : Does not exist in file 2\n", getGroupPath(), groupNames1[i].c_str());
3154 printf("DIFFER : GROUP : %s%s : Does not exist in file 1\n", getGroupPath(), groupNames1[i].c_str());
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
int cmp_vartol_ut(void *P1, void *P2, int offset1, int offset2, int size1, int size2, char *name, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
Definition: nccmp.cpp:381
int cmp_var_ut(int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
Definition: nccmp.cpp:294
int strlistsd(char **list1, char **list2, char **listdiff, int n1, int n2, int nsd)
Definition: strlist.c:198
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
Definition: CMakeLists.txt:7
float f1(float x)
void freevarinfo(int nuser_types, nccmp_user_type_t *comp_types)
Definition: nccmp.cpp:1568
int cmpvar(char *name, int rec, nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2241
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
nccmp_user_type_t * getvarinfo(int ncid, varstruct *vars, int *nvars, int verbose, int *nuser_types)
Definition: nccmp.cpp:1489
int excludevars(int ncid1, int ncid2, char **finallist, int nfinal, char **excludelist, int nexclude)
Definition: nccmp.cpp:488
int nccmpdatarecvartol(int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2783
int nccmpdatarecvar(int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2804
float f2(float y)
void getidxstr(varstruct *var, size_t *start, int curidx, char *out)
Definition: nccmp.cpp:457
int nccmpdatatol(int ncid1, int ncid2, nccmpopts *opts, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2824
int cmpattval(int nc1, int nc2, int varid1, int varid2, char *name, int len, nc_type type)
Definition: nccmp.cpp:908
int cmpatt(int ncid1, int ncid2, int varid1, int varid2, char *name, char *varname, nccmpopts *opts)
Definition: nccmp.cpp:809
void getidxstr_fortran(varstruct *var, size_t *start, int curidx, char *out)
Definition: nccmp.cpp:473
void prettyprintatt(int ncid, char *varname, int varid, char *name, char *str)
Definition: nccmp.cpp:582
int nccmpdata(nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2883
void getgroupinfo(int ncid, vector< string > names, GROUP_NODE *groups)
Definition: nccmp.cpp:1327
int appendstringtolist(char ***list, const char *string, int *nitems)
Definition: strlist.c:152
instead the metadata field ProcessingEnvinronment is filled in from the output of a call to the POSIX compliant function uname from within the L1B code A small bug in L1B_Tables an incorrect comparison of RVS coefficients for TEBs to RVS coefficients for RSBs was being made This was replaced with a comparison between TEB coefficients This error never resulted in an incorrect RVS correction but did lead to recalculating the coefficients for each detector in a thermal band even if the coefficients were the same for all detectors To reduce to overall size of the reflective LUT HDF fill values were eliminated from all LUTs previously dimensioned where and where NUM_TIMES is the number of time dependent table pieces In Preprocess a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed This counter is internal only and is not yet used for any chiefly to casting of were added to make it LINUX compatible Output of code run on LINUX machines displays differences of at most scaled sector incalculable values of the Emissive calibration factor and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal c since none of these quantities are frame dependent Initialization of b1 and XMS values in Preprocess c routine Process_OBCENG_Emiss was moved inside the detector loops The code was altered so that if up to five scans are dropped between the leading middle or middle trailing the leading or trailing granule will still be used in emissive calibration to form a cross granule average QA bits and are set for a gap between the leading middle and middle trailing granules respectively This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule A small bug in the Band correction algorithm was corrected an uncertainty value was being checked against an upper bound whereas the proper quantity to be checked was the corresponding which is the product of the Band radiance times the ratio of the Band to Band scaling factors times the LUT correction value for that detector In addition a new LUT which allows for a frame offset with regard to the Band radiance was added A LUT which switches the correction off or on was also added Changes which do not affect scientific output of the the pixel is flagged with the newly created flag and the number of pixels for which this occurs is counted in the QA_common table The array of b1s in Preprocess c was being initialized to outside the loop over which meant that if b1 could not be the value of b1 from the previous band for that scan detector combination was used The initialization was moved inside the band loop Minor code changes were made to eliminate compiler warnings when the code is compiled in bit mode Temperature equations were upgraded to be MODIS AQUA or MODIS TERRA specific and temperature conversion coefficients for AQUA were MOD_PR02 will not cease execution if the value of this parameter is not but will print a message
Definition: HISTORY.txt:644
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE fields
Definition: HISTORY.txt:400
int cmpvartol(char *name, int rec, nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
Definition: nccmp.cpp:2538
Definition: nccmp_user_type.h:13
subroutine diff(x, conec, n, dconecno, dn, dconecmk, units, u, inno, i, outno, o, input, deriv)
Definition: ffnet.f:205
nccmp_user_type_t * nccmp_load_group_usertype_array(int group_id, int *nuser_types)
Definition: nccmp_user_type.c:15
Definition: nccmp.h:62
#define BROADCAST_MISSING(T)
HISTORY txt for MOD_PR01(step one of PGE01) History follows the following convention needed due to new Aqua ReprocessingActual and the expected LUT revision number from PCF Changed to use PGE version for ProductionHistory Added Archive including ProcessingEnvironment Corrected handling of bad to resovle GSFcd02514 Changed to check staged LUT revision number versus the expected LUT revision number from thereby resolving defect report MODxl02056 This change also avoids the memory access violation reported in MODur00039 Changed the way output arrays were initialized with fill values
Definition: HISTORY.txt:162
int isinvarstructlist(char *name, varstruct *vars, int nvars)
Definition: nccmp.cpp:1582
Definition: names.f90:1
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame the required RAM for each execution is MB on the DEC ALPHA and MB on the SGI Octane v2
Definition: HISTORY.txt:728
int cmp_var(int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
Definition: nccmp.cpp:126
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT and to use it determine the correct files to retrieve the ephemeris and attitude data from Changed to produce a LocalGranuleID starting with MYD03 if run on Aqua data Added the Scan Type file attribute to the Geolocation copied from the L1A and attitude_angels to radians rather than degrees The accumulation of Cumulated gflags was moved from GEO_validate_earth_location c to GEO_locate_one_scan c
Definition: HISTORY.txt:464
int strlistu(char **list1, char **list2, char **listunion, int n1, int n2, int nu)
Definition: strlist.c:171
char get_missing(int ncid, varstruct *var, const char *attname)
Definition: nccmp.cpp:1424
void broadcast_missing(nc_type var_type, nc_type att_type, missing_struct *values)
Definition: nccmp.cpp:1380
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
int cmp_vartol(int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
Definition: nccmp.cpp:213