Re: suggestion for new intrinsic function: CONFORM
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 27 Feb 2007 13:40:35 -0800
On Feb 27, 4:33 pm, "Beliavsky" <beliav...@xxxxxxx> wrote:
When passing assumed shape arrays to procedures, typically the first
thing I do is check that the dimension are what I expect, in
particular that certain pairs of arguments conform, for example
subroutine foo(imat,y,z)
integer, intent(in) :: imat(:,:) ! (n1,n2)
real, intent(in) :: x(:,:) ! (n1,n2)
real, intent(out) :: z(:,:) ! (n1,n2)
if (size(imat,1) /= size(x,1) .or. size(imat,2) /= size(x,2) .or.
size(x,1) /= size(z,1) .or. size(x,2) /= size(z,2)) then
It occurs to me using the SHAPE function to check that arrays conform
is shorter, especially for high-rank arrays. So the question is
whether providing
conform(x,y)
as a shorter alternative to
all(shape(x) == shape(y))
is woth providing.
.
- Follow-Ups:
- Re: suggestion for new intrinsic function: CONFORM
- From: *** Hendrickson
- Re: suggestion for new intrinsic function: CONFORM
- From: Dan Nagle
- Re: suggestion for new intrinsic function: CONFORM
- References:
- suggestion for new intrinsic function: CONFORM
- From: Beliavsky
- suggestion for new intrinsic function: CONFORM
- Prev by Date: suggestion for new intrinsic function: CONFORM
- Next by Date: Re: suggestion for new intrinsic function: CONFORM
- Previous by thread: suggestion for new intrinsic function: CONFORM
- Next by thread: Re: suggestion for new intrinsic function: CONFORM
- Index(es):