Re: variable content lost
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 30 Mar 2007 15:30:20 -0700
On Mar 30, 6:03 pm, lis...@xxxxxxxxx wrote:
Hi,
I just started writing in Fortran90 using gfortran on Mac OSX.
When you are using one compiler and getting stuck, its a good idea to
try another one. G95 is free and available on Mac OSX.
At the
moment I am startled by this issue, which I couldnt resolve on my own:
[code]
...
write (*, '(A,F5.2)') "before:", fib%r(id,1)
call segment_distance(fib%r(id,1:3), fib%p(id,:), fib%r(m,:),&
fib%p(m,:))
write (*, '(A,F5.2)') "after", fib%r(id,1)
...
subroutine segment_distance(r, p, rr, pp)
real(dp), dimension(3), intent(in) :: r, p, rr, pp
...
end subroutine segment_distance
I don't see anything wrong, but a compilable code that reproduces the
error would be helpful.
Are you sure that that all the arrays passed to segment_distance have
dimension 3? Is the subroutine in a MODULE (which I recommend)? Can
you change the subroutine above to use assumed-shape array arguments
so that it looks like
subroutine segment_distance(r, p, rr, pp)
real(dp), dimension(:), intent(in) :: r, p, rr, pp
and check that size(r)=size(p)=size(rr)=size(pp)=3?
[/code]
The first write results in the expected "before:11.00" (defined some
place before). But I do not understand why I get "after 0.00".
If further information is required, I will happily provide more
details.
I would be glad if someone could give me a hint here.
Christian
.
- Follow-Ups:
- Re: variable content lost
- From: Listad
- Re: variable content lost
- References:
- variable content lost
- From: listad
- variable content lost
- Prev by Date: variable content lost
- Next by Date: Re: variable content lost
- Previous by thread: variable content lost
- Next by thread: Re: variable content lost
- Index(es):
Relevant Pages
|