Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

integer(8) causes array temperary

$
0
0

Hi

In the sample below: changing integer to integer(8) is giving an array-temporary. Is standard violated by the program (in subroutine Method's argument declarations for arrays A and B)?

Compile with "ifort /check:arg_temp_created". I am using XE 2015 Update 2 package 179 with VS2012.

Abhi

---

   Module OM
      Implicit None
      !Integer :: KK
      Integer(8) :: KK
   Contains
      Subroutine Method(A, B)
         Real(8), Intent(INOUT) :: A(KK,KK), B(KK)
         A = 0.0d0; B = 1.0d0
      End Subroutine Method
   End Module OM
   
   Module Shree
      Use OM
   Contains
      Subroutine Set(C)
         Real(8), Intent(IN), Target :: C(KK*KK+KK)
         Real(8), Pointer :: pC(:) => Null()
         pC => C
         Call Method(pC(1:), pC(KK*KK+1:))
      End Subroutine Set
   End Module Shree
   
   Program Test
      Use Shree
      Implicit None
      Real(8), Allocatable :: C(:)
      
      Print *, "Give KK"
      Read *, KK
      Allocate(C(KK*KK + KK))
      Call Set(C)
      Print *, C(KK)
   End Program Test


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>