Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fparser frontend: Array assignments may wrongfully be interpreted as StatementFunction #326

Closed
reuterbal opened this issue Jun 11, 2024 · 0 comments · Fixed by #327
Closed
Assignees
Labels
bug Something isn't working

Comments

@reuterbal
Copy link
Collaborator

Consider the following reproducer:

SUBROUTINE SOME_ROUTINE(YDFIELDS,YDMODEL)
USE FIELDS_MOD         , ONLY : FIELDS
USE TYPE_MODEL         , ONLY : MODEL
USE VAR_MOD            , ONLY : ARR
IMPLICIT NONE
TYPE(FIELDS)        ,INTENT(INOUT) :: YDFIELDS
TYPE(MODEL)         ,INTENT(INOUT) :: YDMODEL

ASSOCIATE(YDSURF=>YDFIELDS%YRSURF)
ASSOCIATE(SD_VN=>YDSURF%SD_VN,YSD_VN=>YDSURF%YSD_VN, &
 & LEGBRAD=>YDMODEL%YRML_PHY_EC%YREPHY%LEGBRAD)
IF(LEGBRAD)SD_VN(:,YSD_VN%YACCPR5%MP,:)=SD_VN(:,YSD_VN%YACCPR%MP,:)
IF(LEGBRAD)ARR(:,YSD_VN%YACCPR5%MP,:)=SD_VN(:,YSD_VN%YACCPR%MP,:)
END ASSOCIATE
END ASSOCIATE
END SUBROUTINE SOME_ROUTINE

The lhs symbols in the array assignments (SD_VN or ARR) are missing shape information, which we use as an indicator to assume that this could be a statement function declaration that has simply been misclassified by Fparser. We need to expand the check to make sure these are not missing the shape information simply because it's deferred, e.g., due to import or association.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant