Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4061126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:25:37+00:00 2026-05-20T15:25:37+00:00

I have 30000 files to process each file has 80000 x 5 lines. I

  • 0

I have 30000 files to process each file has 80000 x 5 lines. I need to read all files and process them finding the average of each line. I have written the code to read and extract all data from the file. My code is in Fortran. There is an array of (30000 X 800000) My program could not go over (3300 X 80000). I need to add the 4th column of each file in 300 file steps, I mean 4th column of 1st file with 4th column of 301st file, 4th col of 2nd file with 4th col of 302nd file and so on .Do you think this is because of the limitation of the size of array that Fortran can handle? If so, is there any way to increase the size of the array that Fortran can handle? What about the no of files? My code looks like this:
This program runs well.

    implicit double precision (a-h,o-z),integer(i-n)
    dimension x(78805,5),y(78805,5),den(78805,5)
    dimension b(3300,78805),bb(78805)
    character*70,fn 
    nf = 3300       ! NUMBER OF FILES
    nj = 78804      ! Number of rows in file.
    ns = 300        ! No. of steps for files.
    ncores = 11 ! No of Cores
c--------------------------------------------------------------------
c--------------------------------------------------------------------   
    !Initialization     
    do i = 0,nf
      do j = 1, nj
        x(j,1) = 0.0
        y(j,2) = 0.0
        den(j,4) = 0.0
c       a(i,j) = 0.0
        b(i,j) = 0.0
c       aa(j)  = 0.0
        bb(j)  = 0.0
      end do
    end do
c-------!Body program-----------------------------------------------
    iout = 6    ! Output Files upto "ns" no.
    DO i= 1,nf  ! LOOP FOR THE NUMBER OF FILES
      write(fn,10)i
      open(1,file=fn)
      do j=1,nj     ! Loop for the no of rows in the domain
        read(1,*)x(j,1),y(j,2),den(j,4)
        if(i.le.ns) then
c          a(i,j) = prob(j,3)
           b(i,j) = den(j,4)
        else
c          a(i,j) = prob(j,3) + a(i-ns,j) 
           b(i,j) = den(j,4) + b(i-ns,j) 
        end if
      end do
      close(1)
c         ----------------------------------------------------------
c         -----Write Out put [Probability and density matrix]-------
c         ----------------------------------------------------------
      if(i.ge.(nf-ns)) then
        do j = 1, nj
c         aa(j) = a(i,j)/(ncores*1.0)
          bb(j) = b(i,j)/(ncores*1.0)
          write(iout,*) int(x(j,1)),int(y(j,2)),bb(j)
        end do
        close(iout)
        iout = iout + 1
      end if
    END DO
   10  format(i0,'.txt')    
       END 
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:25:38+00:00Added an answer on May 20, 2026 at 3:25 pm

    It’s hard to say for sure because you haven’t given all the details yet, but your problem is quite possibly that you are using a 32 bit compiler producing 32 bit executables and you are simply running out of address space.

    Although your operating system supports 64 bit address space, your 32 bit process is still limited to 32 bit addresses.

    You have found a limit at 3300*78805*8 which is just under 2GB and this supports my theory.

    No matter what is the cause of your immediate problem, your fundamental problem is that you appear to be loading everything into memory at once. I’ve not closely studied your algorithm but on first inspection it seems likely that you could re-arrange it to avoid having everything in memory at once.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 660000 xml files(with unique file names) in 22 folders. Each folder has
I have a file of about 30000 lines of data that I want to
I have a program in which each thread reads in files many lines at
I have a file collection (3000 files) in a FileInfoCollection. I want to process
I have to delete folder with more than 30000 images. I have '.nomedia' file
I have ~30.000 lines of badly indented OCaml code (including mly and mll files)
I have setup an application to parse about 3000 files a day where each
I have an express app that has a bunch of static javascript files that
Scenario: over 1.5GB of text and csv files that I need to process mathematically.
I have a file of around 3000 lines. I am matching every word in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.