mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-09-01 09:13:40 +02:00
Bug in finaliza
This commit is contained in:
parent
15a0e1e2c5
commit
9c369ef0d0
@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user