def ReadFile(fileName, show='silent', mode='r'):
    """Reads netCDF4 file fileName and shows available variables.

        INPUTS:
        fileName: full path to file
        show:     how much detail to show; 'silent' for nothing, 'short' for one line, 'full'
                    for full dimensionality and attributes
        mode:     'r' for read only, 'w' for write, 'r+' for read-write
        OUTPUTS:
        file:     netCDF4 Dataset
    """
    import os
    import netCDF4 as nc
    if not os.path.isfile(fileName):
        raise IOError('File ' + fileName + ' does not exist')
    file = nc.Dataset(fileName, mode)
    if show != 'silent':
        print('All variables:', file.variables.keys())
        for g in file.groups.keys():
            print('              ', 'group ' + g + ':')
            print('              ', file.groups[g].variables.keys())
    if show == 'full':
        for v in file.variables.keys():
            if v not in file.dimensions:
                print(file.variables[v])
        for g in file.groups.keys():
            for v in file.groups[g].variables.keys():
                if v not in file.dimensions:
                    print(g + '/' + file.variables[v])
    return file
