/*! \file Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 University Corporation for Atmospheric Research/Unidata. See \ref copyright file for more info. */ /* Create a netcdf-4 file with a large variable for the purpose of doing performance test on the new NC4_get/put_vars functions. WARNING: do not attempt to run this under windows because of the use of gettimeofday(). WARNING: This test can only be run manually and should not be run as part of the testsuite. */ #include "config.h" #include #include #include #include #include "netcdf.h" #include "nc4dispatch.h" #include "err_macros.h" #define FILE "tst_varsperf_bigvars.nc" #define VAR "bigvar" #define NDIMS 2 #define DIM0 "d0" #define DIM1 "d1" #define DIMSIZE0 512 #define DIMSIZE1 512 #define TOTALSIZE (DIMSIZE0*DIMSIZE1) static int data[TOTALSIZE]; static int read[TOTALSIZE]; int buildfile(void) { int ncid, varid; int dimids[NDIMS]; int* p; int index; if(nc_create(FILE, NC_NETCDF4, &ncid)) ERR; if(nc_def_dim(ncid,DIM0,(size_t)DIMSIZE0,&dimids[0])) ERR; if(nc_def_dim(ncid,DIM1,(size_t)DIMSIZE1,&dimids[1])) ERR; if(nc_def_var(ncid,VAR,NC_INT,NDIMS,dimids,&varid)) ERR; if(nc_enddef(ncid)) ERR; for(p=data,index=0;index