diff --git a/libdap2/Make0 b/libdap2/Make0 index 096f2097b..59d04e258 100755 --- a/libdap2/Make0 +++ b/libdap2/Make0 @@ -258,7 +258,7 @@ fix:: done ################################################## -T=vars_whoi_test +T=test_nstride_cached v:: cc -g -c ${T}.c ${INCL} diff --git a/libdap2/dapdebug.h b/libdap2/dapdebug.h index a43df0282..92a51a2aa 100644 --- a/libdap2/dapdebug.h +++ b/libdap2/dapdebug.h @@ -7,7 +7,7 @@ #define DEBUG_H -#if 1 +#if 0 #define DAPDEBUG 1 #define OCDEBUG #endif diff --git a/ncdap_test/test_nstride_cached.c b/ncdap_test/test_nstride_cached.c index 4c080ba2f..d82cdd432 100644 --- a/ncdap_test/test_nstride_cached.c +++ b/ncdap_test/test_nstride_cached.c @@ -32,7 +32,7 @@ Problem was two-fold: /* vars_whoi_test */ /* acm 4/2013 */ /* ansley.b.manke@noaa.gov */ -/* + /* test nc_get_vars_float with calls similar to Ferret calls */ @@ -54,9 +54,9 @@ incorrect data return */ #include #include "netcdf.h" -static int coords = 0; +static int verbose = 0; -static char* URL="[noprefetch]http://geoport.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd"; +static char* URL="http://geoport.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd"; int main() @@ -68,6 +68,7 @@ main() int ncstatus; size_t start[5], count[5]; ptrdiff_t stride[5], tmp_ptrdiff_t; + int pass = 1; int idim, ndim; float dat[301060]; @@ -88,6 +89,11 @@ main() ncstatus = nc_open(URL, NC_NOWRITE, &ncid); + if(ncstatus != NC_NOERR) { + fprintf(stderr,"Could not open: %s; server may be down; test ignored\n",URL); + exit(0); + } + ncstatus = nc_inq_varid(ncid, "lon_rho", &varid); printf("varid = %d\n", varid); @@ -112,13 +118,15 @@ main() stride[0] = 1; stride[1] = 1; +if(verbose) { for (idim=0; idim -68)) { + printf("lon_rho[%d] = %f\n",i,sdat[i]); + pass = 0; + } + } +if(verbose) { printf(" \n"); printf("********************\n"); printf("Print values read. They should all be -67.xxxx \n"); @@ -227,7 +247,16 @@ if(coords) { for (i=0; i<10; i++) printf("lon_rho[%d] = %f\n",i,sdat[i]); +} ncstatus = nc_close (ncid); + if(!pass) { + printf("*** FAIL: lon_rho value out of range.\n"); + exit(1); + } + + printf("*** PASS\n"); + exit(0); + }