Welcome, Guest
Username: Password: Remember me

TOPIC: how to read a lot of diles

how to read a lot of diles 9 years 8 months ago #16127

  • zqzuoan
  • zqzuoan's Avatar
hi, everyone
I have a lot of files to be read in my simulation. I know in the cas file I can use the keyword FORMATTED DATA FILE 1/2, but if I have thousands files to be read, how to do it? Can I use just like open(*,file'filename) read(*,*)?
The administrator has disabled public write access.

how to read a lot of diles 9 years 8 months ago #16130

  • riadh
  • riadh's Avatar
Hello

I can not imagine the need to thousands of files to be read for a single simulation. However, theoretically you can do that by the use of open(xx,file="filename")/read(xx)/close(xx).
The advantage of use of FORMATTED FATA FILE1/2, besides the fact that they are manged by TELEMAC, is mainly that files are partitioned for parallel executions.
one optiomal way to follow is to concatenate all your files in 2 files and use FORMATED DATA FILE 1/2.
if you use the first solution try to avoid all the channels used by TELEMAC.
with my best regards

Riadh ATA
The administrator has disabled public write access.

how to read a lot of diles 9 years 8 months ago #16227

  • zqzuoan
  • zqzuoan's Avatar
I have tried use open(xx,file='') and read(xx,*), but failed. it seems that telemac can only read no more than two formatted file. Maybe there other methods I donot know.
The administrator has disabled public write access.

how to read a lot of diles 9 years 8 months ago #16229

  • jmhervouet
  • jmhervouet's Avatar
Hello,

In standard Fortran you cannot open more than 100 files, but sometimes compilers allow many more. If you look into dictionaries, like the file telemac2d.dico, in library telemac2d, you can look at the strings starting with SUBMIT, and see what channels are already used for files, generally units larger than 50 are free.

Another solution would be storing what you read in files in some arrays, so that they are kept in memory. If it is possible you can then open, read, store and close all the files, one after the other, with the same unit number, e.g. 99, which is free for sure.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.