Re: Q: Checking the size of a non-allocated array?
- From: Arno <arnoinperu@xxxxxxxxxxx>
- Date: Fri, 10 Aug 2007 07:54:39 -0000
integer y(5)
integer, allocatable :: x(:)
!-----
call mysub(y) ! this call should be ok
call mysub(x) ! this call invokes size(x,1), which may not be
You might want to check if x is allocated before calling the routine:
if (allocated(x)) call mysub(x)
Note that you cannot check y in such a way, as it is not an
allocatable array.
Arno
.
- Follow-Ups:
- Re: Q: Checking the size of a non-allocated array?
- From: James Tursa
- Re: Q: Checking the size of a non-allocated array?
- References:
- Q: Checking the size of a non-allocated array?
- From: James Tursa
- Q: Checking the size of a non-allocated array?
- Prev by Date: Re: Q: Checking the size of a non-allocated array?
- Next by Date: READONLY attribute?
- Previous by thread: Re: Q: Checking the size of a non-allocated array?
- Next by thread: Re: Q: Checking the size of a non-allocated array?
- Index(es):
Relevant Pages
|