# cf.close_one_file

`cf.``close_one_file`(file_format=None)

  Close an arbitrary open file containing a sub-array of a data array.

  By default a file of arbitrary format is closed, but the choice may be restricted to files of a particular format.

  Note that the closed file will be automatically reopened if subsequently needed by a variable to access the sub-array.

  If there are no appropriate open files then no action is taken.

  See also

  `cf.close_files`, `cf.open_files`, `cf.open_files_threshold_exceeded`

  Parameters: | file_format : str, optional Only close a file of the given format. Recognised formats are `'netCDF'` and `'PP'`. By default a file of any format is closed.
  Returns: | None
  Examples: |

      >>> cf.close_one_file()
      >>> cf.close_one_file('netCDF')
      >>> cf.close_one_file('PP')

      >>> cf.open_files()
      {'netCDF': {'file1.nc': <netCDF4.Dataset at 0x181bcd0>,
                  'file2.nc': <netCDF4.Dataset at 0x1e42350>,
                  'file3.nc': <netCDF4.Dataset at 0x1d185e9>}}
      >>> cf.close_one_file()
      >>> cf.open_files()
      {'netCDF': {'file1.nc': <netCDF4.Dataset at 0x181bcd0>,
                  'file3.nc': <netCDF4.Dataset at 0x1d185e9>}}