Skip to content

Instantly share code, notes, and snippets.

@rofirrim
Created November 7, 2013 17:35
Show Gist options
  • Save rofirrim/7358592 to your computer and use it in GitHub Desktop.
Save rofirrim/7358592 to your computer and use it in GitHub Desktop.
Intel Fortran does not compile this :(
MODULE a
IMPLICIT NONE
INTEGER(4), PUBLIC :: x1
INTEGER(4), PUBLIC :: x2
END MODULE a
MODULE a2
IMPLICIT NONE
INTEGER(4), PUBLIC :: x1
INTEGER(4), PUBLIC :: x2
END MODULE a2
MODULE b
USE a
IMPLICIT NONE
PRIVATE
INTERFACE c
MODULE PROCEDURE d
END INTERFACE c
PUBLIC :: c
CONTAINS
SUBROUTINE d(w)
IMPLICIT NONE
INTEGER(4), OPTIONAL :: w(x1:x2)
END SUBROUTINE d
END MODULE b
MODULE main
USE a2
USE b
IMPLICIT NONE
CONTAINS
SUBROUTINE foo()
IMPLICIT NONE
INTEGER(4) :: i
CALL c()
DO i = x1, x2, 1 ! <-- References to x1 and x2 fail
CONTINUE
END DO
END SUBROUTINE foo
END MODULE main
@rofirrim
Copy link
Author

rofirrim commented Nov 7, 2013

Workaround, in line 32 replace

USE B

by

USE B, ONLY : C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment