add extra debug about findbod

This commit is contained in:
Dennis Heimbigner 2012-08-17 20:51:03 +00:00
parent 8d53da4826
commit 685e1bf66a
3 changed files with 24 additions and 3 deletions

View File

@ -17,10 +17,11 @@ F="http://motherlode.ucar.edu:8081/dts/$T?f64"
#F="http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/coads_climatology.nc"
#F="http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120801/gfs_hd_00z"
#F="http://hycom.coaps.fsu.edu/thredds/dodsC/atl_ops"
F="http://ferret.pmel.noaa.gov/geoide/dodsC/PSDgriddedData/ncep.reanalysis.dailyavgs/surface/slp_aggregated"
CON="slp.slp[23255:23316][29:29][88:88]"
#VAR=f64
F="http://phy-51.io-warnemuende.de/thredds/dodsC/baltic/region_test_2005_netcdf3.nc"
CON="temp[9:9][0:0][55:153][180:180]"
VAR=f64
#PARMS="[log]"
#PARMS="${PARMS}[netcdf3]"
@ -101,6 +102,8 @@ F="http://motherlode.ucar.edu:8080/thredds/dodsC/station/metar/Surface_METAR_201
CON="weather[0:10]"
F="http://nomad1.ncep.noaa.gov:9090/dods/reanalyses/reanalysis-1/6hr/pgb/pgb"
VAR=hgtprs
F="http://ferret.pmel.noaa.gov/geoide/dodsC/PSDgriddedData/ncep.reanalysis.dailyavgs/surface/slp_aggregated"
CON="slp.slp[23255:23316][29:29][88:88]"
fi

View File

@ -405,10 +405,17 @@ ocextractddsinmemory(OCstate* state, OCtree* tree, OCflags flags)
OCerror stat = OC_NOERR;
size_t ddslen, bod, bodfound;
/* Read until we find the separator (or EOF)*/
#ifdef OCDEBUG
fprintf(stderr,"ocextractddsinmemory:\n");
#endif
bodfound = ocfindbod(state->packet,&bod,&ddslen);
if(!bodfound) {/* No BOD; pretend */
bod = tree->data.bod;
ddslen = tree->data.datasize;
#ifdef OCDEBUG
fprintf(stderr,"missing bod: bod=%lu ddslen=%lu\n",
(unsigned long)*ddslen,(unsigned long)*bod);
#endif
}
tree->data.bod = bod;
tree->data.ddslen = ddslen;
@ -441,6 +448,9 @@ ocextractddsinfile(OCstate* state, OCtree* tree, OCflags flags)
OCerror stat = OC_NOERR;
size_t ddslen, bod, bodfound;
#ifdef OCDEBUG
fprintf(stderr,"ocextractddsinfile:\n");
#endif
/* Read until we find the separator (or EOF)*/
ocbytesclear(state->packet);
rewind(tree->data.file);
@ -457,6 +467,10 @@ ocextractddsinfile(OCstate* state, OCtree* tree, OCflags flags)
if(!bodfound) {/* No BOD; pretend */
bod = tree->data.bod;
ddslen = tree->data.datasize;
#ifdef OCDEBUG
fprintf(stderr,"missing bod: bod=%lu ddslen=%lu\n",
(unsigned long)*ddslen,(unsigned long)*bod);
#endif
}
tree->data.bod = bod;
tree->data.ddslen = ddslen;

View File

@ -134,6 +134,10 @@ ocfindbod(OCbytes* buffer, size_t* bodp, size_t* ddslenp)
*ddslenp = i;
i += tlen;
*bodp = i;
#ifdef OCDEBUG
fprintf(stderr,"findbod: buf.len=%lu bod=%lu ddslen=%lu\n",
(unsigned long)len,(unsigned long)*ddslenp,(unsigned long)*bodp);
#endif
return 1;
}
}