public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Craig Kennedy <c.j.kennedy@stir.ac.uk>
To: gcc-help@gcc.gnu.org
Subject: Opening a very large file
Date: Wed, 14 May 2003 10:11:00 -0000	[thread overview]
Message-ID: <3EC21F59.B493490C@stir.ac.uk> (raw)

Hello!

I'm using Fortran 77 and I am trying to open a large file (120
megabytes). However, when I try and compile the program it warns that
the stack size is too large. This file is made up of 115 smaller files
all put together - the program is to take the large file apart and
generate the 115 new files. The program works for smaller sets (40 files
in one etc.)

Here is some code from the file:

      reclen=512*512*115

     open(1,file=infname,form='unformatted',access='direct',
     +recl=reclen,status='old')
      print*,'opened'
       read(1) (realstream(i),i=1,reclen)
      close( 1 )


       do k=1,ilen
       ip=(k-1)*262144
       do l=1,262144
        ip=ip+1
        realstreamdiv(l)=realstream(ip)+realstreamdiv(l)
       enddo
       enddo


       reclen=262144

      open(18,file=outfname,form='unformatted',access='direct',
     +recl=reclen,status='new')
       write(18) realstreamdiv
       close(18)

Any help on how to open the file in chunks to output them would be
greatly appreciated.

-- 
The University of Stirling is a university established in Scotland by
charter at Stirling, FK9 4LA.  Privileged/Confidential Information may
be contained in this message.  If you are not the addressee indicated
in this message (or responsible for delivery of the message to such
person), you may not disclose, copy or deliver this message to anyone
and any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.  In such case, you should destroy this
message and kindly notify the sender by reply email.  Please advise
immediately if you or your employer do not consent to Internet email
for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official
business of the University of Stirling shall be understood as neither
given nor endorsed by it.

             reply	other threads:[~2003-05-14 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-14 10:11 Craig Kennedy [this message]
2003-05-14 21:21 ` Toon Moene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EC21F59.B493490C@stir.ac.uk \
    --to=c.j.kennedy@stir.ac.uk \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).