I will start with I am new to Fortran and to this forum so if there are any suggestions. Thanks in advance.
My issue I that I keep coming across is error 6634 and 8284 when trying to use subroutines that operate on element operations. I have created a simple routine to hopefully illustrate my problem as my code is too large to include.
I have also included my workaround for Error 7710 related to passing a section of an array and wanted to know if there is a better workaround or best practice?
program Test_Scale_Array implicit none ! Variables REAL(KIND=8), Dimension(:), Allocatable :: var3 REAL(KIND=8), Dimension(1:10) :: var2,exponent REAL(KIND=8) :: var4 integer, Dimension(5) :: x integer :: i ! Body of Test_Scale_Array var2 = 4.0D0 var4 = 4.0D0 exponent = 2.0D0 !have routine that is meant mostly for this call simplesquare(var2,exponent) !Gives Error 8284 & 6634 call simplesquare(var4) !Gives Error 6634 call simplesquare(var2(2),exponent(2)) !Selection and calculation on a portion of array x = (/(2*i,i=1,5)/) !Gives error #7710 call simplesquare(var2(x)) !Is there a faster/better way for the workaround? Allocate( var3(1:5) ) var3 = var2(x) call simplesquare(var3) var2(x) = var3 deallocate( var3 ) contains subroutine simplesquare(x,y) ! Variables REAL(Kind=8), Dimension(:), INTENT(inout) :: x REAL(Kind=8), Dimension(:), OPTIONAL :: y ! Body of simplesquare if (present(Y)) then x = x**y else x = x**2 endif end subroutine simplesquare end program Test_Scale_Array
Thanks
Jim