mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Sun Feb 18, 2024 1:20 pm Post subject: FTN95 does not allow FINDLOC for LOGICAL arrays |
|
|
The FINDLOC intrinsic function was added in F2008, and it was added to the repertoire of FTN95 in 2022. The BACK optional argument was added to FTN95 in Nov. 2023. According to F2008 the required first argument, ARRAY, may be an array of any intrinsic type. FTN95, however, does not allow ARRAY to be of type logical.
Code: | program tfindloc
implicit none
real :: rhs(6) = (/ -2.5, -1.3, 0.0, 0.0, 0.0, 1.551E-4 /)
integer :: ifloc
! Find the position of the first non-zero in rhs and put it in IFLOC
ifloc = FINDLOC(abs(rhs) > 0.0, VALUE = .true., DIM = 1)
print *,' ifmloc = ',ifloc ! expected: 1
end program |
The compiler says:
Code: | T:\HST216\ASIZN2>ftn95 tminloc.f90
[FTN95/Win32 Ver. 9.02.0.0 Copyright (c) Silverfrost Ltd 1993-2024]
ERROR T:\HST216\ASIZN2\tminloc.F90 8: The first argument (ARRAY) to the intrinsic FINDLOC must be of INTEGER or REAL type, not LOGICAL(KIND=3)
ERROR T:\HST216\ASIZN2\tminloc.F90 8: The second argument (VALUE) to the intrinsic FINDLOC must be of INTEGER or REAL type, not LOGICAL(KIND=3)
ERROR T:\HST216\ASIZN2\tminloc.F90 8: The first argument of FINDLOC must not be a scalar
ERROR T:\HST216\ASIZN2\tminloc.F90 8: Compilation abandoned |
Last edited by mecej4 on Mon Feb 19, 2024 12:09 pm; edited 1 time in total |
|