Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

migrating from CVF: ASSOCIATED

cmichotte
Beginner
324 Views
Hello,
The following test code runs with CVF (and also Lahey fortran) but does not compile with IVF 11.1:
Error message #7835 (record fields or array elements or sections of pointers are not themselves pointers. [ASSOCIATED].

I am new with IVF (and with f90 in general), so is there someone who could explain me how I can modify the code ? Thank you
[plain] type transfer
        integer, dimension(:), pointer :: ndex
    end type transfer
    
    type(transfer) :: d

    INTEGER::nm 
    nm=12

     if (associated(d%ndex(1:nm)))then
     call free_space()
     else
         WRITE(*,'("Not allocated")')
         endif
    contains
       subroutine free_space()

            deallocate(d%ndex)
            WRITE(*,'("DEALLOCATED")')

        end subroutine free_space


    END
[/plain]
0 Kudos
1 Reply
Steven_L_Intel1
Employee
324 Views
IVF is correct, the other compilers are not. Remove the (1:nm) in the call to ASSOCIATED.
0 Kudos
Reply