10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-21 11:53:32 +01:00

Work to do

This commit is contained in:
Anthony Scemama 2013-11-20 17:43:03 +01:00
parent 57a09925e4
commit efd67d12f9
3 changed files with 13 additions and 22 deletions

View File

@ -1,22 +0,0 @@
BEGIN_PROVIDER [ integer, d1 ]
&BEGIN_PROVIDER [ integer, d2 ]
&BEGIN_PROVIDER [ integer, d3 ]
&BEGIN_PROVIDER [ integer, d4 ]
&BEGIN_PROVIDER [ integer, d5 ]
print *, 'd1'
read(*,*) d1
BEGIN_TEMPLATE
print *, '$X'
read(*,*) $X
ASSERT ( $X > $Y )
SUBST [ X, Y ]
d2; d1;;
d3; d2;;
d4; d3;;
d5; d4;;
END_TEMPLATE
END_PROVIDER

View File

@ -48,6 +48,7 @@ options['s'] = [ 'substitute' , 'Substitute values in do loops for generating
options['r'] = [ 'no_directives', 'Ignore all compiler directives !DEC$ and !DIR$', 0 ]
options['n'] = [ 'inline' , 'all|providers|builders : Force inlining of providers or builders', 1 ]
options['u'] = [ 'unused' , 'Print unused providers', 0 ]
options['I'] = [ 'include' , 'Include directory', 1 ]
class CommandLine(object):
@ -67,6 +68,15 @@ class CommandLine(object):
return self._defined
defined = property(fget=defined)
def include_dir(self):
if '_include_dir' not in self.__dict__:
self._include_dir = []
for o,a in self.opts:
if o in [ "-I", '--'+options['I'][0] ]:
self._include_dir.append(a)
return self._include_dir
include_dir = property(fget=include_dir)
def inline(self):
if '_inline' not in self.__dict__:
self._inline = ""

View File

@ -349,8 +349,11 @@ def create_irpf90_files():
def is_irpf90_file(filename):
return filename.endswith(".irp.f") and not filename.startswith('.')
result = filter ( is_irpf90_file, os.listdir(os.getcwd()) )
for dir in command_line.include_dir:
result += map(lambda x: dir+'/'+x, filter ( is_irpf90_file, os.listdir(dir) ) )
return result
irpf90_files = create_irpf90_files()
print irpf90_files