NetcdfFile ncfile = NetcdfDataset.openFile(file, null);
NetcdfFile ncfileRemote = new CdmRemote(remote);
Formatter f= new Formatter();
CompareNetcdf2 cn = new CompareNetcdf2(f, false, false, false);
boolean ok = cn.compare(ncfile, ncfileRemote);
if (ok)
System.out.printf("compare %s ok %n", file);
else
System.out.printf("compare %s NOT OK %n%s", file, f.toString());
ncfile.close();