def METHOD_NAME(env, **kw):
    conf = env.Configure(custom_tests = {'CheckLib': utils.checks.CheckLib,
                                         'CheckLibWithHeader': utils.checks.CheckLibWithHeader,
                                         'CheckNetcdfLinking' : CheckNetcdfLinking})
    if 'parallel' in kw and kw['parallel']:
        parallel = True
        header = 'netcdf_par.h'
    else:
        parallel = False
        header = 'netcdf.h'
    if 'required' in kw:
        required = kw['required']
    else:
        required = False
    if not conf.CheckLibWithHeader('netcdf', header, 'c'):
        if required:
            print('Could not find netCDF!')
            env.Exit(1)
        else:
            conf.Finish()
            return
    ret = conf.CheckNetcdfLinking(parallel, "Checking whether shared netCDF library is used")
    if not ret:
        # Static library, link with HDF5 and zlib as well
        ret = [conf.CheckLib(lib) for lib in ['hdf5_hl', 'hdf5', 'z']]
        if not all(ret):
            if required:
                print('Could not find HDF5 or zlib!')
                env.Exit(1)
            else:
                conf.Finish()
                return
        # Try to find all additional libraries
        conf.CheckLib('curl')
        conf.CheckLib('gpfs')
        conf.CheckLib('dl')
        ret = conf.CheckNetcdfLinking(parallel, "Checking whether all netCDF dependencies are found")
        if not ret:
            if required:
                print('Could not find all netCDF dependencies!')
                env.Exit(1)
            else:
                conf.Finish()
                return
    conf.Finish()