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.
Consider the following reproducer:
The lhs symbols in the array assignments (
SD_VN
orARR
) 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.