- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to catch a potential memory allocation error when using the statement A = B, where A and Bare an allocatable, derived-type variable which has allocatable array components?
....
! Declare A and B.
TYPE MY_TYPE
REAL(KIND=8),ALLOCATABLE :: X(:,:)
END TYPE MY_TYPE
TYPE(MY_TYPE),ALLOCATABLE :: A(:),B(:)
! Theautomatic allocations performed implicitly herein might fail...
A = B
....
Or should I go through the minutiae of allocating one by one all of the array components?
Thanks,
Olivier
....
! Declare A and B.
TYPE MY_TYPE
REAL(KIND=8),ALLOCATABLE :: X(:,:)
END TYPE MY_TYPE
TYPE(MY_TYPE),ALLOCATABLE :: A(:),B(:)
! Theautomatic allocations performed implicitly herein might fail...
A = B
....
Or should I go through the minutiae of allocating one by one all of the array components?
Thanks,
Olivier
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to catch the errors you will have to handle all of the ALLOCATEs yourself.
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