Welcome, Guest
Username: Password: Remember me

TOPIC: Question about Fortran File

Question about Fortran File 12 years 7 months ago #4294

  • hong
  • hong's Avatar
Hello, everyone.

I am using telemac2d on windowXP(not parallel mode) .

The fortran file I made needs reading data from a txt file.

But it seemed that the "open" command didn't work and the file couldn't be loaden.

I put the txt file in the same directory with the fortran file.

and the open sentence is "open(unit, file='.\xxx.txt')".

Did anyone experience the same problem?

Any advice would be appreciated.

:cheer:
The administrator has disabled public write access.

Re: Question about Fortran File 12 years 7 months ago #4296

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
The easiest way to use data file is to declare it as a formatted file 1 or 2 in the steering file.
Then the managemnt of openning, close, eventually partitionning for parallelism is automatically manage by telemac.
In your program, you could access to this file by specifying the unit which is for example T2DFO1 for formatted file 1

If you prefer to manage your own file in yoru fortran program you should know that the telemac execution is made in a temporary directory created during the launching process of the simulation. In the temp directory, all the files declared in the sterring file are copied but not the files you manually declared in your fortran file...
So to use your own file you should declare the file as '..\xxx.txt'.

Hope this helps
Christophe
The administrator has disabled public write access.

Re: Question about Fortran File 12 years 7 months ago #4309

  • hong
  • hong's Avatar
hello, C.coulet. Thank you for your early reply.

It really makes me more clear.

Actually, I tried the second way before ,but there was also "unknown"problems.

Now I prefer to use the easiest way you recommended.

I defined the format file in the steering file

"FORMATTED DATA FILE 1 = tides.txt"

and open it in the fortran file

open(120,file='tides.txt',status='old')

But errors occured.


It seems I cannot upload the attachment.

The error information are like this:

"out5616_win.exe unknown unknown"
"out5616_win.exe SL unknown"
"out5616_win.exe BORD unknown"
"out5616_win.exe HOMERE_TELEMAC2D unknown"
kernel32.dll unknown unknown

Could you please check it for me ?

cheers.
The administrator has disabled public write access.

Re: Question about Fortran File 12 years 7 months ago #4310

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
as i said, if you use the keyword FORMATTED DATA FILE 1 = tides.txt you don't have to manage the openning of this file.
In your fortran file, you just have to manage the read instruction (with the file unit equal to T2DFO1.
If you have a compilation error which indicate T2DFO1 is unknown, you should add USE DECLARATIONS_TELEMAC2D , ONLY : T2DFO1 at the beginning of your fortran file.

Hope this helps
Christophe
The administrator has disabled public write access.

Re: Question about Fortran File 12 years 7 months ago #4311

  • hong
  • hong's Avatar
C.coulet.

I have solved the problem.

Thanks a lot. :P
The administrator has disabled public write access.
Moderators: pham

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