Re: dimension question
- From: "Michael Metcalf" <michaelmetcalf@xxxxxxxxxxxxxx>
- Date: Sun, 25 Feb 2007 15:26:49 GMT
"sc" <stas_ch@xxxxxxxx> wrote in message
news:1172402080.302635.176180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I used f95
Since you have a f95 compiler, might I suggest that you learn Fortran 95
rather than Fortran 77. The solution to your problem is then to use an
assumed-shape array:
program dimtest
!
integer n, maxn
parameter(maxn=100)
real a
dimension a(maxn, maxn)
!
n = 2
a(1,1) = 1
a(1,2) = 2
a(2,1) = 3
a(2,2) = 4
call test(a(:n, :n) )
contains
subroutine test(a)
real a(:, :)
print *, a(1,1), a(1,2), a(2,1), a(2,2)
end subroutine test
end
Regards,
Mike Metcalf
.
- Follow-Ups:
- Re: dimension question
- From: glen herrmannsfeldt
- Re: dimension question
- References:
- dimension question
- From: sc
- dimension question
- Prev by Date: Re: dimension question
- Next by Date: Re: dimension question
- Previous by thread: Re: dimension question
- Next by thread: Re: dimension question
- Index(es):
Relevant Pages
|
|