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

QmcChem OK

Version:1.1.13
This commit is contained in:
Anthony Scemama 2009-09-14 14:36:39 +02:00
parent e76b6d967f
commit 6da6ed407e
4 changed files with 44 additions and 41 deletions

View File

@ -125,7 +125,7 @@ def get_parsed_text():
check_touch(line,vars,main_vars)
txt = " ".join(vars)
result += [ ([],Simple_line(line.i,"!",line.filename)),
([],Simple_line(line.i,"! >>> TOUCH %s"%(txt,),line.filename)) ]
(vars,Simple_line(line.i,"! >>> TOUCH %s"%(txt,),line.filename)) ]
def fun(x):
if x not in variables:
error.fail(line,"Variable %s unknown"%(x,))
@ -328,7 +328,7 @@ parsed_text = result
######################################################################
if __name__ == '__main__':
for i in range(len(parsed_text)):
if parsed_text[i][0] == 'mpi.irp.f':
if parsed_text[i][0] == 'vmc_step.irp.f':
print '!-------- %s -----------'%(parsed_text[i][0])
for line in parsed_text[i][1]:
print line[1]

View File

@ -241,7 +241,7 @@ class Variable(object):
" open(unit=irp_iunit,file='irpf90_%s_'//trim(irp_num),form='FORMATTED',status='OLD',action='READ')"%(n),
" read(irp_iunit,*) %s%s"%(n,build_dim(variables[n].dim)),
" close(irp_iunit)" ]
rsult += [ \
result += [ \
" call touch_%s"%(name),
" %s_is_built = .True."%(name) ]
if command_line.do_debug:
@ -409,42 +409,43 @@ class Variable(object):
if '_builder' not in self.__dict__:
if not self.is_main:
self._builder = []
import parsed_text
from variables import build_use, call_provides
for filename,buffer in parsed_text.parsed_text:
if self.line.filename[0].startswith(filename):
break
text = []
same_as = self.same_as
inside = False
for vars,line in buffer:
if isinstance(line,Begin_provider):
if line.filename[1] == same_as:
inside = True
vars = []
if inside:
text.append( (vars,line) )
text += map( lambda x: ([],Simple_line(line.i,x,line.filename)), call_provides(vars) )
if isinstance(line,End_provider):
if inside:
else:
import parsed_text
from variables import build_use, call_provides
for filename,buffer in parsed_text.parsed_text:
if self.line.filename[0].startswith(filename):
break
name = self.name
text = parsed_text.move_to_top(text,Declaration)
text = parsed_text.move_to_top(text,Implicit)
text = parsed_text.move_to_top(text,Use)
text = map(lambda x: x[1], text)
for line in filter(lambda x: type(x) not in [ Begin_doc, End_doc, Doc], text):
if type(line) == Begin_provider:
result = [ "subroutine bld_%s"%(name) ]
result += build_use([name]+self.needs)
elif type(line) == Cont_provider:
pass
elif type(line) == End_provider:
result.append( "end subroutine bld_%s"%(name) )
break
else:
result.append(line.text)
self._builder = result
text = []
same_as = self.same_as
inside = False
for vars,line in buffer:
if isinstance(line,Begin_provider):
if line.filename[1] == same_as:
inside = True
vars = []
if inside:
text.append( (vars,line) )
text += map( lambda x: ([],Simple_line(line.i,x,line.filename)), call_provides(vars) )
if isinstance(line,End_provider):
if inside:
break
name = self.name
text = parsed_text.move_to_top(text,Declaration)
text = parsed_text.move_to_top(text,Implicit)
text = parsed_text.move_to_top(text,Use)
text = map(lambda x: x[1], text)
for line in filter(lambda x: type(x) not in [ Begin_doc, End_doc, Doc], text):
if type(line) == Begin_provider:
result = [ "subroutine bld_%s"%(name) ]
result += build_use([name]+self.needs)
elif type(line) == Cont_provider:
pass
elif type(line) == End_provider:
result.append( "end subroutine bld_%s"%(name) )
break
else:
result.append(line.text)
self._builder = result
return self._builder
builder = property(builder)

View File

@ -34,9 +34,11 @@ def build_use(vars):
return result
######################################################################
def call_provides(vars):
def call_provides(vars,opt=False):
vars = make_single( map(lambda x: variables[x].same_as, vars) )
vars = map(lambda x: variables[x].name,vars)
if opt:
all_children = flatten( map(lambda x: variables[x].children, vars ))
vars = filter(lambda x: x not in all_children,vars)
def fun(x):
return [ \
" if (.not.%s_is_built) then"%(x),

View File

@ -1 +1 @@
version = "1.1.12"
version = "1.1.13"