mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-22 12:23:32 +01:00
More logical allocate
This commit is contained in:
parent
3c89b53828
commit
5379700a3d
@ -9,12 +9,19 @@ SUBROUTINE allocate_{name}
|
|||||||
|
|
||||||
CHARACTER*(9+{@size key=name/}),PARAMETER :: irp_here = 'allocate_{name}'
|
CHARACTER*(9+{@size key=name/}),PARAMETER :: irp_here = 'allocate_{name}'
|
||||||
INTEGER :: irp_err
|
INTEGER :: irp_err
|
||||||
|
LOGICAL :: alloc
|
||||||
|
|
||||||
IF ( ALLOCATED({name}) .AND.( &
|
alloc = ALLOCATED({name})
|
||||||
|
|
||||||
|
IF ( alloc .AND.( &
|
||||||
{#l_dim}
|
{#l_dim}
|
||||||
( SIZE({name},{rank}) /= {value} ) {@sep}.OR.{/sep} &
|
( SIZE({name},{rank}) == {value} ) {@sep}.OR.{/sep} &
|
||||||
{/l_dim})) THEN
|
{/l_dim})) THEN
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
ELSE IF (.NOT.alloc) THEN
|
||||||
|
GO TO 666
|
||||||
|
ELSE
|
||||||
{?do_memory} PRINT*, irp_here//': Deallocated {name}' {/do_memory}
|
{?do_memory} PRINT*, irp_here//': Deallocated {name}' {/do_memory}
|
||||||
DEALLOCATE({name},STAT=irp_err)
|
DEALLOCATE({name},STAT=irp_err)
|
||||||
|
|
||||||
@ -24,10 +31,6 @@ SUBROUTINE allocate_{name}
|
|||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
GO TO 666
|
GO TO 666
|
||||||
ELSE IF (.NOT.ALLOCATED({name})) THEN
|
|
||||||
GO TO 666
|
|
||||||
ELSE
|
|
||||||
RETURN
|
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
666 CONTINUE
|
666 CONTINUE
|
||||||
|
Loading…
Reference in New Issue
Block a user