You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
!
! This file is released under terms of BSD license
! See LICENSE file for more information
!
! Simple programto test the kcache directive
!
PROGRAM claw_test
INTEGER:: istart =0INTEGER:: iend =10INTEGER:: jstart =0INTEGER:: jend =20CALL call_test(istart,iend,jstart,jend)
containsPUREFUNCTIONf(i,j)
INTEGER, INTENT(IN) :: i,j
REAL:: f
f =1.0* i * j
ENDFUNCTIONSUBROUTINEcall_test(istart,iend,jstart,jend)
INTEGER, INTENT(IN) :: istart, iend, jstart, jend
INTEGER:: i,j
REAL, DIMENSION(istart:iend,istart:iend) :: array6, array7
DO i = istart, iendDO j = jstart, jend
array6(i,j) =1.0* i * j
END DOEND DODO i = istart, iend
DO j = jstart, jend
!$claw call array6=f(i,j)
array7(i,j) = array6(i,j) *2.0END DOEND DOENDSUBROUTINEcall_testEND PROGRAM claw_test
The text was updated successfully, but these errors were encountered:
FrostyMike
changed the title
Array access to function call crashes on subprograms
"Array access to function call" directive crashes on subprograms
Jan 8, 2021
Function and subroutine should be in a module. At least the current code is checking for that. Function definition should be retrieved differently if there are not nested in a module.
Your original test case does not have function & subroutine in the module. Considering your comment, do I understand correctly that this was not intentional?
At least the current code is not expecting the function and the subroutine to be contained in the program subroutine. I guess a check should be added for that.
The text was updated successfully, but these errors were encountered: