On Sep 13, 12:24 pm, dpb <n...@non.net> wrote:
> On 9/12/2011 6:36 PM, edward kabanyas wrote:
>
>
>
>
>
>
>
>
>
> > Hi TideMan,
>
> > Thanks for your reply.
>
> >> plan to "calculate the size of A manually" in
> >> Fortran 77.
>
> > It means I check the data size with my eye and then write/declare the
> > size in the Fortran77, as below:
>
> > data nx,nt/1600,715/
>
> >> But my recollection is that in Fortran 77 you can quite happily exceed
> >> array bounds and it will simply return you the next piece of data
> >> available in core.
>
> > If I used for exmaple nt = 700 (the real data row is 715), my fortran
> > only read the data until 700th row, or if I used nt = 1000 (the real
> > data row is 715), EOF error occurs. So what do you mean your statement,
> > "quite happily exceed" ?
>
> Referencing an outofbounds array element. Of course, one can compile
> w/ bounds checking with every existent compiler.
>
> And, of course, C is just as happy if not more so... :)
>
> > Actually, checking the data size with my eye is O.K, but we have
> > thousand input file, it will take time. It seems Fortran77 is not
> > possible for automatic data analysis, for long record data, for many
> > input file with different structure, isn't it ? Or I am too stupid..:)
>
> ...
>
> I can't decipher the question (if there is one).
>
> If you mean there's no automatic allocation in Fortran a la Matlab, yes,
> that is true. That does _not_ mean one cannnot write code to handle
> variablelength files or records, however.
>
> I would ask why one would limit oneself to F77 when there are at least
> two open source compilers that are F95+ which do include ALLOCATABLE
> arrays an at least some of the other extended memory allocation on
> assignment of the 2005 and 2008 Standards (altho I don't know how much
> or if it is yet fully functional) as well as the commercial compilers.
>
> 
Well, way back then, when I was doing finite element programming
(using Fortran 4, I think), we used what we called "dynamic memory
allocation".
common x(100000)
i1=1
i2=i1+ndim
i3=i2+mdim
etc
Then
call sub(x(i1),x(i2),x(i3),ndim,mdim)
subroutine sub(u,v,w,n,m)
dimension u(n),v(n),w(m)
etc
Now, what I meant by "quite happily exceed", is that you could access
x(100001) (i.e., beyond the limit of x) and get a number, though there
was no guarantee what it would be.
