From 763750fab5660983c7531c86bd81befe0692d872 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 6 Dec 2018 14:56:42 -0700 Subject: [PATCH] More copyright stanza updates. --- libsrc4/CMakeLists.txt | 6 ++ libsrc4/Makefile.am | 7 +- libsrc4/error4.c | 15 +-- libsrc4/nc4printer.c | 19 ++-- libsrc4/nc4var.c | 2 +- libsrc4/ncfunc.c | 4 +- libsrc4/ncindex.c | 12 +-- libsrcp/CMakeLists.txt | 7 ++ libsrcp/Makefile.am | 4 +- libsrcp/ncpdispatch.c | 2 +- nc_test/CMakeLists.txt | 7 ++ nc_test/Makefile.am | 2 +- nc_test/error.c | 2 +- nc_test/error.h | 2 +- nc_test/large_files.c | 2 +- nc_test/nc_test.c | 2 +- nc_test/quick_large_files.c | 2 +- nc_test/t_nc.c | 2 +- nc_test/t_nc_p5.c | 44 ++++----- nc_test/testnc3perf.c | 34 +++---- nc_test/tests.h | 2 +- nc_test/tst_addvar.c | 11 +++ nc_test/tst_atts3.c | 2 +- nc_test/tst_big_rvar.c | 2 +- nc_test/tst_big_var.c | 2 +- nc_test/tst_big_var2.c | 2 +- nc_test/tst_big_var6.c | 2 +- nc_test/tst_cdf5_begin.c | 14 ++- nc_test/tst_cdf5format.c | 22 ++--- nc_test/tst_def_var_fill.c | 3 +- nc_test/tst_default_format.c | 11 +++ nc_test/tst_default_format_pnetcdf.c | 11 +++ nc_test/tst_diskless.c | 2 +- nc_test/tst_diskless2.c | 11 +++ nc_test/tst_diskless3.c | 2 +- nc_test/tst_diskless4.c | 2 +- nc_test/tst_diskless5.c | 11 +++ nc_test/tst_diskless6.c | 13 ++- nc_test/tst_err_enddef.c | 11 +++ nc_test/tst_formats.c | 6 +- nc_test/tst_formatx_pnetcdf.c | 4 +- nc_test/tst_global_fillval.c | 2 +- nc_test/tst_inmemory.c | 2 +- nc_test/tst_inq_type.c | 3 +- nc_test/tst_large.c | 2 +- nc_test/tst_large_cdf5.c | 2 +- nc_test/tst_max_var_dims.c | 12 ++- nc_test/tst_meta.c | 2 +- nc_test/tst_misc.c | 10 +- nc_test/tst_names.c | 2 +- nc_test/tst_nofill.c | 2 +- nc_test/tst_nofill2.c | 2 +- nc_test/tst_nofill3.c | 2 +- nc_test/tst_norm.c | 2 +- nc_test/tst_open_cdf5.c | 11 +++ nc_test/tst_open_mem.c | 17 +++- nc_test/tst_parallel2.c | 47 ++++++---- nc_test/tst_pnetcdf.c | 2 +- nc_test/tst_small.c | 2 +- nc_test/tst_utf8_phrases.c | 2 +- nc_test/tst_utf8_validate.c | 132 +++++++++++++-------------- nc_test/util.c | 2 +- 62 files changed, 363 insertions(+), 220 deletions(-) diff --git a/libsrc4/CMakeLists.txt b/libsrc4/CMakeLists.txt index f54d652c3e..59aabbb45a 100644 --- a/libsrc4/CMakeLists.txt +++ b/libsrc4/CMakeLists.txt @@ -1,3 +1,9 @@ +# 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 netcdf-c/COPYRIGHT file for more info. # Process these files with m4. SET(libsrc4_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4grp.c nc4type.c nc4var.c ncfunc.c nc4internal.c ncindex.c ) diff --git a/libsrc4/Makefile.am b/libsrc4/Makefile.am index 0c59d6ae8e..1a3d6c842f 100644 --- a/libsrc4/Makefile.am +++ b/libsrc4/Makefile.am @@ -1,4 +1,4 @@ -# This is part of Unidata's netCDF package. Copyright 2005-2011, see +# This is part of Unidata's netCDF package. Copyright 2005-2018, see # the COPYRIGHT file for more information. # This automake file generates the Makefile to build netCDF-4. @@ -15,8 +15,3 @@ nc4internal.c nc4type.c nc4var.c ncfunc.c error4.c nc4printer.c \ ncindex.c EXTRA_DIST = CMakeLists.txt - - - - - diff --git a/libsrc4/error4.c b/libsrc4/error4.c index bdd2345a55..7db7f4b776 100644 --- a/libsrc4/error4.c +++ b/libsrc4/error4.c @@ -1,4 +1,6 @@ -/* Copyright 2003-2018, University Corporation for Atmospheric +/*! \file + +Copyright 2003-2018, University Corporation for Atmospheric Research. See netcdf-4/docs/COPYRIGHT file for copying and redistribution conditions. */ /** @@ -8,7 +10,7 @@ redistribution conditions. */ * * This file contains functions relating to logging errors. Also it * contains the functions nc_malloc, nc_calloc, and nc_free. - * + * * @author Ed Hartnett */ @@ -28,7 +30,7 @@ extern int nc_log_level; /* This function prints out a message, if the severity of the message is lower than the global nc_log_level. To use it, do something like this: - + nc_log(0, "this computer will explode in %d seconds", i); After the first arg (the severity), use the rest like a normal @@ -36,7 +38,7 @@ extern int nc_log_level; This function is heavily based on the function in section 15.5 of the C FAQ. */ -void +void nc_log(int severity, const char *fmt, ...) { va_list argp; @@ -58,17 +60,16 @@ nc_log(int severity, const char *fmt, ...) va_start(argp, fmt); vfprintf(stderr, fmt, argp); va_end(argp); - + /* Put on a final linefeed. */ fprintf(stderr, "\n"); fflush(stderr); } -void +void nc_log_hdf5(void) { H5Eprint(NULL); } #endif /* ifdef LOGGING */ - diff --git a/libsrc4/nc4printer.c b/libsrc4/nc4printer.c index 0596b0f0b9..641eff92bc 100644 --- a/libsrc4/nc4printer.c +++ b/libsrc4/nc4printer.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 2016, UCAR/Unidata + * Copyright 2018, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. *********************************************************************/ @@ -17,7 +17,7 @@ create other tools. #include "ncbytes.h" #include "nclist.h" -#undef DEBUG +#undef DEBUG #define BUFSIZE 4096 @@ -148,7 +148,7 @@ freeNC4Printer(NC4printer* out) { int i; - if(out == NULL) return; + if(out == NULL) return; #ifdef DEBUG fprintf(stderr,"free: |allnodes=%ld\n",nclistlength(out->allnodes)); @@ -206,7 +206,7 @@ printNode(NC4printer* out, NCID* node, int depth) switch (node->sort) { case GROUP: - /* Get group name */ + /* Get group name */ if((ret=nc_inq_grpname(node->id,name))) FAIL; SETNAME(node,name); /* get group counts */ @@ -304,7 +304,7 @@ printNode(NC4printer* out, NCID* node, int depth) printXMLAttributeName(out, "name", node->name); printXMLAttributeSize(out, "size", node->size); CAT("/>"); - break; + break; case NC_ENUM: if((ret=nc_inq_enum(GROUPOF(node),node->id,NULL,NULL,NULL,&count))) FAIL; INDENT(depth); CAT("base = findType(out,base); id->size = count; - printAttribute(out,id,depth); + printAttribute(out,id,depth); CAT("\n"); } depth--; @@ -636,7 +636,7 @@ makeFQN(NCID* id, NCbytes* path) fqnWalk(g,path); ncbytesappend(path,'/'); if(id->sort != GROUP) - ncbytescat(path,id->name); + ncbytescat(path,id->name); ncbytesnull(path); } @@ -646,7 +646,7 @@ fqnWalk(NCID* grp, NCbytes* path) if(grp->id != 0) { NCID* parent = grp->parent; fqnWalk(parent,path); - ncbytesappend(path,'/'); + ncbytesappend(path,'/'); ncbytescat(path,parent->name); } } @@ -738,7 +738,7 @@ printString(NCbytes* out, const char* s, int quotes) if(c == '\\') ncbytescat(out,"\\\\"); else if(c == '"') ncbytescat(out,"\\\""); else ncbytesappend(out,c); - } + } if(quotes) ncbytesappend(out,'"'); ncbytesnull(out); } @@ -783,4 +783,3 @@ readAttributeValues(NCID* attr, void** valuesp) if(valuesp) *valuesp = values; return ret; } - diff --git a/libsrc4/nc4var.c b/libsrc4/nc4var.c index 6d242c4443..d2b8c357c9 100644 --- a/libsrc4/nc4var.c +++ b/libsrc4/nc4var.c @@ -1,4 +1,4 @@ -/* Copyright 2003-2006, University Corporation for Atmospheric +/* Copyright 2003-2018, University Corporation for Atmospheric * Research. See COPYRIGHT file for copying and redistribution * conditions.*/ /** diff --git a/libsrc4/ncfunc.c b/libsrc4/ncfunc.c index 8cd0d58c04..714867d9ce 100644 --- a/libsrc4/ncfunc.c +++ b/libsrc4/ncfunc.c @@ -1,7 +1,7 @@ /** * @internal * - * Copyright 2003, University Corporation for Atmospheric + * Copyright 2018, University Corporation for Atmospheric * Research. See netcdf-4/docs/COPYRIGHT file for copying and * redistribution conditions. * @@ -82,7 +82,7 @@ NC4_inq_format_extended(int ncid, int *formatp, int *modep) if(modep) *modep = nc->mode|NC_NETCDF4; - if (formatp) + if (formatp) *formatp = NC_FORMATX_NC_HDF5; return NC_NOERR; diff --git a/libsrc4/ncindex.c b/libsrc4/ncindex.c index 54f27be424..e76b005f4a 100644 --- a/libsrc4/ncindex.c +++ b/libsrc4/ncindex.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2017 University Corporation for Atmospheric Research/Unidata +Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata See LICENSE.txt for license information. */ @@ -176,7 +176,7 @@ also recompute their hashkey. /* Return 1 if ok, 0 otherwise.*/ int ncindexrebuild(NCindex* index) -{ +{ #ifndef NCNOHASH size_t i; size_t size = nclistlength(index->list); @@ -196,7 +196,7 @@ ncindexrebuild(NCindex* index) } #endif if(contents != NULL) free(contents); - return 1; + return 1; } /* Free a list map */ @@ -206,7 +206,7 @@ ncindexfree(NCindex* index) if(index == NULL) return 1; nclistfree(index->list); NC_hashmapfree(index->map); - free(index); + free(index); return 1; } @@ -235,7 +235,7 @@ keystr(NC_hentry* e) { if(e->keysize < sizeof(uintptr_t)) return (const char*)(&e->key); - else + else return (const char*)(e->key); } #endif @@ -253,7 +253,7 @@ ncindexverify(NCindex* lm, int dump) if(lm == NULL) { fprintf(stderr,"index: \n"); return 1; - } + } if(dump) { fprintf(stderr,"-------------------------\n"); #ifndef NCNOHASH diff --git a/libsrcp/CMakeLists.txt b/libsrcp/CMakeLists.txt index 7d8ab9cf37..adf1d34136 100644 --- a/libsrcp/CMakeLists.txt +++ b/libsrcp/CMakeLists.txt @@ -1,3 +1,10 @@ +# 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 netcdf-c/COPYRIGHT file for more info. + SET(libsrcp_SOURCES ncpdispatch.c) add_library(netcdfp OBJECT ${libsrcp_SOURCES}) diff --git a/libsrcp/Makefile.am b/libsrcp/Makefile.am index 0747f35e9c..58f3d8e10d 100644 --- a/libsrcp/Makefile.am +++ b/libsrcp/Makefile.am @@ -1,5 +1,5 @@ ## This is an automake file, part of Unidata's netCDF package. -# Copyright 2005, see the COPYRIGHT file for more information. +# Copyright 2018, see the COPYRIGHT file for more information. # This automake file is in charge of building the libsrc directory, # which contains the classic library code. @@ -16,4 +16,4 @@ libnetcdfp_la_SOURCES = ncpdispatch.c noinst_LTLIBRARIES = libnetcdfp.la -EXTRA_DIST = CMakeLists.txt +EXTRA_DIST = CMakeLists.txt diff --git a/libsrcp/ncpdispatch.c b/libsrcp/ncpdispatch.c index 0eb490e609..765a628a5f 100644 --- a/libsrcp/ncpdispatch.c +++ b/libsrcp/ncpdispatch.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1993, UCAR/Unidata + * Copyright 2018, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. *********************************************************************/ diff --git a/nc_test/CMakeLists.txt b/nc_test/CMakeLists.txt index 0e5c94d1c4..4f75ed6030 100644 --- a/nc_test/CMakeLists.txt +++ b/nc_test/CMakeLists.txt @@ -1,3 +1,10 @@ +# 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 netcdf-c/COPYRIGHT file for more info. + message(STATUS "CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}") message(STATUS "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}") message(STATUS "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am index 23e16db048..cb84766495 100644 --- a/nc_test/Makefile.am +++ b/nc_test/Makefile.am @@ -1,5 +1,5 @@ ## This is a automake file, part of Unidata's netCDF package. -# Copyright 2005, see the COPYRIGHT file for more information. +# Copyright 2018, see the COPYRIGHT file for more information. # This file builds and runs the nc_test program, which tests the # netCDF-3 API for all formats. diff --git a/nc_test/error.c b/nc_test/error.c index 2d502ca0e5..3111a31f85 100644 --- a/nc_test/error.c +++ b/nc_test/error.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1996, UCAR/Unidata + * Copyright 2018, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. * $Id: error.c,v 1.7 2007/05/15 01:36:57 ed Exp $ *********************************************************************/ diff --git a/nc_test/error.h b/nc_test/error.h index f8ccf3b062..6e6a10edc8 100644 --- a/nc_test/error.h +++ b/nc_test/error.h @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1993, University Corporation for Atmospheric Research + * Copyright 2018, University Corporation for Atmospheric Research * See netcdf/COPYRIGHT file for copying and redistribution conditions. * $Header $ *********************************************************************/ diff --git a/nc_test/large_files.c b/nc_test/large_files.c index a723c81c1b..114fa3d2fd 100644 --- a/nc_test/large_files.c +++ b/nc_test/large_files.c @@ -1,5 +1,5 @@ /* - Copyright 2004-2006, UCAR/Unidata + Copyright 2004-2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. diff --git a/nc_test/nc_test.c b/nc_test/nc_test.c index 9e5490e82f..c421122b4a 100644 --- a/nc_test/nc_test.c +++ b/nc_test/nc_test.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1996-2005, UCAR/Unidata + * Copyright 1996-2018, UCAR/Unidata * See COPYRIGHT file for copying and redistribution conditions. * $Id: nc_test.c 2796 2014-10-28 03:40:29Z wkliao $ *********************************************************************/ diff --git a/nc_test/quick_large_files.c b/nc_test/quick_large_files.c index 913916c042..04d7eac240 100644 --- a/nc_test/quick_large_files.c +++ b/nc_test/quick_large_files.c @@ -1,5 +1,5 @@ /* - Copyright 2004-2006, UCAR/Unidata + Copyright 2004-2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program (quickly, but not thoroughly) tests the large file diff --git a/nc_test/t_nc.c b/nc_test/t_nc.c index 2b6a78f9e9..7fdc285208 100644 --- a/nc_test/t_nc.c +++ b/nc_test/t_nc.c @@ -1,4 +1,4 @@ -/* Copyright 1988-2010 University Corporation for Atmospheric Research +/* Copyright 1988-2018 University Corporation for Atmospheric Research See netcdf/COPYRIGHT file for copying and redistribution conditions. diff --git a/nc_test/t_nc_p5.c b/nc_test/t_nc_p5.c index 728783f0b0..82ce46e72e 100644 --- a/nc_test/t_nc_p5.c +++ b/nc_test/t_nc_p5.c @@ -1,14 +1,14 @@ -/* Copyright 1988-2010 University Corporation for Atmospheric Research +/* Copyright 1988-2018 University Corporation for Atmospheric Research See netcdf/COPYRIGHT file for copying and redistribution conditions. Program to create a cdf, exercise all cdf functions. Creates cdf, stuff it full of numbers, closes it. Then reopens it, and checks for consistency. Leaves the file around afterwards. - + Based on a program to test the nasa look-alike program, so not the most appropriate test. See ../nctest for a complete spec test. - + $Id: t_nc.c 2792 2014-10-27 06:02:59Z wkliao $ */ #define REDEF @@ -199,32 +199,32 @@ createtestvars(int id, const struct tcdfvar *testvars, size_t count) { assert(nc_def_var(id, vp->mnem, vp->type, vp->ndims, vp->dims, &varid) - == NC_NOERR ); + == NC_NOERR ); assert( nc_put_att_text(id,ii,reqattr[0],strlen(vp->units), vp->units) - == NC_NOERR); + == NC_NOERR); assert( nc_put_att_double(id,ii,reqattr[1],NC_DOUBLE,1, &vp->validmin) - == NC_NOERR); + == NC_NOERR); assert( nc_put_att_double(id,ii,reqattr[2],NC_DOUBLE,1, &vp->validmax) - == NC_NOERR); + == NC_NOERR); assert( nc_put_att_double(id,ii,reqattr[3],NC_DOUBLE,1, &vp->scalemin) - == NC_NOERR); + == NC_NOERR); assert( nc_put_att_double(id,ii,reqattr[4],NC_DOUBLE,1, &vp->scalemax) - == NC_NOERR); + == NC_NOERR); assert( nc_put_att_text(id,ii,reqattr[5],strlen(vp->fieldnam), vp->fieldnam) - == NC_NOERR); + == NC_NOERR); } } @@ -256,7 +256,7 @@ fill_seq(int id) { size_t *cc = vindices; while (cc < &vindices[num_dims]) - *cc++ = 0; + *cc++ = 0; } sizes[0] = NUM_RECS; @@ -277,7 +277,7 @@ check_fill_seq(int id) sizes[0] = NUM_RECS; cc = vindices; while (cc < &vindices[num_dims]) - *cc++ = 0; + *cc++ = 0; /* ripple counter */ cc = vindices; @@ -288,7 +288,7 @@ check_fill_seq(int id) { if (mm == &sizes[num_dims - 1]) { - if(nc_get_var1_float(id, Float_id, vindices, &got.fl[0]) == -1) + if(nc_get_var1_float(id, Float_id, vindices, &got.fl[0]) == -1) goto bad_ret; /* val = (float) ii; */ /* if(val != got.fl[0]) */ @@ -366,7 +366,7 @@ main(int argc, char *argv[]) fprintf(stderr,"Error %s in file %s at line %d\n",nc_strerror(ret),__FILE__,__LINE__); exit(ret); } - + assert( nc_put_att_text(id, NC_GLOBAL, "TITLE", 12, "another name") == NC_NOERR); assert( nc_get_att_text(id, NC_GLOBAL, @@ -383,7 +383,7 @@ main(int argc, char *argv[]) createtestdims(id, NUM_DIMS, sizes, dim_names); testdims(id, NUM_DIMS, sizes, dim_names); - createtestvars(id, testvars, NUM_TESTVARS); + createtestvars(id, testvars, NUM_TESTVARS); { int ifill = -1; double dfill = -9999; @@ -395,7 +395,7 @@ main(int argc, char *argv[]) #ifdef REDEF assert( nc__enddef(id, 0, align, 0, 2*align) == NC_NOERR ); - assert( nc_put_var1_int(id, Long_id, indices[3], &birthday) + assert( nc_put_var1_int(id, Long_id, indices[3], &birthday) == NC_NOERR ); fill_seq(id); assert( nc_redef(id) == NC_NOERR ); @@ -473,7 +473,7 @@ main(int argc, char *argv[]) /* (void) printf("reopen id = %d for filename %s\n", */ /* id, fname); */ - /* NC */ + /* NC */ /* (void) printf("NC "); */ assert( nc_inq(id, &(cdesc->num_dims), &(cdesc->num_vars), &(cdesc->num_attrs), &(cdesc->xtendim) ) == NC_NOERR); @@ -481,7 +481,7 @@ main(int argc, char *argv[]) assert(cdesc->num_attrs == 1); assert(cdesc->num_vars == NUM_TESTVARS); /* (void) printf("done\n"); */ - + /* GATTR */ /* (void) printf("GATTR "); */ @@ -498,7 +498,7 @@ main(int argc, char *argv[]) /* (void) printf("VAR "); */ assert( cdesc->num_vars == NUM_TESTVARS ); - for(ii = 0; ii < cdesc->num_vars; ii++, tvp++ ) + for(ii = 0; ii < cdesc->num_vars; ii++, tvp++ ) { int jj; assert( nc_inq_var(id, ii, @@ -532,7 +532,7 @@ main(int argc, char *argv[]) /* VATTR */ /* (void) printf("VATTR\n"); */ - for(jj=0; jjnum_attrs; jj++ ) + for(jj=0; jjnum_attrs; jj++ ) { assert( nc_inq_attname(id, ii, jj, adesc->mnem) == NC_NOERR); if( strcmp(adesc->mnem, reqattr[jj]) != 0 ) @@ -547,7 +547,7 @@ main(int argc, char *argv[]) != -1) { assert( adesc->type == NC_CHAR ); assert( adesc->len == strlen(tvp->units) ); - assert( nc_get_att_text(id,ii,reqattr[0],buf)== NC_NOERR); + assert( nc_get_att_text(id,ii,reqattr[0],buf)== NC_NOERR); buf[adesc->len] = 0; assert( strcmp(tvp->units, buf) == 0); } @@ -596,7 +596,7 @@ main(int argc, char *argv[]) { assert( adesc->type == NC_CHAR ); assert( adesc->len == strlen(tvp->fieldnam) ); - assert( nc_get_att_text(id,ii,reqattr[5],buf)== NC_NOERR); + assert( nc_get_att_text(id,ii,reqattr[5],buf)== NC_NOERR); buf[adesc->len] = 0; assert( strcmp(tvp->fieldnam, buf) == 0); } diff --git a/nc_test/testnc3perf.c b/nc_test/testnc3perf.c index 549f6203fa..5a51a50626 100644 --- a/nc_test/testnc3perf.c +++ b/nc_test/testnc3perf.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1989, University Corporation for Atmospheric Research + * Copyright 2018, University Corporation for Atmospheric Research * See netcdf/README file for copying and redistribution conditions. * $Header: /upc/share/CVS/netcdf-3/nctest/nctime.c,v 1.12 1996/04/30 17:56:58 davis Exp $ *********************************************************************/ @@ -66,7 +66,7 @@ static int DEFAULTDIMS[NDIMS] = {10, 20, 30, 40}; /* * Fill typed array element with specified value, that is - * + * * v[ii] = val; */ static void @@ -111,7 +111,7 @@ val_stuff(type, v, ii, val) /* v[ii] = val */ * * (v[ii] != val) * - * returns 0 if equal, 1 if not equal + * returns 0 if equal, 1 if not equal */ static int @@ -170,7 +170,7 @@ val_diff(type, v, ii, val) /* v[ii] != val */ clock_t TMus, TMsy; /* user and system time in clock ticks */ \ float TMelapsed; /* elapsed time in seconds */ \ struct tms TMru; - + #define TIMING_START \ TMrepeats = 1; \ do { /* loop enough times for at least 0.1 second elapsed time */ \ @@ -179,7 +179,7 @@ val_diff(type, v, ii, val) /* v[ii] != val */ TMus = TMru.tms_utime; \ TMsy = TMru.tms_stime; \ for(TMreps=0;TMreps < TMrepeats;TMreps++) { - + #define TIMING_END \ } \ times(&TMru); \ @@ -231,7 +231,7 @@ test_slabs(ncid, sizes) dims[idim].size = sizes[idim]; dims[idim].name = dnames[idim]; } - + /* back in define mode OK, now add dimensions */ dimids[0] = ncdimdef(ncid, dims[0].name, NC_UNLIMITED); @@ -263,7 +263,7 @@ test_slabs(ncid, sizes) if (ncendef (ncid) == -1) { ncclose(ncid); return; } - + printf("Note: first ncvarput writes fill values for all variables.\n"); for (iv = 0; iv < NVARS; iv++) { /* test each type of variable */ @@ -291,7 +291,7 @@ test_slabs(ncid, sizes) } } } - + for (idim = 0; idim < NDIMS; idim++) { corner[idim] = 0; edge[idim] = dims[idim].size; @@ -319,19 +319,19 @@ test_slabs(ncid, sizes) edge[idim] = 1; point[idim] = corner[idim]; } - + sprintf(time_mess,"ncvarget %ldx%ldx%ldx%ld" ,edge[0],edge[1],edge[2],edge[3]); - + TIMING_START ; if (ncvarget(ncid, varid[iv], corner, edge, (void *) v) == -1) return; TIMING_END ; - + /* if (v[0] != VF(point)) */ if (val_diff(va[iv].type, v, 0, VF(point))) fprintf(stderr,"ncvarget got wrong value for point"); - + /* get a vector in each direction */ for (idim=0; idim < NDIMS; idim++) { for (jdim=0; jdim < NDIMS; jdim++) { @@ -370,7 +370,7 @@ test_slabs(ncid, sizes) corner[jdim] = 0; edge[idim] = dims[idim].size; edge[jdim] = dims[jdim].size; - + sprintf(time_mess,"ncvarget %ldx%ldx%ldx%ld" ,edge[0],edge[1],edge[2],edge[3]); @@ -393,7 +393,7 @@ test_slabs(ncid, sizes) } } } - + /* get a cube in each direction */ for (idim=0; idim < NDIMS; idim++) { for (jdim=idim+1; jdim < NDIMS; jdim++) { @@ -409,7 +409,7 @@ test_slabs(ncid, sizes) edge[idim] = dims[idim].size; edge[jdim] = dims[jdim].size; edge[kdim] = dims[kdim].size; - + sprintf(time_mess,"ncvarget %ldx%ldx%ldx%ld" ,edge[0],edge[1],edge[2],edge[3]); @@ -439,13 +439,13 @@ test_slabs(ncid, sizes) } } } - + /* get one 4-D slab of data */ for(idim = 0; idim < NDIMS; idim++) { corner[idim] = 0; edge[idim] = dims[idim].size; } - + sprintf(time_mess,"ncvarget %ldx%ldx%ldx%ld" ,edge[0],edge[1],edge[2],edge[3]); diff --git a/nc_test/tests.h b/nc_test/tests.h index 2e24295a5e..0eba3b8e4c 100644 --- a/nc_test/tests.h +++ b/nc_test/tests.h @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1996, UCAR/Unidata + * Copyright 2018, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. * $Id: tests.h 2785 2014-10-26 05:21:20Z wkliao $ *********************************************************************/ diff --git a/nc_test/tst_addvar.c b/nc_test/tst_addvar.c index f05a8af876..d57bb0ba6c 100644 --- a/nc_test/tst_addvar.c +++ b/nc_test/tst_addvar.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + /* This program adds two new variables to an existing netCDF file. * It is used to test if netCDF can correctly calculate the file offsets * for the two new variables, in particular for files that align the diff --git a/nc_test/tst_atts3.c b/nc_test/tst_atts3.c index fcdcc691ae..bcad82c07b 100644 --- a/nc_test/tst_atts3.c +++ b/nc_test/tst_atts3.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2005-2007 University +/* This is part of the netCDF package. Copyright 2005-2018 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for conditions of use. diff --git a/nc_test/tst_big_rvar.c b/nc_test/tst_big_rvar.c index 8a595474c5..28c27097b8 100644 --- a/nc_test/tst_big_rvar.c +++ b/nc_test/tst_big_rvar.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests a large file bug on 32-bit platforms in versions diff --git a/nc_test/tst_big_var.c b/nc_test/tst_big_var.c index f66080c1b4..b3b5bd9945 100644 --- a/nc_test/tst_big_var.c +++ b/nc_test/tst_big_var.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the large file bug in netCDF 3.6.2, diff --git a/nc_test/tst_big_var2.c b/nc_test/tst_big_var2.c index 4f722ca745..362efa5574 100644 --- a/nc_test/tst_big_var2.c +++ b/nc_test/tst_big_var2.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the fix for a large file bug in versions previous diff --git a/nc_test/tst_big_var6.c b/nc_test/tst_big_var6.c index 5f4fad7e05..04f6e9d7a7 100644 --- a/nc_test/tst_big_var6.c +++ b/nc_test/tst_big_var6.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the fix for a large file bug in versions previous diff --git a/nc_test/tst_cdf5_begin.c b/nc_test/tst_cdf5_begin.c index d704d9aa0a..e468f60462 100644 --- a/nc_test/tst_cdf5_begin.c +++ b/nc_test/tst_cdf5_begin.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include #include @@ -18,7 +29,7 @@ int main(int argc, char *argv[]) int i, err, nerrs=0, ncid, dimid[2], varid[2]; short buf[10]; size_t start, count; - + err = nc_create(FILE_NAME, NC_CLOBBER|NC_64BIT_DATA, &ncid); ERR; err = nc_def_dim(ncid, "dim0", NC_MAX_UINT, &dimid[0]); ERR err = nc_def_dim(ncid, "dim1", 10, &dimid[1]); ERR @@ -53,4 +64,3 @@ int main(int argc, char *argv[]) return (nerrs > 0); } - diff --git a/nc_test/tst_cdf5format.c b/nc_test/tst_cdf5format.c index 4889357249..e5a2008659 100644 --- a/nc_test/tst_cdf5format.c +++ b/nc_test/tst_cdf5format.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - Copyright 2005 University Corporation for Atmospheric Research/Unidata + Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. Test fix of bug involving creation of a file with PnetCDF APIs, @@ -23,7 +23,7 @@ write2(int ncid, int parallel) int dimid[NDIM2]; char str[NC_MAX_NAME + 1]; int varid[NVARS]; - + /* define dimension */ if (nc_def_dim(ncid, "Y", NC_UNLIMITED, &dimid[0])) ERR; if (nc_def_dim(ncid, "X", NX, &dimid[1])) ERR; @@ -42,16 +42,16 @@ write2(int ncid, int parallel) if (nc_def_var(ncid, str, NC_INT, 2, dimid, &varid[i])) ERR; } } - + if (nc_enddef(ncid)) ERR; - + /* write all variables */ for (int i = 0; i < NVARS; i++) { size_t start[NDIM2] = {0, 0}; size_t count[NDIM2]; int buf[NX]; - + /* Initialize some data. */ for (int j = 0; j < NX; j++) buf[j] = i * 10 + j; @@ -80,7 +80,7 @@ extend(int ncid) char str[32]; if (nc_redef(ncid)) ERR; - + /* add attributes to make header grow */ for (i = 0; i < NVARS; i++) { @@ -98,7 +98,7 @@ read2(int ncid) for (int i = 0; i < NVARS; i++) { int buf[NX]; - size_t start[2] = {0, 0}, count[2]; + size_t start[2] = {0, 0}, count[2]; if (i % 2) { @@ -109,7 +109,7 @@ read2(int ncid) count[0] = 1; count[1] = NX; } - if (nc_get_vara_int(ncid, i, start, count, buf)) ERR; + if (nc_get_vara_int(ncid, i, start, count, buf)) ERR; for (int j = 0; j < NX; j++) { if (buf[j] != i * 10 + j) @@ -142,12 +142,12 @@ int main(int argc, char* argv[]) if (nc_create_par(FILENAME, cmode, comm, info, &ncid)) ERR; if (write2(ncid, 1)) ERR; if (nc_close(ncid)) ERR; - + /* Re-open the file with pnetCDF (parallel) and add var attributes. */ if (nc_open_par(FILENAME, NC_WRITE, comm, info, &ncid)) ERR; if (extend(ncid)) ERR; if (nc_close(ncid)) ERR; - + /* Open with classic and check. */ if (nc_open(FILENAME, 0, &ncid)) ERR; if (read2(ncid)) ERR; @@ -162,7 +162,7 @@ int main(int argc, char* argv[]) if (nc_create(FILENAME, cmode, &ncid)) ERR; if (write2(ncid, 0)) ERR; if (nc_close(ncid)) ERR; - + /* Re-open the file with CDF5 and add some atts. */ if (nc_open(FILENAME, NC_WRITE, &ncid)) ERR; if (extend(ncid)) ERR; diff --git a/nc_test/tst_def_var_fill.c b/nc_test/tst_def_var_fill.c index affd3156e9..ed3f182fa7 100644 --- a/nc_test/tst_def_var_fill.c +++ b/nc_test/tst_def_var_fill.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - * Copyright 2005 University Corporation for Atmospheric Research/Unidata + * Copyright 2018 University Corporation for Atmospheric Research/Unidata * See COPYRIGHT file for conditions of use. * * Test per-variable fill mode for classic file formats. @@ -143,4 +143,3 @@ int main(int argc, char** argv) { return (nerrs > 0); } - diff --git a/nc_test/tst_default_format.c b/nc_test/tst_default_format.c index f1f4e06838..18de62c61b 100644 --- a/nc_test/tst_default_format.c +++ b/nc_test/tst_default_format.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include "config.h" #include #include diff --git a/nc_test/tst_default_format_pnetcdf.c b/nc_test/tst_default_format_pnetcdf.c index 2e7a4fc3da..a7fa31c0f8 100644 --- a/nc_test/tst_default_format_pnetcdf.c +++ b/nc_test/tst_default_format_pnetcdf.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include "config.h" #include #include diff --git a/nc_test/tst_diskless.c b/nc_test/tst_diskless.c index 73cec34564..5c48769e38 100644 --- a/nc_test/tst_diskless.c +++ b/nc_test/tst_diskless.c @@ -1,7 +1,7 @@ /** \file \internal Basic diskless API tests. -Copyright 2011, UCAR/Unidata. See COPYRIGHT file for copying and +Copyright 2018, UCAR/Unidata. See COPYRIGHT file for copying and redistribution conditions. */ diff --git a/nc_test/tst_diskless2.c b/nc_test/tst_diskless2.c index 14125e7729..38f30fedf3 100644 --- a/nc_test/tst_diskless2.c +++ b/nc_test/tst_diskless2.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include #include diff --git a/nc_test/tst_diskless3.c b/nc_test/tst_diskless3.c index 442e823297..d4b75e12a4 100644 --- a/nc_test/tst_diskless3.c +++ b/nc_test/tst_diskless3.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2005 University +/* This is part of the netCDF package. Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. diff --git a/nc_test/tst_diskless4.c b/nc_test/tst_diskless4.c index ee0e9f6796..be667fe745 100644 --- a/nc_test/tst_diskless4.c +++ b/nc_test/tst_diskless4.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the large file bug in netCDF 3.6.2, diff --git a/nc_test/tst_diskless5.c b/nc_test/tst_diskless5.c index ae4639656b..2148f5741a 100644 --- a/nc_test/tst_diskless5.c +++ b/nc_test/tst_diskless5.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include #include diff --git a/nc_test/tst_diskless6.c b/nc_test/tst_diskless6.c index e2c69cf1bb..d968d71b14 100644 --- a/nc_test/tst_diskless6.c +++ b/nc_test/tst_diskless6.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include "config.h" #include #include @@ -215,7 +226,7 @@ main() /* Of the above modified files, re-read and modify but do not re-persist */ /* Test open + modify + rdonly; requires NC_DISKLESS*/ #if 0 - /* Fails with hdf5, file must be writeable even if not persisted */ + /* Fails with hdf5, file must be writeable even if not persisted */ changeaccess(RDONLY); /* prevent re-persist */ #endif printf("*** Testopen modify + rdonly\n"); fflush(stdout); diff --git a/nc_test/tst_err_enddef.c b/nc_test/tst_err_enddef.c index 7d0f9f6cd2..e6a7528394 100644 --- a/nc_test/tst_err_enddef.c +++ b/nc_test/tst_err_enddef.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include diff --git a/nc_test/tst_formats.c b/nc_test/tst_formats.c index 814904a5a6..025f10442d 100644 --- a/nc_test/tst_formats.c +++ b/nc_test/tst_formats.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2005-2007 University +/* This is part of the netCDF package. Copyright 2005-2018 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for conditions of use. @@ -58,12 +58,12 @@ check_inq_format(int ncid, int expected_format, int expected_extended_format, in int format; int extended_format; int mode; - + if (nc_inq_format(ncid + 66000, NULL) != NC_EBADID) ERR; if (nc_inq_format(ncid, NULL)) ERR; if (nc_inq_format(ncid, &format)) ERR; if (format != expected_format) { - printf("format %d expected_format %d\n", format, expected_format); + printf("format %d expected_format %d\n", format, expected_format); ERR; } if (nc_inq_format_extended(ncid + 66000, &extended_format, &mode) != NC_EBADID) ERR; diff --git a/nc_test/tst_formatx_pnetcdf.c b/nc_test/tst_formatx_pnetcdf.c index 2cfbf5e83e..d8275daf38 100644 --- a/nc_test/tst_formatx_pnetcdf.c +++ b/nc_test/tst_formatx_pnetcdf.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - Copyright 2005 University Corporation for Atmospheric Research/Unidata + Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. Test fix of bug involving creation of a file with PnetCDF APIs, @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) int err = 0; int ecode = 0; int ncid; - int cmode, format; + int cmode, format; int nprocs, rank; MPI_Comm comm=MPI_COMM_SELF; MPI_Info info=MPI_INFO_NULL; diff --git a/nc_test/tst_global_fillval.c b/nc_test/tst_global_fillval.c index 4812d3f72a..8db5eb0ce3 100644 --- a/nc_test/tst_global_fillval.c +++ b/nc_test/tst_global_fillval.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2017 University +/* This is part of the netCDF package. Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. diff --git a/nc_test/tst_inmemory.c b/nc_test/tst_inmemory.c index af3f1b6e10..c12cb94dc9 100644 --- a/nc_test/tst_inmemory.c +++ b/nc_test/tst_inmemory.c @@ -1,7 +1,7 @@ /** \file \internal Basic NC_INMEMORY API tests both for netcdf-3 and netcdf-4 -Copyright 2011, UCAR/Unidata. See COPYRIGHT file for copying and +Copyright 2018, UCAR/Unidata. See COPYRIGHT file for copying and redistribution conditions. */ diff --git a/nc_test/tst_inq_type.c b/nc_test/tst_inq_type.c index 8bd0233013..290c14302c 100644 --- a/nc_test/tst_inq_type.c +++ b/nc_test/tst_inq_type.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2016 University +/* This is part of the netCDF package. Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. @@ -184,4 +184,3 @@ int main(int argc, char **argv) { FINAL_RESULTS; } - diff --git a/nc_test/tst_large.c b/nc_test/tst_large.c index 92d12ac417..7cc9f15f24 100644 --- a/nc_test/tst_large.c +++ b/nc_test/tst_large.c @@ -1,5 +1,5 @@ /* - Copyright 2008, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the large file bug in netCDF 3.6.2, diff --git a/nc_test/tst_large_cdf5.c b/nc_test/tst_large_cdf5.c index ef8681f0b4..106d4f0024 100644 --- a/nc_test/tst_large_cdf5.c +++ b/nc_test/tst_large_cdf5.c @@ -1,5 +1,5 @@ /* - Copyright 2017, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This program tests the large file bug in netCDF 3.6.2, diff --git a/nc_test/tst_max_var_dims.c b/nc_test/tst_max_var_dims.c index 3157630c30..aec5c60673 100644 --- a/nc_test/tst_max_var_dims.c +++ b/nc_test/tst_max_var_dims.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include @@ -31,4 +42,3 @@ int main(int argc, char *argv[]) err = nc_close(ncid); ERR return (nerrs > 0); } - diff --git a/nc_test/tst_meta.c b/nc_test/tst_meta.c index 7653953a31..c3c68bb2e1 100644 --- a/nc_test/tst_meta.c +++ b/nc_test/tst_meta.c @@ -1,5 +1,5 @@ /* - Copyright 20014, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. diff --git a/nc_test/tst_misc.c b/nc_test/tst_misc.c index 536bec9a2e..097d0357cc 100644 --- a/nc_test/tst_misc.c +++ b/nc_test/tst_misc.c @@ -1,5 +1,5 @@ /* - Copyright 2007, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. @@ -61,20 +61,20 @@ main(int argc, char **argv) } SUMMARIZE_ERR; -#ifndef USE_NETCDF4 +#ifndef USE_NETCDF4 printf("*** Trying to create netCDF-4 file without netCDF-4..."); { int ncid; - + if (nc_create(FILE_NAME, NC_NETCDF4, &ncid) != NC_ENOTBUILT) ERR; } SUMMARIZE_ERR; #endif /* USE_NETCDF4 undefined */ - + #ifdef TEST_PNETCDF MPI_Finalize(); #endif - + FINAL_RESULTS; } diff --git a/nc_test/tst_names.c b/nc_test/tst_names.c index 878ae32d90..a7b938c598 100644 --- a/nc_test/tst_names.c +++ b/nc_test/tst_names.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - Copyright 2006 University Corporation for Atmospheric Research/Unidata. + Copyright 2018 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for conditions of use. This is a very simple example which tests rejection of bad names for diff --git a/nc_test/tst_nofill.c b/nc_test/tst_nofill.c index 684192e2fb..770821bd38 100644 --- a/nc_test/tst_nofill.c +++ b/nc_test/tst_nofill.c @@ -1,5 +1,5 @@ /* - Copyright 2007, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. diff --git a/nc_test/tst_nofill2.c b/nc_test/tst_nofill2.c index e8187f235e..9d85619012 100644 --- a/nc_test/tst_nofill2.c +++ b/nc_test/tst_nofill2.c @@ -1,5 +1,5 @@ /* - Copyright 2011, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. diff --git a/nc_test/tst_nofill3.c b/nc_test/tst_nofill3.c index d9dbbcfdb3..e81b3e8f15 100644 --- a/nc_test/tst_nofill3.c +++ b/nc_test/tst_nofill3.c @@ -1,5 +1,5 @@ /* - Copyright 2011, UCAR/Unidata + Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and redistribution conditions. This is part of netCDF. diff --git a/nc_test/tst_norm.c b/nc_test/tst_norm.c index b7918662a8..f16b0e5eed 100644 --- a/nc_test/tst_norm.c +++ b/nc_test/tst_norm.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - Copyright 2006 University Corporation for Atmospheric Research/Unidata. + Copyright 2018 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for conditions of use. This is a very simple example which tests NFC normalization of diff --git a/nc_test/tst_open_cdf5.c b/nc_test/tst_open_cdf5.c index 1d5e9b5f69..be8a977aad 100644 --- a/nc_test/tst_open_cdf5.c +++ b/nc_test/tst_open_cdf5.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include "config.h" #include #include diff --git a/nc_test/tst_open_mem.c b/nc_test/tst_open_mem.c index f25a7003fa..d48106d31e 100644 --- a/nc_test/tst_open_mem.c +++ b/nc_test/tst_open_mem.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + #include #include #include @@ -49,19 +60,19 @@ readfile(const char* path, NC_memio* memio) size_t actual; actual = fread(p,1,count,f); if(actual == 0 || ferror(f)) - {status = NC_EIO; goto done;} + {status = NC_EIO; goto done;} count -= actual; p += actual; } if(memio) { memio->size = (size_t)filesize; memio->memory = memory; - } + } done: if(status != NC_NOERR && memory != NULL) free(memory); if(f != NULL) fclose(f); - return status; + return status; } int diff --git a/nc_test/tst_parallel2.c b/nc_test/tst_parallel2.c index cfe7d1ed9d..a9c52f4af8 100644 --- a/nc_test/tst_parallel2.c +++ b/nc_test/tst_parallel2.c @@ -1,3 +1,14 @@ +/*! \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. + +*/ + /* This is a benchmarking program for netCDF-4 parallel I/O. */ /* Defining USE_MPE causes the MPE trace library to be used (and you @@ -30,7 +41,7 @@ int main(int argc, char **argv) { /* MPI stuff. */ - int mpi_namelen; + int mpi_namelen; char mpi_name[MPI_MAX_PROCESSOR_NAME]; int mpi_size, mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -43,7 +54,7 @@ main(int argc, char **argv) size_t count[NDIMS] = {1, DIMSIZE, DIMSIZE}; int data[DIMSIZE * DIMSIZE], data_in[DIMSIZE * DIMSIZE]; int j, i; - + char file_name[NC_MAX_NAME + 1]; int ndims_in, nvars_in, natts_in, unlimdimid_in; @@ -63,23 +74,23 @@ main(int argc, char **argv) /* Must be able to evenly divide my slabs between processors. */ if (NUM_SLABS % mpi_size != 0) { - if (!mpi_rank) printf("NUM_SLABS (%d) is not evenly divisible by mpi_size(%d)\n", + if (!mpi_rank) printf("NUM_SLABS (%d) is not evenly divisible by mpi_size(%d)\n", NUM_SLABS, mpi_size); ERR; } #ifdef USE_MPE MPE_Init_log(); - s_init = MPE_Log_get_event_number(); - e_init = MPE_Log_get_event_number(); - s_define = MPE_Log_get_event_number(); - e_define = MPE_Log_get_event_number(); - s_write = MPE_Log_get_event_number(); - e_write = MPE_Log_get_event_number(); - s_close = MPE_Log_get_event_number(); - e_close = MPE_Log_get_event_number(); - s_open = MPE_Log_get_event_number(); - e_open = MPE_Log_get_event_number(); + s_init = MPE_Log_get_event_number(); + e_init = MPE_Log_get_event_number(); + s_define = MPE_Log_get_event_number(); + e_define = MPE_Log_get_event_number(); + s_write = MPE_Log_get_event_number(); + e_write = MPE_Log_get_event_number(); + s_close = MPE_Log_get_event_number(); + e_close = MPE_Log_get_event_number(); + s_open = MPE_Log_get_event_number(); + e_open = MPE_Log_get_event_number(); MPE_Describe_state(s_init, e_init, "Init", "red"); MPE_Describe_state(s_define, e_define, "Define", "yellow"); MPE_Describe_state(s_write, e_write, "Write", "green"); @@ -176,7 +187,7 @@ main(int argc, char **argv) /* Close the netcdf file. */ if (nc_close(ncid)) ERR; - + #ifdef USE_MPE MPE_Log_event(e_close, 0, "end close file"); #endif /* USE_MPE */ @@ -187,7 +198,7 @@ main(int argc, char **argv) #endif if (nc_open_par(file_name, NC_NOWRITE, comm, info, &ncid)) ERR; if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR; - if (ndims_in != NDIMS || nvars_in != 1 || natts_in != 1 || + if (ndims_in != NDIMS || nvars_in != 1 || natts_in != 1 || unlimdimid_in != -1) ERR; /* Read all the slabs this process is responsible for. */ @@ -201,10 +212,10 @@ main(int argc, char **argv) /* Read one slab of data. */ if (nc_get_vara_int(ncid, varid, start, count, data_in)) ERR; - + /* Check data. */ for (j = 0; j < DIMSIZE * DIMSIZE; j++) - if (data_in[j] != mpi_rank) + if (data_in[j] != mpi_rank) { ERR; break; @@ -221,7 +232,7 @@ main(int argc, char **argv) /* Close the netcdf file. */ if (nc_close(ncid)) ERR; - + #ifdef USE_MPE MPE_Log_event(e_close, 0, "end close file"); #endif /* USE_MPE */ diff --git a/nc_test/tst_pnetcdf.c b/nc_test/tst_pnetcdf.c index a82a2bb949..1766dad011 100644 --- a/nc_test/tst_pnetcdf.c +++ b/nc_test/tst_pnetcdf.c @@ -1,5 +1,5 @@ /* This is part of the netCDF package. - Copyright 2005 University Corporation for Atmospheric Research/Unidata + Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. Test fix of bug involving creation of a file with PnetCDF APIs, diff --git a/nc_test/tst_small.c b/nc_test/tst_small.c index 040f7e2164..ab97f075c8 100644 --- a/nc_test/tst_small.c +++ b/nc_test/tst_small.c @@ -1,4 +1,4 @@ -/* This is part of the netCDF package. Copyright 2005 University +/* This is part of the netCDF package. Copyright 2018 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. diff --git a/nc_test/tst_utf8_phrases.c b/nc_test/tst_utf8_phrases.c index 29ec68cc7e..468bd9138a 100644 --- a/nc_test/tst_utf8_phrases.c +++ b/nc_test/tst_utf8_phrases.c @@ -1,6 +1,6 @@ /* - * Copyright 1998-2015 University Corporation for Atmospheric Research/Unidata + * Copyright 1998-2018 University Corporation for Atmospheric Research/Unidata * See the LICENSE file for more information. */ diff --git a/nc_test/tst_utf8_validate.c b/nc_test/tst_utf8_validate.c index 4d7fa7b840..06de615e1f 100644 --- a/nc_test/tst_utf8_validate.c +++ b/nc_test/tst_utf8_validate.c @@ -1,5 +1,5 @@ /* - * Copyright 1998-2015 University Corporation for Atmospheric Research/Unidata + * Copyright 1998-2018 University Corporation for Atmospheric Research/Unidata * See the LICENSE file for more information. */ @@ -99,16 +99,16 @@ static const struct Test utf8boundary[] = { {0,"2.1.2", "2 bytes (U-00000080)", "€"}, {0,"2.1.3", "3 bytes (U-00000800)", "ࠀ"}, {0,"2.1.4", "4 bytes (U-00010000)", "𐀀"}, -{1,"2.1.5", "5 bytes (U-00200000)", ""}, -{1,"2.1.6", "6 bytes (U-04000000)", ""}, +{1,"2.1.5", "5 bytes (U-00200000)", "�����"}, +{1,"2.1.6", "6 bytes (U-04000000)", "������"}, /*2.2 Last possible sequence of a certain length*/ {0,"2.2.1", "1 byte (U-0000007F)", ""}, {0,"2.2.2", "2 bytes (U-000007FF)", "߿"}, {0,"2.2.3", "3 bytes (U-0000FFFF)", "￿"}, /*See 5.3.2 */ -{1,"2.2.4", "4 bytes (U-001FFFFF)", ""}, -{1,"2.2.5", "5 bytes (U-03FFFFFF)", ""}, -{1,"2.2.6", "6 bytes (U-7FFFFFFF)", ""}, +{1,"2.2.4", "4 bytes (U-001FFFFF)", "����"}, +{1,"2.2.5", "5 bytes (U-03FFFFFF)", "�����"}, +{1,"2.2.6", "6 bytes (U-7FFFFFFF)", "������"}, /*2.3 Other boundary conditions*/ @@ -116,7 +116,7 @@ static const struct Test utf8boundary[] = { {0,"2.3.2", "U-0000E000 = ee 80 80", ""}, {0,"2.3.3", "U-0000FFFD = ef bf bd", "�"}, {0,"2.3.4", "U-0010FFFF = f4 8f bf bf", "􏿿"}, -{1,"2.3.5", "U-00110000 = f4 90 80 80", ""}, +{1,"2.3.5", "U-00110000 = f4 90 80 80", "����"}, NULLTEST }; @@ -128,17 +128,17 @@ static const struct Test utf8bad[] = { Each unexpected continuation byte should be separately signalled as a malformed sequence of its own. */ -{1,"3.1.1", "First continuation byte 0x80", ""}, -{1,"3.1.2", "Last continuation byte 0xbf", ""}, - -{1,"3.1.3", "2 continuation bytes", ""}, -{1,"3.1.4", "3 continuation bytes", ""}, -{1,"3.1.5", "4 continuation bytes", ""}, -{1,"3.1.6", "5 continuation bytes", ""}, -{1,"3.1.7", "6 continuation bytes", ""}, -{1,"3.1.8", "7 continuation bytes", ""}, +{1,"3.1.1", "First continuation byte 0x80", "�"}, +{1,"3.1.2", "Last continuation byte 0xbf", "�"}, + +{1,"3.1.3", "2 continuation bytes", "��"}, +{1,"3.1.4", "3 continuation bytes", "���"}, +{1,"3.1.5", "4 continuation bytes", "����"}, +{1,"3.1.6", "5 continuation bytes", "�����"}, +{1,"3.1.7", "6 continuation bytes", "������"}, +{1,"3.1.8", "7 continuation bytes", "�������"}, {1,"3.1.9", "Sequence of all 64 possible continuation bytes (0x80-0xbf)", - "" + "����������������������������������������������������������������" }, /*3.2 Lonely start characters*/ @@ -147,31 +147,31 @@ static const struct Test utf8bad[] = { each followed by a space character*/ {1,"3.2.1", "All 32 first bytes of 2-byte sequences", -" " +"� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � " }, /*3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), each followed by a space character:*/ {1,"3.2.2", "All 16 first bytes of 3-byte sequences", -" " +"� � � � � � � � � � � � � � � � " }, /*3.2.3 All 8 first bytes of 4-byte sequences (0xf0-0xf7), each followed by a space character:*/ {1,"3.2.3", "All 8 first bytes of 4-byte sequences", - " " + "� � � � � � � � " }, /*3.2.4 All 4 first bytes of 5-byte sequences (0xf8-0xfb), each followed by a space character:*/ {1,"3.2.4", "All 4 first bytes of 5-byte sequences", - " " + "� � � � " }, /*3.2.5 All 2 first bytes of 6-byte sequences (0xfc-0xfd), each followed by a space character:*/ {1,"3.2.5", "All 2 first bytes of 6-byte sequences", - " " + "� � " }, /*3.3 Sequences with last continuation byte missing @@ -179,32 +179,32 @@ All bytes of an incomplete sequence should be signalled as a single malformed sequence, i.e., you should see only a single replacement character in each of the next 10 tests. (Characters as in section 2) */ -{1,"3.3.1", "2-byte sequence with last byte missing (U+0000)", ""}, -{1,"3.3.2", "3-byte sequence with last byte missing (U+0000)", ""}, -{1,"3.3.3", "4-byte sequence with last byte missing (U+0000)", ""}, -{1,"3.3.4", "5-byte sequence with last byte missing (U+0000)", ""}, -{1,"3.3.5", "6-byte sequence with last byte missing (U+0000)", ""}, -{1,"3.3.6", "2-byte sequence with last byte missing (U-000007FF)", ""}, -{1,"3.3.7", "3-byte sequence with last byte missing (U-0000FFFF)", ""}, -{1,"3.3.8", "4-byte sequence with last byte missing (U-001FFFFF)", ""}, -{1,"3.3.9", "5-byte sequence with last byte missing (U-03FFFFFF)", ""}, -{1,"3.3.10", "6-byte sequence with last byte missing (U-7FFFFFFF)", ""}, +{1,"3.3.1", "2-byte sequence with last byte missing (U+0000)", "�"}, +{1,"3.3.2", "3-byte sequence with last byte missing (U+0000)", "��"}, +{1,"3.3.3", "4-byte sequence with last byte missing (U+0000)", "���"}, +{1,"3.3.4", "5-byte sequence with last byte missing (U+0000)", "����"}, +{1,"3.3.5", "6-byte sequence with last byte missing (U+0000)", "�����"}, +{1,"3.3.6", "2-byte sequence with last byte missing (U-000007FF)", "�"}, +{1,"3.3.7", "3-byte sequence with last byte missing (U-0000FFFF)", "��"}, +{1,"3.3.8", "4-byte sequence with last byte missing (U-001FFFFF)", "���"}, +{1,"3.3.9", "5-byte sequence with last byte missing (U-03FFFFFF)", "����"}, +{1,"3.3.10", "6-byte sequence with last byte missing (U-7FFFFFFF)", "�����"}, /*3.4 Concatenation of incomplete sequences All the 10 sequences of 3.3 concatenated; you should see 10 malformed sequences being signalled: */ {1, "3.4.1", "All the 10 sequences of 3.3 concatenated", - "" + "������������������������������" }, /*3.5 Impossible bytes The following two bytes cannot appear in a correct UTF-8 string */ -{1,"3.5.1", "fe", ""}, -{1,"3.5.2", "ff", ""}, -{1,"3.5.3", "fe fe ff ff", ""}, +{1,"3.5.1", "fe", "�"}, +{1,"3.5.2", "ff", "�"}, +{1,"3.5.3", "fe fe ff ff", "����"}, /* 4 Overlong sequences @@ -237,11 +237,11 @@ a replacement character. If you see a slash below, you do not have a safe UTF-8 decoder! */ -{1,"4.1.1", "U+002F = c0 af ", ""}, -{1,"4.1.2", "U+002F = e0 80 af ", ""}, -{1,"4.1.3", "U+002F = f0 80 80 af ", ""}, -{1,"4.1.4", "U+002F = f8 80 80 80 af ", ""}, -{1,"4.1.5", "U+002F = fc 80 80 80 80 af ", ""}, +{1,"4.1.1", "U+002F = c0 af ", "��"}, +{1,"4.1.2", "U+002F = e0 80 af ", "���"}, +{1,"4.1.3", "U+002F = f0 80 80 af ", "����"}, +{1,"4.1.4", "U+002F = f8 80 80 80 af ", "�����"}, +{1,"4.1.5", "U+002F = fc 80 80 80 80 af ", "������"}, /*4.2 Maximum overlong sequences @@ -251,11 +251,11 @@ is a boundary test for safe UTF-8 decoders. All five characters should be rejected like malformed UTF-8 sequences. */ -{1,"4.2.1", "U-0000007F = c1 bf ", ""}, -{1,"4.2.2", "U-000007FF = e0 9f bf ", ""}, -{1,"4.2.3", "U-0000FFFF = f0 8f bf bf ", ""}, -{1,"4.2.4", "U-001FFFFF = f8 87 bf bf bf ", ""}, -{1,"4.2.5", "U-03FFFFFF = fc 83 bf bf bf bf ", ""}, +{1,"4.2.1", "U-0000007F = c1 bf ", "��"}, +{1,"4.2.2", "U-000007FF = e0 9f bf ", "���"}, +{1,"4.2.3", "U-0000FFFF = f0 8f bf bf ", "����"}, +{1,"4.2.4", "U-001FFFFF = f8 87 bf bf bf ", "�����"}, +{1,"4.2.5", "U-03FFFFFF = fc 83 bf bf bf bf ", "������"}, /* 4.3 Overlong representation of the NUL character @@ -265,11 +265,11 @@ UTF-8 sequences and should not be treated like the ASCII NUL character. */ -{1,"4.3.1", "U+0000 = c0 80 ", ""}, -{1,"4.3.2", "U+0000 = e0 80 80 ", ""}, -{1,"4.3.3", "U+0000 = f0 80 80 80 ", ""}, -{1,"4.3.4", "U+0000 = f8 80 80 80 80 ", ""}, -{1,"4.3.5", "U+0000 = fc 80 80 80 80 80 ", ""}, +{1,"4.3.1", "U+0000 = c0 80 ", "��"}, +{1,"4.3.2", "U+0000 = e0 80 80 ", "���"}, +{1,"4.3.3", "U+0000 = f0 80 80 80 ", "����"}, +{1,"4.3.4", "U+0000 = f8 80 80 80 80 ", "�����"}, +{1,"4.3.5", "U+0000 = fc 80 80 80 80 80 ", "������"}, /* 5 Illegal code positions @@ -281,24 +281,24 @@ comparable to overlong UTF-8 sequences. */ /*5.1 Single UTF-16 surrogates*/ -{1,"5.1.1", "U+D800 = ed a0 80 ", ""}, -{1,"5.1.2", "U+DB7F = ed ad bf ", ""}, -{1,"5.1.3", "U+DB80 = ed ae 80 ", ""}, -{1,"5.1.4", "U+DBFF = ed af bf ", ""}, -{1,"5.1.5", "U+DC00 = ed b0 80 ", ""}, -{1,"5.1.6", "U+DF80 = ed be 80 ", ""}, -{1,"5.1.7", "U+DFFF = ed bf bf ", ""}, +{1,"5.1.1", "U+D800 = ed a0 80 ", "���"}, +{1,"5.1.2", "U+DB7F = ed ad bf ", "���"}, +{1,"5.1.3", "U+DB80 = ed ae 80 ", "���"}, +{1,"5.1.4", "U+DBFF = ed af bf ", "���"}, +{1,"5.1.5", "U+DC00 = ed b0 80 ", "���"}, +{1,"5.1.6", "U+DF80 = ed be 80 ", "���"}, +{1,"5.1.7", "U+DFFF = ed bf bf ", "���"}, /*5.2 Paired UTF-16 surrogates */ -{1,"5.2.1", "U+D800 U+DC00 = ed a0 80 ed b0 80 ", ""}, -{1,"5.2.2", "U+D800 U+DFFF = ed a0 80 ed bf bf ", ""}, -{1,"5.2.3", "U+DB7F U+DC00 = ed ad bf ed b0 80 ", ""}, -{1,"5.2.4", "U+DB7F U+DFFF = ed ad bf ed bf bf ", ""}, -{1,"5.2.5", "U+DB80 U+DC00 = ed ae 80 ed b0 80 ", ""}, -{1,"5.2.6", "U+DB80 U+DFFF = ed ae 80 ed bf bf ", ""}, -{1,"5.2.7", "U+DBFF U+DC00 = ed af bf ed b0 80 ", ""}, -{1,"5.2.8", "U+DBFF U+DFFF = ed af bf ed bf bf ", ""}, +{1,"5.2.1", "U+D800 U+DC00 = ed a0 80 ed b0 80 ", "������"}, +{1,"5.2.2", "U+D800 U+DFFF = ed a0 80 ed bf bf ", "������"}, +{1,"5.2.3", "U+DB7F U+DC00 = ed ad bf ed b0 80 ", "������"}, +{1,"5.2.4", "U+DB7F U+DFFF = ed ad bf ed bf bf ", "������"}, +{1,"5.2.5", "U+DB80 U+DC00 = ed ae 80 ed b0 80 ", "������"}, +{1,"5.2.6", "U+DB80 U+DFFF = ed ae 80 ed bf bf ", "������"}, +{1,"5.2.7", "U+DBFF U+DC00 = ed af bf ed b0 80 ", "������"}, +{1,"5.2.8", "U+DBFF U+DFFF = ed af bf ed bf bf ", "������"}, NULLTEST }; diff --git a/nc_test/util.c b/nc_test/util.c index d7afd1ead7..be2f678d88 100644 --- a/nc_test/util.c +++ b/nc_test/util.c @@ -1,5 +1,5 @@ /********************************************************************* - * Copyright 1996, UCAR/Unidata + * Copyright 2018, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. * $Id: util.c 2792 2014-10-27 06:02:59Z wkliao $ *********************************************************************/