code: def index_modules(root) -> Dict:
      
  
      module_index_dict = {
          node["name"]: (node.get("tag"), index)
          for index, node in enumerate(root)
          if node.get("tag") in ("module", "program", "subroutine")
      }
  
      return module_index_dict
docs: Counts the number of modules in the Fortran file including the program
      file. Each module is written out into a separate Python file.