def correlate(self):
print("<STR_LIT>")<EOL>non_local_mods = INTRINSIC_MODS        <EOL>for item in self.settings['<STR_LIT>']:<EOL><INDENT>i = item.index('<STR_LIT::>')<EOL>if i < <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>'.format(item))<EOL>continue<EOL><DEDENT>name = item[:i].strip()<EOL>url = item[i+<NUM_LIT:1>:].strip()<EOL>non_local_mods[name.lower()] = '<STR_LIT>'.format(url,name)<EOL><DEDENT>for s in self.modules:<EOL><INDENT>id_mods(s, self.modules, non_local_mods, self.submodules)<EOL><DEDENT>for s in self.procedures:<EOL><INDENT>id_mods(s, self.modules, non_local_mods, self.submodules)<EOL><DEDENT>for s in self.programs:<EOL><INDENT>id_mods(s, self.modules, non_local_mods, self.submodules)<EOL><DEDENT>for s in self.submodules:<EOL><INDENT>id_mods(s, self.modules, non_local_mods, self.submodules)<EOL><DEDENT>for s in self.blockdata:<EOL><INDENT>id_mods(s, self.modules, non_local_mods, self.submodules)<EOL><DEDENT>deplist = {}<EOL>def get_deps(item):<EOL><INDENT>uselist = [m[<NUM_LIT:0>] for m in item.uses]<EOL>for proc in getattr(item,'<STR_LIT>',[]):<EOL><INDENT>uselist.extend(get_deps(proc))<EOL><DEDENT>for proc in getattr(item,'<STR_LIT>',[]):<EOL><INDENT>uselist.extend(get_deps(proc))<EOL><DEDENT>for proc in getattr(item,'<STR_LIT>',[]):<EOL><INDENT>uselist.extend(get_deps(proc))<EOL><DEDENT>return uselist<EOL><DEDENT>for mod in self.modules:<EOL><INDENT>uselist = get_deps(mod)<EOL>uselist = [m for m in uselist if type(m) == ford.sourceform.FortranModule]<EOL>deplist[mod] = set(uselist)<EOL>mod.deplist = uselist<EOL><DEDENT>for mod in self.submodules:<EOL><INDENT>if type(mod.ancestor_mod) is ford.sourceform.FortranModule:<EOL><INDENT>uselist = get_deps(mod)<EOL>uselist = [m for m in uselist if type(m) == ford.sourceform.FortranModule]<EOL>if mod.ancestor:<EOL><INDENT>if type(mod.ancestor) is ford.sourceform.FortranSubmodule:<EOL><INDENT>uselist.insert(<NUM_LIT:0>,mod.ancestor)<EOL><DEDENT>elif self.settings['<STR_LIT>'].lower() == '<STR_LIT:true>':<EOL><INDENT>print('<STR_LIT>' + mod.name)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>uselist.insert(<NUM_LIT:0>,mod.ancestor_mod)<EOL><DEDENT>mod.deplist = uselist<EOL>deplist[mod] = set(uselist)<EOL><DEDENT>elif self.settings['<STR_LIT>'].lower() == '<STR_LIT:true>':<EOL><INDENT>print('<STR_LIT>' + mod.name)<EOL><DEDENT><DEDENT>if self.settings['<STR_LIT>'].lower() == '<STR_LIT:true>':<EOL><INDENT>for proc in self.procedures:<EOL><INDENT>proc.deplist = set([m for m in get_deps(proc) if type(m) == ford.sourceform.FortranModule])<EOL><DEDENT>for prog in self.programs:<EOL><INDENT>prog.deplist = set([m for m in get_deps(prog) if type(m) == ford.sourceform.FortranModule])<EOL><DEDENT>for block in self.blockdata:<EOL><INDENT>block.deplist = set([m for m in get_deps(block) if type(m) == ford.sourceform.FortranModule])<EOL><DEDENT><DEDENT>ranklist = toposort.toposort_flatten(deplist)<EOL>for proc in self.procedures:<EOL><INDENT>if proc.parobj == '<STR_LIT>': ranklist.append(proc)<EOL><DEDENT>ranklist.extend(self.programs)<EOL>ranklist.extend(self.blockdata)<EOL>for container in ranklist:<EOL><INDENT>if type(container) != str: container.correlate(self)<EOL><DEDENT>for container in ranklist:<EOL><INDENT>if type(container) != str: container.prune()<EOL><DEDENT>if self.settings['<STR_LIT>'] == '<STR_LIT:.>':<EOL><INDENT>url = '<STR_LIT:..>'<EOL><DEDENT>else:<EOL><INDENT>url = self.settings['<STR_LIT>']<EOL><DEDENT>for sfile in self.files:<EOL><INDENT>for module in sfile.modules:<EOL><INDENT>for function in module.functions:<EOL><INDENT>self.procedures.append(function)<EOL><DEDENT>for subroutine in module.subroutines:<EOL><INDENT>self.procedures.append(subroutine)<EOL><DEDENT>for interface in module.interfaces:<EOL><INDENT>self.procedures.append(interface)<EOL><DEDENT>for absint in module.absinterfaces:<EOL><INDENT>self.absinterfaces.append(absint)<EOL><DEDENT>for dtype in module.types:<EOL><INDENT>self.types.append(dtype)<EOL><DEDENT><DEDENT>for module in sfile.submodules:<EOL><INDENT>for function in module.functions:<EOL><INDENT>self.procedures.append(function)<EOL><DEDENT>for subroutine in module.subroutines:<EOL><INDENT>self.procedures.append(subroutine)<EOL><DEDENT>for function in module.modfunctions:<EOL><INDENT>self.submodprocedures.append(function)<EOL><DEDENT>for subroutine in module.modsubroutines:<EOL><INDENT>self.submodprocedures.append(subroutine)<EOL><DEDENT>for modproc in module.modprocedures:<EOL><INDENT>self.submodprocedures.append(modproc)<EOL><DEDENT>for interface in module.interfaces:<EOL><INDENT>self.procedures.append(interface)<EOL><DEDENT>for absint in module.absinterfaces:<EOL><INDENT>self.absinterfaces.append(absint)<EOL><DEDENT>for dtype in module.types:<EOL><INDENT>self.types.append(dtype)<EOL><DEDENT><DEDENT>for program in sfile.programs:<EOL><INDENT>for function in program.functions:<EOL><INDENT>self.procedures.append(function)<EOL><DEDENT>for subroutine in program.subroutines:<EOL><INDENT>self.procedures.append(subroutine)<EOL><DEDENT>for interface in program.interfaces:<EOL><INDENT>self.procedures.append(interface)<EOL><DEDENT>for absint in program.absinterfaces:<EOL><INDENT>self.absinterfaces.append(absint)<EOL><DEDENT>for dtype in program.types:<EOL><INDENT>self.types.append(dtype)<EOL><DEDENT><DEDENT>for block in sfile.blockdata:<EOL><INDENT>for dtype in block.types:<EOL><INDENT>self.types.append(dtype)<EOL><DEDENT><DEDENT><DEDENT>def sum_lines(*argv, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>routine = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>n = <NUM_LIT:0><EOL>for arg in argv:<EOL><INDENT>for item in arg:<EOL><INDENT>n += getattr(item, routine)<EOL><DEDENT><DEDENT>return n<EOL><DEDENT>self.mod_lines = sum_lines(self.modules, self.submodules)<EOL>self.proc_lines = sum_lines(self.procedures)<EOL>self.file_lines = sum_lines(self.files)<EOL>self.type_lines = sum_lines(self.types)<EOL>self.type_lines_all = sum_lines(self.types, func='<STR_LIT>')<EOL>self.absint_lines = sum_lines(self.absinterfaces)<EOL>self.prog_lines = sum_lines(self.programs)<EOL>self.block_lines = sum_lines(self.blockdata)<EOL>print()<EOL>
Associates various constructs with each other.