- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day,
I have coded a test
[fortran]PROGRAM main IMPLICIT NONE integer, pointer, dimension(:) :: this_ptr integer :: i ! call allocateIt( this_ptr, 1, 5 ) ! this_ptr = (/ (i,i=1,5) /) write( *, * ) this_ptr ! ! CONTAINS ! subroutine allocateIt(this, from, to) implicit none integer, intent(IN) :: from, to integer, pointer, dimension(:), intent(INOUT) :: this allocate( this(from:to) ) return end subroutine allocateIt END PROGRAM main[/fortran]
I have information that pointer and intent can not bespecified to one variable (see an attachment).
The output is
ifort -g -traceback -check all -openmp allocate.f90 -o xmain
./xmain
1 2 3 4 5
Oleg.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, POINTER and INTENT can be specified as of Fortran 2003. Note that in this case the INTENT applies to the pointer itself, not the data it points to.
![](/skins/images/8B6E2C8F64F54CBD7F7262AA46F575DA/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page