Re: Date representation



On Thu, 11 Sep 2008 15:41:07 +0200, "Kurt Kallblad"
<kurt.kallblad@xxxxxxxx> wrote:

Looking at your example I guess that the amount of data is not
more than you easily can keep in memory and it is a quick job to
read the file. In cases like that I read the file twice. The
first reading is used to determine the needed array sizes. Then I
allocate the arrays, rewind the file and read in the data.


Hello all,

let me just use this post to thank all who answered. I found some very
useful information and ideas on how to proceed in your replies.

to Kurt Kallblad:

Yes, the amount of data is not very large. There are several
files, each one not over 2 Mb. Not a problem for today's standards.
I used your idea of reading the file twice, and it works fine.
Previously I just allocated some ridicously big array and it also
worked fine, but I guess this is more rational approach.

Some nostalgia which may be useful:

Below you will find a routine to convert the dates to JULDAG.

Thank you for the routine.

These are not the Julian day but my own day numbers. These
numbers start with 1 for 1901-01-01 and ends with 72684 for
2099-12-31, this to get rid of leap year problems.

works fine for me, by the time the routine is no longer valid,
date-wise, CERN LHC will do its thing, create a black hole, and the
problem will be gone, along with planet Earth :-)


The original
version was on punched cards but it is still in use in some
commercial programs. A small Swedish wordlist is attached to help
you to understand the variables.


By some weird coincidence I actually know some (very) little of your
language, having spend some time there (beautiful hiking trails,
especially in autumn :-) but thank you for the effort of translation.

--
Marin

Kurt
.



Relevant Pages

  • Windows array allocation problem
    ... I'm getting an "insufficient virtual memory" error when trying to allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ... In both cases a call to Windows API function GlobalMemoryStatus or GlobalMemoryStatusEx immediately before the ALLOCATE statement returns a value of available virtual memory of 2,118,221,824 bytes. ... So I'm getting an "insufficient virtual memory" failure when trying to allocate the array to a size which is 384.665 MB less than the amount of reported available virtual memory. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... allocate an array to a size which is about 385 MB less than the amount of available virtual memory. ... In both cases a call to Windows API function GlobalMemoryStatus or GlobalMemoryStatusEx immediately before the ALLOCATE statement returns a value of available virtual memory of 2,118,221,824 bytes. ... So I'm getting an "insufficient virtual memory" failure when trying to allocate the array to a size which is 384.665 MB less than the amount of reported available virtual memory. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... previous array. ... the largest array I could allocate was approximately 2.084 ... The amount which can be allocated, and when that amount is known, affect a large number of things, so considerable modification had to be made. ... So my tests have all consisted of trying to allocate beginning with the amount of available virtual memory, then reducing the size of the attempted allocation in steps until it succeeds. ...
    (comp.lang.fortran)
  • [Suspend2][ 15/35] [Suspend2] Allocate filewriter storage.
    ... Allocate storage for the body of the image, ... This routine will never shrink the amount ...
    (Linux-Kernel)