Ticket #264 (closed defect: duplicate)

Opened 4 years ago

Last modified 4 years ago

dimension information dropped (set to 1) in some array declarations

Reported by: utke Owned by:
Priority: major Milestone: scale1
Component: Application - SCALE Keywords:
Cc:

Description


Attachments

arrays4.f90 Download (452 bytes) - added by utke 4 years ago.
illstrates the problem; foo_local will be incorrectly elevated to a module variable with the wron dimensions
arrays4_workaround.f90 Download (507 bytes) - added by utke 4 years ago.
the workaround

Change History

Changed 4 years ago by utke

for pxsset_I.f90 :

integer , dimension(nptt,iftg)
inemat

we get:
INTEGER(w2fi4) INEMAT(1 : 1, 1 : 1)

Changed 4 years ago by utke

  • status changed from new to closed
  • resolution set to duplicate

This is a duplicate of #224
rationale: INEMAT is a local variable in a module subroutine that contains another subroutine. The contained subroutine is elevated one level and the local variables of the containing subroutine that are used in the contained routine are elevated to module level.
However nptt and iftg are themselves module variables and are not parameters and therefore cannot be used to declare the dimension of a module variable.
The front end drops them to avoid the conflict and the default replacement with 1 kicks in.
Workaround is to make all such variables part of the argument list to be passed to the contained subroutine

Changed 4 years ago by utke

illstrates the problem; foo_local will be incorrectly elevated to a module variable with the wron dimensions

Changed 4 years ago by utke

the workaround

Note: See TracTickets for help on using tickets.