Skip to content

Claw expand directive: jk-1 dependencies not transformed correctly #605

@elsagermann

Description

@elsagermann

I have a small part of the ham code which is a loop over 2:klev with one variable then depending on 1:(klev-1). I would expect the compiler to change the code to jk & jk-1 for the 1:(klev-1) array notation but it is just transforming everything to jk, which is wrong.

Original code

!$claw expand
  pxtte(1:kproma,2:klev)=pxtte(1:kproma,2:klev)                           &
                    + (psediflux(1:kproma,1:(klev-1))/pmconv(1:kproma,2:klev))
!$claw end expand

Transformation code

DO claw_induction_18 = 1 , kproma
   DO claw_induction_19 = 2 , klev
    pxtte ( claw_induction_18 , claw_induction_19 ) = pxtte ( claw_induction_18 , claw_induction_19 ) + psediflux (&
     claw_induction_18 , claw_induction_19 ) / pmconv ( claw_induction_18 , claw_induction_19 )
   END DO
END DO

Expected code

DO claw_induction_18 = 1 , kproma
   DO claw_induction_19 = 2 , klev
    pxtte ( claw_induction_18 , claw_induction_19 ) = pxtte ( claw_induction_18 , claw_induction_19 ) + psediflux (&
     claw_induction_18 , claw_induction_19 - 1 ) / pmconv ( claw_induction_18 , claw_induction_19 )
   END DO
END DO

Execution of clawfc

Related issues (if any)

Issue #00

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions