10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-22 04:13:33 +01:00

Bug in finaliza

This commit is contained in:
Anthony Scemama 2012-10-05 15:03:32 +02:00
parent 15a0e1e2c5
commit 9c369ef0d0

View File

@ -36,18 +36,25 @@ def create():
out = [] out = []
l = variables.keys() l = variables.keys()
l.sort l.sort
main_modules = filter(lambda x: modules[x].is_main, modules)
finalize = "subroutine irp_finalize_%s\n"%(irp_id) finalize = "subroutine irp_finalize_%s\n"%(irp_id)
for m in filter(lambda x: not modules[x].is_main, modules): for m in filter(lambda x: not modules[x].is_main, modules):
finalize += " use %s\n"%(modules[m].name) finalize += " use %s\n"%(modules[m].name)
for v in l: for v in l:
var = variables[v] var = variables[v]
if var.is_touched: var_in_main = False
out += var.toucher for m in main_modules:
if var.dim != []: if var.fmodule == modules[m].name:
finalize += " if (allocated(%s)) then\n"%v var_in_main = True
finalize += " %s_is_built = .False.\n"%var.same_as break
finalize += " deallocate(%s)\n"%v if not var_in_main:
finalize += " endif\n" if var.is_touched:
out += var.toucher
if var.dim != []:
finalize += " if (allocated(%s)) then\n"%v
finalize += " %s_is_built = .False.\n"%var.same_as
finalize += " deallocate(%s)\n"%v
finalize += " endif\n"
finalize += "end\n" finalize += "end\n"