From 685e1bf66a92c916814c8b9bd8d416bf48b440b3 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 17 Aug 2012 20:51:03 +0000 Subject: [PATCH] add extra debug about findbod --- libdap2/env | 9 ++++++--- oc2/ocinternal.c | 14 ++++++++++++++ oc2/ocutil.c | 4 ++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/libdap2/env b/libdap2/env index 435b7df33..cb81ec469 100644 --- a/libdap2/env +++ b/libdap2/env @@ -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 diff --git a/oc2/ocinternal.c b/oc2/ocinternal.c index 0fceee402..744f4232a 100644 --- a/oc2/ocinternal.c +++ b/oc2/ocinternal.c @@ -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; diff --git a/oc2/ocutil.c b/oc2/ocutil.c index 1833cf0e0..a6ff4689b 100644 --- a/oc2/ocutil.c +++ b/oc2/ocutil.c @@ -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; } }