Merge branch 'master' into travis-tweak

This commit is contained in:
Ward Fisher 2018-05-10 16:28:47 -06:00
commit 605a5bfb0b
6 changed files with 59 additions and 41 deletions

View File

@ -3049,10 +3049,23 @@ or using ECMWF reanalysis on a reduced grid
<p></p>
<h2><a id="Agrimetsoft" name="Agrimetsoft">AgriMetSoft Netcdf-Extractor</a></h2>
There are different software packages or various codes that may be used for manipulating or displaying NetCDF data. Some of them such as MATLAB programming language needs to enough information about provide codes in MATLAB as well as to know run codes and statements. Furthermore, user should have to pay for MATLAB programming and install it in her/his system. Also, another of them are related to other programming languages such as R, NCL (NCAR Command Language), and etc. It has been mentioned before that working by many of this methods to extract NetCDF files are so rough and complicated for users. Therefore, it is essential that users can extract their NC files in a user-friendly tool without any concerns. The NetCDF Extractor software is an easy tool for all users to extract their aim region from the main files. This tool is flexible to run for various datasets such as CMIP5 models, AgMERRA datasets, Aphrodite, CRU, CORDEX, and etc. Finally, this tool is NETCDF EXTRACTOR, NETCDF FILE VIEWER, and NETCDF CONVERTER. <a href="http://www.agrimetsoft.com/Netcdf-Extractor.aspx">NetCDF-Extractor website.</A>
<p>
NetCDF Extractor is a windows software for view, convert, merge, and
extract data from .nc and .nc4 files. It can extract several nc files,
simultaneously. When a user wants to extract several files of nc format
simultaneously, he/she requires to load them at a same time with together,
loading the files one by one will be a time consuming and tedious process
and prone to error. By this software the user can save his/her time, and
quickly do the extract process. Also, it has a calculator tool. In this
calculator by entering latitude and longitude of the desirable region, the
user can view of the grid number of that region. In the latest version of
NetCDF Extractor, Agrimetsoft has added two options: Sum” and “Average”.
So, the user can easily calculate the average and sum values of the
selected area (grids). Data is shown in an organized table, and you can
choose to export everything to Excel. This tool is flexible to run for
various datasets such as CMIP5 models, AgMERRA, Aphrodite, CRU, and etc.
Agrimetsoft support all the users until they can extract the data.
</p>
<p></p>
<h2><a id="ViewNcDap" name="ViewNcDap">ASA ViewNcDap</a></h2>

View File

@ -5,8 +5,13 @@
Includes for some HDF5 stuff needed by tests.
*/
#ifndef _NCDIMSCALE_H_
#define _NCDIMSCALE_H_
typedef struct hdf5_objid
{
unsigned long fileno[2]; /* file number */
haddr_t objno[2]; /* object number */
} HDF5_OBJID_T;
#endif

View File

@ -1782,19 +1782,14 @@ int
nc_delete_mp(const char * path, int basepe)
{
NC *nc;
NC3_INFO* nc3;
int status;
int ncid;
size_t chunk = 512;
status = nc_open(path,NC_NOWRITE,&ncid);
if(status) return status;
status = NC_check_id(ncid,&nc);
if(status) return status;
nc3 = NC3_DATA(nc);
nc3->chunk = chunk;
#if defined(LOCKNUMREC) /* && _CRAYMPP */
if (status = NC_init_pe(nc3, basepe)) {

View File

@ -296,6 +296,9 @@ static const char nada[X_ALIGN] = {0, 0, 0, 0};
(((a) & 0x00FF000000000000ULL) >> 40) | \
(((a) & 0xFF00000000000000ULL) >> 56) )
#if defined(_MSC_VER) && _MSC_VER < 1900
#define inline __inline
#endif
inline static void
swapn2b(void *dst, const void *src, IntType nn)

View File

@ -36,7 +36,7 @@ extern int NC4_extract_file_image(NC_HDF5_FILE_INFO_T* h5);
#define CD_NELEMS_ZLIB 1 /**< Number of parameters needed for ZLIB filter. */
/**
* @internal Wrap HDF5 allocated memory free operations
* @internal Wrap HDF5 allocated memory free operations
*
* @param memory Pointer to memory to be freed.
*
@ -110,7 +110,7 @@ NC_findreserved(const char* name)
}
/**
* @internal Given an HDF5 type, set a pointer to netcdf type.
* @internal Given an HDF5 type, set a pointer to netcdf type.
*
* @param h5 Pointer to HDF5 file info struct.
* @param native_typeid HDF5 type ID.
@ -532,7 +532,7 @@ static void dumpopenobjects(NC_HDF5_FILE_INFO_T* h5);
/**
* @internal This function will write all changed metadata, and
* (someday) reread all metadata from the file.
* (someday) reread all metadata from the file.
*
* @param h5 Pointer to HDF5 file info struct.
*
@ -589,7 +589,7 @@ sync_netcdf4_file(NC_HDF5_FILE_INFO_T *h5)
/**
* @internal This function will free all allocated metadata memory,
* and close the HDF5 file. The group that is passed in must be the
* root group of the file.
* root group of the file.
*
* @param h5 Pointer to HDF5 file info struct.
* @param abort True if this is an abort.
@ -637,9 +637,9 @@ close_netcdf4_file(NC_HDF5_FILE_INFO_T *h5, int abort, int extractmem)
MPI_Info_free(&h5->info);
}
#endif
if(h5->fileinfo) free(h5->fileinfo);
/* Check to see if this is an in-memory file and we want to get its
final content
*/
@ -666,7 +666,7 @@ static void
dumpopenobjects(NC_HDF5_FILE_INFO_T* h5)
{
int nobjs;
nobjs = H5Fget_obj_count(h5->hdfid, H5F_OBJ_ALL);
/* Apparently we can get an error even when nobjs == 0 */
if(nobjs < 0) {
@ -725,9 +725,9 @@ static const char* NC_RESERVED_ATT_LIST[] = {
NULL
};
/**
/**
* @internal Define the subset of the reserved list that is readable
* by name only
* by name only
*/
static const char* NC_RESERVED_SPECIAL_LIST[] = {
ISNETCDF4ATT,
@ -768,8 +768,8 @@ static const int nc_type_size_g[NUM_TYPES] = {sizeof(char), sizeof(char), sizeof
/**
* Set chunk cache size. Only affects files opened/created *after* it
* is called.
*
* is called.
*
* @param size Size in bytes to set cache.
* @param nelems Number of elements to hold in cache.
* @param preemption Premption stragety (between 0 and 1).
@ -791,7 +791,7 @@ nc_set_chunk_cache(size_t size, size_t nelems, float preemption)
/**
* Get chunk cache size. Only affects files opened/created *after* it
* is called.
* is called.
*
* @param sizep Pointer that gets size in bytes to set cache.
* @param nelemsp Pointer that gets number of elements to hold in cache.
@ -918,6 +918,8 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, void* parameters,
#ifdef USE_PARALLEL4
NC_MPI_INFO* mpiinfo = NULL;
MPI_Comm comm;
MPI_Info info;
int comm_duped = 0; /* Whether the MPI Communicator was duplicated */
int info_duped = 0; /* Whether the MPI Info object was duplicated */
#endif /* !USE_PARALLEL4 */
@ -941,7 +943,7 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, void* parameters,
nc4_info->mem.memio = *(NC_memio*)parameters;
#ifdef USE_PARALLEL4
else if(parameters) {
mpinfo = (NC_MPI_INFO *)parameters;
mpiinfo = (NC_MPI_INFO *)parameters;
comm = mpiinfo->comm;
info = mpiinfo->info;
}
@ -1069,7 +1071,7 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, void* parameters,
nc4_info->memio.memory = malloc(nc4_info->memio.size);
if(nc4_info->memio.memory == NULL)
BAIL(NC_ENOMEM);
}
}
assert(nc4_info->memio.size > 0 && nc4_info->memio.memory != NULL);
#endif
retval = NC4_create_image_file(nc4_info,initialsz);
@ -1311,7 +1313,7 @@ exit:
/**
* @internal This function reads the hacked in coordinates attribute I
* use for multi-dimensional coordinates.
* use for multi-dimensional coordinates.
*
* @param grp Group info pointer.
* @param var Var info pointer.
@ -1390,7 +1392,7 @@ dimscale_visitor(hid_t did, unsigned dim, hid_t dsid,
/**
* @internal Given an HDF5 type, set a pointer to netcdf type_info struct,
* either an existing one (for user-defined types) or a newly created
* one.
* one.
*
* @param h5 Pointer to HDF5 file info struct.
* @param datasetid HDF5 dataset ID.
@ -1838,13 +1840,13 @@ read_type(NC_GRP_INFO_T *grp, hid_t hdf_typeid, char *type_name)
* @internal This function is called by read_dataset(), (which is called
* by nc4_rec_read_metadata()) when a netCDF variable is found in the
* file. This function reads in all the metadata about the var,
* including the attributes.
* including the attributes.
*
* @param grp Pointer to group info struct.
* @param datasetid HDF5 dataset ID.
* @param obj_name Name of the HDF5 object to read.
* @param ndims Number of dimensions.
* @param dim
* @param dim
*
* @return ::NC_NOERR No error.
* @return ::NC_EBADID Bad ncid.
@ -2109,7 +2111,7 @@ exit:
/**
* @internal This function is called by nc4_rec_read_metadata to read
* all the group level attributes (the NC_GLOBAL atts for this
* group).
* group).
*
* @param grp Pointer to group info struct.
*
@ -2183,7 +2185,7 @@ exit:
/**
* @internal This function is called when nc4_rec_read_metadata
* encounters an HDF5 dataset when reading a file.
*
*
* @param grp Pointer to group info struct.
* @param datasetid HDF5 dataset ID.
* @param obj_name Object name.
@ -2502,7 +2504,7 @@ exit:
/**
* @internal Open a netcdf-4 file. Things have already been kicked off
* in ncfunc.c in nc_open, but here the netCDF-4 part of opening a
* file is handled.
* file is handled.
*
* @param path The file name of the new file.
* @param mode The open mode flag.
@ -2549,8 +2551,8 @@ nc4_open_file(const char *path, int mode, void* parameters, NC *nc)
then we must take control of the incoming memory */
nc4_info->mem.locked = (nc4_info->mem.memio.flags & NC_MEMIO_LOCKED) == NC_MEMIO_LOCKED;
if(!nc4_info->mem.locked && ((mode & NC_WRITE) == NC_WRITE)) {
memparams->memory = NULL;
}
memparams->memory = NULL;
}
#ifdef USE_PARALLEL4
} else {
mpiinfo = (NC_MPI_INFO*)parameters;
@ -2752,7 +2754,7 @@ done:
* only when a dataset is created. Whereas in netcdf, you first create
* the variable and then (optionally) specify the fill value. To
* accomplish this in HDF5 I have to delete the dataset, and recreate
* it, with the fill value specified.
* it, with the fill value specified.
*
* @param ncid File and group ID.
* @param fillmode File mode.
@ -2793,7 +2795,7 @@ NC4_set_fill(int ncid, int fillmode, int *old_modep)
/**
* @internal Put the file back in redef mode. This is done
* automatically for netcdf-4 files, if the user forgets.
* automatically for netcdf-4 files, if the user forgets.
*
* @param ncid File and group ID.
*
@ -2832,7 +2834,7 @@ NC4_redef(int ncid)
/**
* @internal For netcdf-4 files, this just calls nc_enddef, ignoring
* the extra parameters.
* the extra parameters.
*
* @param ncid File and group ID.
* @param h_minfree Ignored for netCDF-4 files.
@ -2855,7 +2857,7 @@ NC4__enddef(int ncid, size_t h_minfree, size_t v_align,
/**
* @internal Take the file out of define mode. This is called
* automatically for netcdf-4 files, if the user forgets.
* automatically for netcdf-4 files, if the user forgets.
*
* @param ncid File and group ID.
*
@ -2929,7 +2931,7 @@ NC4_sync(int ncid)
* created and is still in define mode, the dataset is deleted. If
* define mode was entered by a call to nc_redef, the netCDF dataset
* is restored to its state before definition mode was entered and the
* dataset is closed.
* dataset is closed.
*
* @param ncid File and group ID.
*
@ -2974,7 +2976,7 @@ NC4_abort(int ncid)
}
/**
* @internal Close the netcdf file, writing any changes first.
* @internal Close the netcdf file, writing any changes first.
*
* @param ncid File and group ID.
* @param params any extra parameters in/out of close
@ -3017,7 +3019,7 @@ NC4_close(int ncid, void* params)
}
/**
* @internal Close an in-memory netcdf file, writing any changes first.
* @internal Close an in-memory netcdf file, writing any changes first.
*
* @param ncid File and group ID.
* @param sizep ptr into which the final size is stored
@ -3047,7 +3049,7 @@ NC4_close_mem(int ncid, size_t* sizep, void** memp)
return NC_EBADGRPID;
/* If the file is not an in-memory file, then treat like normal close */
if((h5->cmode & NC_INMEMORY) == 0)
if((h5->cmode & NC_INMEMORY) == 0)
return NC4_close(ncid,NULL);
/* Call the nc4 close and extract memory */
@ -3129,7 +3131,7 @@ NC4_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
}
/**
* @internal This function will do the enddef stuff for a netcdf-4 file.
* @internal This function will do the enddef stuff for a netcdf-4 file.
*
* @param h5 Pointer to HDF5 file info struct.
*

View File

@ -4254,7 +4254,7 @@ reportobject(int uselog, hid_t id, unsigned int type)
} else
#endif
{
fprintf(stderr,"Type = %s(%lld) name='%s'",typename,(long long)id,name);
fprintf(stderr,"Type = %s(%lld) name='%s'",typename,printid,name);
}
}