Re: internal procedure can't use array of derived type from main

From: Dr. Richard E. Hawkins (hawk_at_slytherin.ds.psu.edu)
Date: 03/15/04


Date: Mon, 15 Mar 2004 18:03:53 +0000 (UTC)

In article <c2tevo$omd$1@ngspool-d02.news.aol.com>,
Michael Metcalf <metcalfm@acm.org> wrote:
>
>"Dr. Richard E. Hawkins" <hawk@slytherin.ds.psu.edu> wrote in message
>news:c2t94v$1es8$1@f04n12.cac.psu.edu...
>> integer(intsize),intent(out)::nextk

>> print *,"I can use some info,",k,xi
>> print *,"but not the array of states",states(8)%nextstate

>As nextk is intent(out), it becomes undefined on entry to the internal
>subroutine ("Fortran 90/95 Explained", Section 5.9). And so is the actual
>argument.

Ah-hah. Thanks. I even had that book in front of me as I wrote, but I
was thinking in terms of variable types, rather than intent.

So my solution is that I'm using an out where I should be using an inout
. . .

thanks

hawk

-- 
Richard E. Hawkins, Asst. Prof. of Economics    /"\   ASCII ribbon campaign
dochawk@psu.edu  111 Hiller (814) 375-4846      \ /   against HTML mail
These opinions will not be those of              X    and postings. 
Penn State until it pays my retainer.           / \