mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-22 04:13:33 +01:00
Added irp_id and deallocate array upon termination
Version:1.1.73
This commit is contained in:
parent
3289431ca8
commit
b4e93c05da
@ -87,10 +87,6 @@ def main():
|
|||||||
import touches
|
import touches
|
||||||
touches.create()
|
touches.create()
|
||||||
|
|
||||||
if command_line.do_openmp:
|
|
||||||
import locks
|
|
||||||
locks.create()
|
|
||||||
|
|
||||||
import create_man
|
import create_man
|
||||||
create_man.run()
|
create_man.run()
|
||||||
|
|
||||||
|
@ -24,9 +24,12 @@
|
|||||||
# 31062 Toulouse Cedex 4
|
# 31062 Toulouse Cedex 4
|
||||||
# scemama@irsamc.ups-tlse.fr
|
# scemama@irsamc.ups-tlse.fr
|
||||||
|
|
||||||
|
import os
|
||||||
|
from zlib import crc32
|
||||||
|
|
||||||
irpdir = "IRPF90_temp/"
|
irpdir = "IRPF90_temp/"
|
||||||
mandir = "IRPF90_man/"
|
mandir = "IRPF90_man/"
|
||||||
|
irp_id = crc32(os.getcwd())
|
||||||
|
|
||||||
|
|
||||||
class Line(object):
|
class Line(object):
|
||||||
|
@ -191,6 +191,7 @@ class Fmodule(object):
|
|||||||
if command_line.do_openmp:
|
if command_line.do_openmp:
|
||||||
temp += [ "!$OMP END MASTER" ]
|
temp += [ "!$OMP END MASTER" ]
|
||||||
temp += [ "!$OMP END PARALLEL" ]
|
temp += [ "!$OMP END PARALLEL" ]
|
||||||
|
temp += [ " call irp_finalize_%s()"%(irp_id) ]
|
||||||
temp += [ "end program" ]
|
temp += [ "end program" ]
|
||||||
result = temp + result
|
result = temp + result
|
||||||
self._residual_text = result
|
self._residual_text = result
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
from irpf90_t import *
|
from irpf90_t import *
|
||||||
from util import *
|
from util import *
|
||||||
from variables import variables
|
from variables import variables
|
||||||
|
from modules import modules
|
||||||
|
|
||||||
FILENAME=irpdir+'irp_touches.irp.F90'
|
FILENAME=irpdir+'irp_touches.irp.F90'
|
||||||
|
|
||||||
@ -35,15 +36,26 @@ def create():
|
|||||||
out = []
|
out = []
|
||||||
l = variables.keys()
|
l = variables.keys()
|
||||||
l.sort
|
l.sort
|
||||||
|
finalize = "subroutine irp_finalize_%s\n"%(irp_id)
|
||||||
|
for m in filter(lambda x: not modules[x].is_main, modules):
|
||||||
|
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:
|
if var.is_touched:
|
||||||
out += var.toucher
|
out += var.toucher
|
||||||
|
var2 = variables[v]
|
||||||
|
if var2.dim != []:
|
||||||
|
finalize += " if (allocated(%s)) then\n"%v
|
||||||
|
finalize += " deallocate(%s)\n"%v
|
||||||
|
finalize += " endif\n"
|
||||||
|
finalize += "end\n"
|
||||||
|
|
||||||
|
|
||||||
if out != []:
|
if out != []:
|
||||||
out = map(lambda x: "%s\n"%(x),out)
|
out = map(lambda x: "%s\n"%(x),out)
|
||||||
else:
|
|
||||||
out = ["subroutine irpf90_dummy_touch()\n", "end\n"]
|
out += finalize
|
||||||
|
|
||||||
if not same_file(FILENAME,out):
|
if not same_file(FILENAME,out):
|
||||||
file = open(FILENAME,'w')
|
file = open(FILENAME,'w')
|
||||||
file.writelines(out)
|
file.writelines(out)
|
||||||
|
@ -1 +1 @@
|
|||||||
version = "1.1.72"
|
version = "1.1.73"
|
||||||
|
Loading…
Reference in New Issue
Block a user