code: def get_fname_meta(fp):
      
  
      # Strip directory, extension, then split
      if '/' in fp:
          fp = os.path.split(fp)[1]
      fname = os.path.splitext(fp)[0]
      meta = fname.split('-')
  
      res = {}
  
      try:
          for key in FNAME_ATTS:
              res[key] = meta.pop(0)
      except IndexError:
          raise PathError(fname)
  
      return res
docs: Processes a CMIP3 style file name.
  
      Filename is of pattern:
  
          <model>-<experiment>-<variable_name>-<ensemble_member>.nc
  
      Arguments:
          fp (str): A file path/name conforming to DRS spec.
  
      Returns:
          dict: Metadata as extracted from the filename.
  
      .. _Data Reference Syntax:
         http://cmip-pcmdi.llnl.gov/cmip5/docs/cmip5_data_reference_syntax.pdf