- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
When compiling the following code, I get an error that the argument of MOVE_ALLOC shall be an allocatable object:
error #8195: The argument to the MOVE_ALLOC intrinsic subroutine shall be an allocatable object. [MOVE_ALLOC]
In this example both arguments are allocatable:
[fortran]FUNCTION Test_MoveAllocFunc(newSize) RESULT(idPS) !{
!** HEADER VARIABLES/ARGUMENTS
IMPLICIT NONE
INTEGER :: newSize
!** RETURN VARIABLE
INTEGER :: idPS
!** LOCAL VARIABLES
TYPE(PSType), POINTER :: TempPS(:)
TYPE (PSType), POINTER :: UI_PS(:)=>null()
!*****************************************************************************
TempPS=>null()
ALLOCATE(TempPS(-1:newSize-1), SOURCE=UI_PS)
DEALLOCATE(UI_PS)
ALLOCATE(UI_PS(-1:newSize))
CALL MOVE_ALLOC(TempPS, UI_PS)
idPS=newSize
ENDFUNCTION Test_MoveAllocFunc !}[/fortran]
What am I missing?
I am using windows 7x64, VS2010, Composer 2013 latest update.
Thanks for any help.
Dirk
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They're not allocatable they're pointer. If you delete lines 12 and 14, remove the initialization in line 10 and replace POINTER with ALLOCATABLE do you still get an error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the fast response. This is very clear as well from the message when I read it again.
My fault
Dirk

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page