10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-06-02 11:25:19 +02:00

Bug in IRP_stack corrected

This commit is contained in:
Anthony Scemama 2014-10-07 11:41:48 +02:00
parent 7266a92c7f
commit 673220f1a9
2 changed files with 8 additions and 5 deletions

View File

@ -131,15 +131,15 @@ end subroutine
!$OMP END PARALLEL !$OMP END PARALLEL
!$OMP CRITICAL !$OMP CRITICAL
if (.not.alloc) then if (.not.alloc) then
allocate(irp_stack(STACKMAX,nthread+1)) allocate(irp_stack(0:STACKMAX,nthread+1))
allocate(irp_cpu(STACKMAX,nthread+1)) allocate(irp_cpu(0:STACKMAX,nthread+1))
allocate(stack_index(nthread+1)) allocate(stack_index(nthread+1))
stack_index = 0 stack_index = 0
alloc = .True. alloc = .True.
endif endif
!$OMP END CRITICAL !$OMP END CRITICAL
endif endif
stack_index(ithread+1) = stack_index(ithread+1)+1 stack_index(ithread+1) = mod(stack_index(ithread+1)+1,STACKMAX)
irp_stack(stack_index(ithread+1),ithread+1) = irp_where""") irp_stack(stack_index(ithread+1),ithread+1) = irp_where""")
if command_line.do_memory: if command_line.do_memory:
txt+=""" txt+="""

View File

@ -433,7 +433,7 @@ class Variable(object):
def free(self): def free(self):
if '_free' not in self.__dict__: if '_free' not in self.__dict__:
name = self.name name = self.name
result = [ "!","! >>> FREE %s"%(self.name), result = [ "!","! >>> FREE %s"%(name),
" %s_is_built = .False."%(self.same_as) ] " %s_is_built = .False."%(self.same_as) ]
if self.dim != []: if self.dim != []:
if command_line.do_memory: if command_line.do_memory:
@ -495,7 +495,10 @@ class Variable(object):
return result return result
def do_allocate(): def do_allocate():
result = " allocate(%s(%s),stat=irp_err)" if command_line.coarray:
result = " allocate(%s(%s)[*],stat=irp_err)"
else:
result = " allocate(%s(%s),stat=irp_err)"
result = result%(name,','.join(self.dim)) result = result%(name,','.join(self.dim))
if command_line.do_memory: if command_line.do_memory:
tmp = "\n print *, %s, 'Allocating %s(%s)'" tmp = "\n print *, %s, 'Allocating %s(%s)'"