Corrected an issue with netcdf3 files that would prevent the -v and -V flags from working properly when using nccopy.  See and for more information.
@@ -1200,12 +1200,27 @@ classify_vars(
int **rvars) /* the array of record variable IDs, caller should free */
{
int varid;
+ int varindex = 0;
int nvars;
NC_CHECK(nc_inq_nvars(ncid, &nvars));
*nf = 0;
*fvars = (int *) emalloc(nvars * sizeof(int));
*nr = 0;
*rvars = (int *) emalloc(nvars * sizeof(int));
+
+ if(option_nlvars > 0) {
+ for (varindex = 0; varindex < option_nlvars; varindex++) {
+ nc_inq_varid(ncid,option_lvars[varindex],&varid);
+
+ if (isrecvar(ncid, varid)) {
+ (*rvars)[*nr] = varid;
+ (*nr)++;
+ } else {
+ (*fvars)[*nf] = varid;
+ (*nf)++;
+ }
+ }
+ } else {
for (varid = 0; varid < nvars; varid++) {
if (isrecvar(ncid, varid)) {
(*rvars)[*nr] = varid;
@@ -1215,6 +1230,7 @@ classify_vars(
(*nf)++;
}
}
+ }
return NC_NOERR;
}
