Skip to content

Commit

Permalink
more progress
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Jun 24, 2024
1 parent 0c4700c commit 07c0da3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/g2cindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,9 @@ g2c_open_index(const char *data_file, const char *index_file, int mode,
* data read operations. So we will use the
* open data file and get the length of this
* section. */
if (fseek(g2c_file[*g2cid].f, msgp->bytes_to_msg + data, SEEK_SET))
LOG((4, "seeking to section 7 in data file, position msgp->bytes_to_msg %ld data %ld",
msgp->bytes_to_msg, data8));
if (fseek(g2c_file[*g2cid].f, msgp->bytes_to_msg + data8, SEEK_SET))
{
ret = G2C_EFILE;
break;
Expand Down Expand Up @@ -1104,6 +1106,8 @@ g2c_open_index(const char *data_file, const char *index_file, int mode,
/* Read the section info from the index file,
* using the same functions that read it from the
* GRIB2 data file. */
LOG((4, "about to add_section sec_id %d sec_len %d bytes_to_sec %ld, s %d",
sec_id, sec_len, bytes_to_sec, s));
if ((ret = add_section(f, msgp, sec_id++, sec_len, bytes_to_sec, s)))
break;
} /* next section */
Expand Down
2 changes: 1 addition & 1 deletion tests/run_large_index_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "*** Running g2c_index large file test"
../utils/g2c_index -o fv3lam.t00z.prslev.f000.grib2.idx -l -v data/fv3lam.t00z.prslev.f000.grib2

# Summarize the index data.
#../utils/g2c_degrib2 -o fv3lam.t00z.prslev.f000.grib2.idx.degrib2 data/fv3lam.t00z.prslev.f000.grib2 fv3lam.t00z.prslev.f000.grib2.idx
../utils/g2c_degrib2 -o fv3lam.t00z.prslev.f000.grib2.idx.degrib2 data/fv3lam.t00z.prslev.f000.grib2 fv3lam.t00z.prslev.f000.grib2.idx

# Check against expected output.
#diff -w fv3lam.t00z.prslev.f000.grib2.idx.degrib2 data/ref_fv3lam.t00z.prslev.f000.grib2.degrib2
Expand Down
2 changes: 1 addition & 1 deletion utils/g2c_degrib2.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ main(int argc, char **argv)
/* Turn on logging for verbose output. This only has effect if the
* library was built with LOGGING=ON. */
if (verbose)
g2c_set_log_level(1);
g2c_set_log_level(4);

/* If we got one input file, open it. If we got two input files,
* the second is an index file for the first. */
Expand Down

0 comments on commit 07c0da3

Please sign in to comment.