def convert(tree,fileName=None):
  """
    Converts input files to be compatible with merge request #1573:
    Change Metrics to use subType formula
    @ In, tree, xml.etree.ElementTree.ElementTree object, the contents of a RAVEN input file
    @ In, fileName, the name for the raven input file
    @Out, tree, xml.etree.ElementTree.ElementTree object, the modified RAVEN input file
  """
  simulation = tree.getroot()
  # metrics
  metrics = simulation.find('Metrics')
  if metrics is not None:
    for child in metrics:
      if child.tag != 'Metric':
        subType = child.tag
        child.tag = 'Metric'
        child.attrib['subType'] = subType
  # postprocessors
  models = simulation.find('Models')
  if models is not None:
    for pp in models.findall('PostProcessor'):
      for node in pp.findall('Metric'):
        if node.attrib.get('class', None) == 'Metrics':
          node.attrib['type'] = 'Metric'
  return tree