diff --git a/nccompress/nccompress.py b/nccompress/nccompress.py
index 42f36fb..c0e1cff 100755
--- a/nccompress/nccompress.py
+++ b/nccompress/nccompress.py
@@ -55,15 +55,20 @@ def is_netCDF(ncfile):
     """
     try:
         tmp = nc.Dataset(ncfile)
-        tmp.close()
-        return True
+        format = tmp.file_format
+        compressed = is_compressed(tmp)
+        # No need to close, is done in is_compressed
+        return (format, compressed)
     except netcdf4exception:
-        return False
+        return (False, None)
 
 def is_compressed(ncfile):
     """ Test if netcdfile is compressed
     """
-    tmp = nc.Dataset(ncfile)
+    if type(ncfile).__name__ == 'Dataset':
+        tmp = ncfile
+    else:
+        tmp = nc.Dataset(ncfile)
     compressed=False
     # netCDF3 files have no filters attribute, and no compression
     # should use data_model instead of file_format in future
@@ -263,14 +268,18 @@ def compress_files(path,files,tmpdir,overwrite,maxcompress,level,shuffle,force,c
         outfile = os.path.join(outdir,file)
 
         # Make sure we're dealing with a netCDF file
-        if is_netCDF(infile):
+        (ncformat, compressed) = is_netCDF(infile)
+        if ncformat:
+            if ncformat == 'NETCDF4' and not nccopy:
+                sys.stderr.write("Cannot compress {} with nc2nc as it is NETCDF4 format, switching to nccopy".format(infile))
+                nccopy = True
             if verbose: sys.stdout.write( "Compressing %s, deflate level = %s, shuffle is on: %s\n" % (infile,level,shuffle) )
         else:
             if verbose: print('Not a netCDF file: ' + infile)
             continue
 
         # Check to see if the input file is already compressed
-        if is_compressed(infile):
+        if compressed:
             if force:
                 if verbose: sys.stdout.write("Already compressed %s but forcing overwrite\n" % infile)
             else:

Handling of netCDF4 format
Could nc2nc call nccopy instead of skipping netCDF4 format files? 
diff --git a/test/test_nc2nc.py b/test/test_nc2nc.py
index 6ad6400..2f0505a 100644
--- a/test/test_nc2nc.py
+++ b/test/test_nc2nc.py
@@ -26,7 +26,7 @@ from nccompress import nc2nc
 verbose = True
 
 
-ncfiles =['simple_xy.nc']
+ncfiles =['simple_xy.nc', 'simple_xy_noclassic.nc']
 
 def setup_module(module):
     if verbose: print ("setup_module      module:%s" % module.__name__)
diff --git a/test/test_nccompress.py b/test/test_nccompress.py
index e29b868..b69c4ae 100644
--- a/test/test_nccompress.py
+++ b/test/test_nccompress.py
@@ -29,7 +29,7 @@ verbose = True
 # Make sure we find nc2nc in the directory above
 os.environ['PATH'] = '..' + os.pathsep + os.environ['PATH']
 
-ncfiles =['simple_xy.nc']
+ncfiles =['simple_xy.nc', 'simple_xy_noclassic.nc']
 
 def setup_module(module):
     if verbose: print ("setup_module      module:%s" % module.__name__)
@@ -50,7 +50,6 @@ def test_run_compress():
         print("Could not find nccopy in path")
         assert(False)
     # retdict = nccompress.run_nccopy('simple_xy.nc','simple_xy.run_nccopy.nc',level=3,verbose=False,shuffle=True)
-    # pdb.set_trace()
     retdict = nccompress.run_compress('simple_xy.nc','simple_xy.run_nccopy.nc',level=3,verbose=True,shuffle=True,nccopy=True,timing=False)
     print(retdict)
     assert (retdict['orig_size']/retdict['comp_size'] >= 5.)
@@ -58,6 +57,13 @@ def test_run_compress():
     assert retdict['shuffle']
     assert nccompress.are_equal('simple_xy.nc','simple_xy.run_nccopy.nc',verbose=True)
 
+    retdict = nccompress.run_compress('simple_xy_noclassic.nc','simple_xy_noclassic.run_nccopy.nc',level=3,verbose=True,shuffle=True,nccopy=True,timing=False)
+    print(retdict)
+    assert (retdict['orig_size']/retdict['comp_size'] >= 5.)
+    assert (retdict['dlevel'] == 3)
+    assert retdict['shuffle']
+    assert nccompress.are_equal('simple_xy_noclassic.nc','simple_xy_noclassic.run_nccopy.nc',verbose=True)
+
     # This requires nc2nc to be in the path. If nccompress/nc2nc.py has changed this will not be reflect
     # any change until installation. This is a test for nccompres to correctly call nc2nc
     retdict = nccompress.run_compress('simple_xy.nc','simple_xy.run_nc2nc.nc',level=3,verbose=True,shuffle=True,nccopy=False,timing=False)
@@ -70,6 +76,16 @@ def test_run_compress():
 
     assert nccompress.are_equal('simple_xy.run_nc2nc.nc','simple_xy.run_nccopy.nc',verbose=True)
 
+def test_is_netCDF():
+    assert nccompress.is_netCDF('simple_xy.nc')
+    assert nccompress.is_netCDF('simple_xy.run_nc2nc.nc')
+    assert nccompress.is_netCDF('simple_xy.nc') == ('NETCDF4_CLASSIC', False)
+    assert nccompress.is_netCDF('simple_xy.run_nc2nc.nc') == ('NETCDF4_CLASSIC', True)
+    assert nccompress.is_netCDF('simple_xy_noclassic.nc') == ('NETCDF4', False)
+    assert nccompress.is_netCDF('simple_xy_noclassic.run_nccopy.nc') == ('NETCDF4', True)
+    # Test classic model
+    # assert not nccompress.is_compressed('simple_xy.classic.nc')
+
 def test_is_compressed():
     assert not nccompress.is_compressed('simple_xy.nc')
     assert nccompress.is_compressed('simple_xy.run_nc2nc.nc')
diff --git a/test/test_nccopy.py b/test/test_nccopy.py
index 59b1e6d..fb1f64a 100644
--- a/test/test_nccopy.py
+++ b/test/test_nccopy.py
@@ -23,7 +23,7 @@ from nccompress import nccompress
 
 verbose = True
 
-ncfiles =['simple_xy.nc']
+ncfiles =['simple_xy.nc', 'simple_xy_noclassic.nc']
 
 def setup_module(module):
     if verbose: print ("setup_module      module:%s" % module.__name__)
diff --git a/test/test_ncfind.py b/test/test_ncfind.py
index 415dfb5..a3b096c 100644
--- a/test/test_ncfind.py
+++ b/test/test_ncfind.py
@@ -27,7 +27,7 @@ from glob import glob
 
 verbose = True
 
-ncfiles =['simple_xy.nc']
+ncfiles =['simple_xy.nc', 'simple_xy_noclassic.nc']
 
 def setup_module(module):
     if verbose: print ("setup_module      module:%s" % module.__name__)
@@ -63,8 +63,8 @@ def test_find():
     args = ncfind.parse_args(arguments)
     found = ncfind.find_files(args)
     found = [os.path.normpath(file) for file in found]
-    assert(1 == len(found))
-    assert(found == files[0:1])
+    assert(2 == len(found))
+    assert(found == files[0:2])
 
     arguments = ['-c']
     arguments.extend(files)
@@ -72,6 +72,6 @@ def test_find():
     found = ncfind.find_files(args)
     found = [os.path.normpath(file) for file in found]
     assert(1 == len(found))
-    assert(found == files[1:])
+    assert(found == files[-1:])
 
 
diff --git a/test/utils.py b/test/utils.py
index e0bc036..5d5d2e8 100644
--- a/test/utils.py
+++ b/test/utils.py
@@ -28,15 +28,6 @@ def remove_ncfiles(verbose=True):
 
 def make_simple_netcdf_file(ncfiles):
 
-    ## nx = 120
-    ## ny = 600
-
-    ## rootgrp = nc.Dataset("simple_xy.nc", "w", format="NETCDF3_CLASSIC")
-    ## xdim = rootgrp.createDimension("x", 600)
-    ## ydim = rootgrp.createDimension("y", 120)
-    ## data = rootgrp.createVariable("data","f4",("y","x"))
-    ## data[:] = range(0,600) * 120
-    
     # the output array to write will be nx x ny
     ny = 600; nx = 120
     # open a new netCDF file for writing.
@@ -57,6 +48,26 @@ def make_simple_netcdf_file(ncfiles):
     # close the file.
     ncfile.close()
 
+    # the output array to write will be nx x ny
+    ny = 600; nx = 120
+    # open a new netCDF file for writing.
+    ncfile = Dataset(ncfiles[1],'w',format="NETCDF4") 
+    # create the output data.
+    data_out = np.arange(nx*ny)/100. # 1d array
+    data_out.shape = (nx,ny) # reshape to 2d array
+    # create the x and y dimensions.
+    ncfile.createDimension('x',nx)
+    ncfile.createDimension('y',ny)
+    # create the variable (4 byte integer in this case)
+    # first argument is name of variable, second is datatype, third is
+    # a tuple with the names of dimensions.
+    data = ncfile.createVariable('data',np.dtype('float32').char,('x','y'))
+    data.setncattr("Unhidden","test")
+    # write data to variable.
+    data[:] = data_out
+    # close the file.
+    ncfile.close()
+
 if __name__ == "__main__":
 
-    make_simple_netcdf_file(['simple_xy.nc'])
+    make_simple_netcdf_file(['simple_xy.nc', 'simple_xy_noclassic.nc'])

conda/dev-environment.yml
pip install -e .[dev]
parse_log_pytest
environment.yml
pytest
apt-get update
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
cftime @ file:///home/conda/feedstock_root/build_artifacts/cftime_1632539733990/work
charset-normalizer==2.0.12
commonmark==0.9.1
docutils==0.18.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
-e git+https://github.com/coecms/nccompress.git@524f77259ac9727cde5e09e0e8849ead128dd263#egg=nccompress
netCDF4 @ file:///home/conda/feedstock_root/build_artifacts/netcdf4_1633096406418/work
numpy @ file:///home/conda/feedstock_root/build_artifacts/numpy_1626681920064/work
packaging==21.3
pbr @ file:///home/conda/feedstock_root/build_artifacts/pbr_1724777609752/work
pluggy==1.0.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
recommonmark==0.7.1
requests==2.27.1
six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: nccompress
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.1=h5eee18b_0
  - ca-certificates=2025.2.25=h06a4308_0
  - cdo=2.0.3=he19d259_1
  - certifi=2021.5.30=py36h06a4308_0
  - cftime=1.5.1=py36he33b4a0_0
  - curl=8.2.1=h37d81fd_0
  - eccodes=2.26.0=hc08acdf_0
  - expat=2.4.8=h27087fc_0
  - fftw=3.3.10=nompi_h77c792f_102
  - freeglut=3.2.2=h9c3ff4c_1
  - hdf4=4.2.15=h10796ff_3
  - hdf5=1.12.1=nompi_h2750804_100
  - icu=68.2=h9c3ff4c_0
  - jasper=2.0.33=ha77e612_0
  - jbig=2.1=h7f98852_2003
  - jpeg=9e=h166bdaf_1
  - krb5=1.20.1=h568e23c_1
  - ld_impl_linux-64=2.40=h12ee557_0
  - lerc=2.2.1=h9c3ff4c_0
  - libaec=1.0.6=h9c3ff4c_0
  - libblas=3.9.0=16_linux64_openblas
  - libcblas=3.9.0=16_linux64_openblas
  - libcurl=8.2.1=h91b91d3_0
  - libdeflate=1.7=h7f98852_5
  - libedit=3.1.20230828=h5eee18b_0
  - libev=4.33=h516909a_1
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgfortran-ng=13.2.0=h69a702a_0
  - libgfortran5=13.2.0=ha4646dd_0
  - libglu=9.0.0=he1b5a44_1001
  - libgomp=11.2.0=h1234567_1
  - libiconv=1.17=h166bdaf_0
  - liblapack=3.9.0=16_linux64_openblas
  - libnetcdf=4.8.1=nompi_hb3fd0d9_101
  - libnghttp2=1.52.0=ha637b67_1
  - libopenblas=0.3.21=h043d6bf_0
  - libpng=1.6.37=h21135ba_2
  - libssh2=1.10.0=ha56f1ee_2
  - libstdcxx-ng=11.2.0=h1234567_1
  - libtiff=4.3.0=hf544144_1
  - libwebp-base=1.2.2=h7f98852_1
  - libxcb=1.13=h7f98852_1004
  - libxml2=2.9.12=h72842e0_0
  - libzip=1.8.0=h4de3113_1
  - lz4-c=1.9.3=h9c3ff4c_1
  - ncurses=6.4=h6a678d5_0
  - netcdf4=1.5.7=nompi_py36h775750b_103
  - numpy=1.19.5=py36hfc0c790_2
  - openssl=1.1.1w=h7f8727e_0
  - ossuuid=1.6.2=hf484d3e_1000
  - pbr=6.1.0=pyhd8ed1ab_0
  - pip=21.2.2=py36h06a4308_0
  - proj=8.2.1=h277dcde_0
  - pthread-stubs=0.4=h36c2ea0_1001
  - python=3.6.13=h12debd9_1
  - python_abi=3.6=2_cp36m
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - six=1.16.0=pyh6c4a22f_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - udunits2=2.2.28=hc3e0081_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xorg-fixesproto=5.0=h7f98852_1002
  - xorg-inputproto=2.3.2=h7f98852_1002
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libx11=1.7.2=h7f98852_0
  - xorg-libxau=1.0.9=h7f98852_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h7f98852_1
  - xorg-libxfixes=5.0.3=h7f98852_1004
  - xorg-libxi=1.7.10=h7f98852_0
  - xorg-xextproto=7.3.0=h7f98852_1002
  - xorg-xproto=7.0.31=h7f98852_1007
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - zstd=1.5.0=ha95c52a_0
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - commonmark==0.9.1
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - recommonmark==0.7.1
      - requests==2.27.1
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/nccompress

test/test_nccompress.py::test_is_netCDF
test/test_nc2nc.py::test_numvals test/test_nc2nc.py::test_cascadeRounding test/test_nc2nc.py::test_calcChunkShape test/test_nc2nc.py::test_chunk_shape_nD test/test_nc2nc.py::test_nc2nc test/test_nccompress.py::test_are_equal test/test_nccompress.py::test_run_compress test/test_nccompress.py::test_is_compressed test/test_nccompress.py::test_compress_files test/test_nccompress.py::test_compress_nonnetcdf test/test_nccopy.py::test_nccopy test/test_ncfind.py::test_find
nccompress/nccompress.py
nccompress/nccompress.py