Welcome, Guest
Username: Password: Remember me

TOPIC: coupling TELEMAC3D-TOMAWAC

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28047

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Hello friends! I'm working on the TELEMAC3D-TOMAWAC coupling, v7p0 version. As separate simulations run perfectly. I made the coupling as ordered by the manual and got the same problem for the wind file. Conflict on the T3DFO1 that carries the wind on telemac3d.f. As suggested, include in the wac.f subroutine in tomawac.f file,

USE DECLARATIONS_TOMAWAC, ONLY : WAC_FILES,WACFO1

before reading the wind file, including REWIND(WAC_FILES(WACFO1)%LU)

and READ(WAC_FILES(WACFO1)%LU,*)WX3(L,I),WY3(L,I)
where WX3 (L, I), WY3 (L, I) are as wind components x and y are read and in tomawac.f.

displays the following error:

t3dfort.f:4162:31:

REWIND(WAC_FILES(WACFO1)%LU)
1
Error: Syntax error in REWIND statement at (1)
t3dfort.f:4170:33:

READ(WAC_FILES(WACFO1)%LU,*)WX3(L,I),WY3(L,I)
1
Has anyone had this problem?

Thank you for your attention.
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28048

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Pablo,

This looks like a simple fortran syntax error. This type of error is generally easy to solve, but hard to diagnose without the rest of the code, since the error messages aren't always specific enough.

Can you please attach your fortran file for me to take a look at?

Regards,

Phelype
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28052

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Ok

File Attachment:

File Name: telemac3d_forum.f
File Size: 73 KB


File Attachment:

File Name: tomawac_forum.f
File Size: 81 KB


Thank you for your attention.
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28053

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Pablo,

As I expected, the problem really easy to solve, but the compiler messages do not help much. This happens often when using fortran.

What happens is that you are importing the variables WAC_FILES and WACFO1 in the WAC subroutine, but you try to access them inside ANAVEN. This will not work because the variables known to WAC are not known to ANAVEN unless explicitly declared.

To fix it just move the line "USE DECLARATIONS_TOMAWAC, ONLY : WAC_FILES,WACFO1" inside ANAVEN instead of WAC.

On a side note, I noticed that you are using some subroutines older than the version of tomawac you are using. Consider porting your code to the newer versions to avoid compatibility errors.

Regards,
Phelype
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28055

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
OK Phelype ! I will do this. Thank you for your help
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28059

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Hello Phelype! I updated the tomawc.f routines to version v7p0. In separate the tomawac rum perfectly, but in the coupling with TELEMAC3D it presents an error. Even making the change indicated, appears the error:

|At line 1734 of file t3dfort.f (unit = 26, file = 'fort.26')
|Fortran runtime error: End of file

on reading the wind file on telemac3d.f

File Attachment:

File Name: tomawac_forum_2017-10-20.f
File Size: 85 KB


File Attachment:

File Name: telemac3d_forum_2017-10-20.f
File Size: 73 KB


Thank you for your help
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 1 month ago #28060

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Pablo,

I checked your files again, but I couldn't find any READ statement at the line 1734 of neither. I have never rand a coupled simulation, so I don't understand how telemac handles both fortran files together...

What I can tell from the error message:
1) It's an End of File runtime error, so the reason of the error is obvious: the executable tried to read something in a file that was not there. Either because the file is empty or because it actually reached its end. There's no way to know which unless looking at the files. But...

2) The file the executable is reading from was never opened*, for its name is fort.26. When the first I/O command to a logical unit is READ or WRITE, fortran automatically creates a file named "fort.LU", where LU is the number of the logical unit you are reading from/writing to. Consider the following example:
PROGRAM TEST
READ(123) I
END
If you run this you'll see that a file called fort.123 will be created and this error will be thrown:
At line 2 of file test.f95 (unit = 123, file = 'fort.123')
Fortran runtime error: End of file
This is probably what's happening to you. My guess is that somewhere in your code you changed one logical unit by other and thus the error.

I suggest you review you code flow to find out exactly where this "fort.26" is being created.

Otherwise post here all the files needed to reproduce this error.

Regards,
Phelype

*This also happens when you open a file for writing but don't specify a name to it. For example:
PROGRAM TEST
OPEN(123)
END
But all the open statements in your fortran file have a FILE specification, so this is not the case.
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 4 weeks ago #28062

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Sorry Phelype! I had sent another fortran file. I attached it again. My doubt is that the same fortran file works when I run the 3D hydrodynamic simulation and this error does not appear. Only when the coupling is made with the tomawac.

error in telemac3d fortran:

At line 1085 of file t3dfort.f (unit = 26, file = 'fort.26')
|Fortran runtime error: End of file


the wind files are large and I can not attach, but I checked everyone and there are no problems with them.
error in telemac3d fortran

Thank you for your help

File Attachment:

File Name: telemac3d_forum_2017-10-23.f
File Size: 73 KB


File Attachment:

File Name: tomawac_forum_2017-10-23.f
File Size: 85 KB


File Attachment:

File Name: tomawac.cas
File Size: 9 KB


File Attachment:

File Name: hidro_tomawac.cas
File Size: 11 KB
The administrator has disabled public write access.

coupling TELEMAC3D-TOMAWAC 7 years 4 weeks ago #28063

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello Pablo,

I found the mistake.

The variable T3DFO1 is actually not a logical unit connected to a file. It is a index in a matrix of BIEF_FILEs.

The problem arises when you use a READ(T3DFO1,*) in this file, since it s not a logical unit, it will not point to a file (or point incorrectly, which is worse).

The actual logical unit is in T3D_FILES(T3DFO1)%LU. See the difference?

To fix it you have to:
1) In the subroutine METEO, include the variable T3D_FILES in the line "USE DECLARATIONS_TELEMAC3D". Make sure you have both T3DFO1 and T3D_FILES.
2) When you call your subroutine VENTO, replace T3DFO1 by T3D_FILES(T3DFO1)%LU.

This should fix your problem.

Additionally, in the subroutine VENTO, you CLOSE(T3DFO1). I am not completely sure about this, but I think than when finishing the simulation, there is a call to BIEF_CLOSE_FILES, that will try to close the T3DFO1, but I think it will fail if it is already closed, so I would remove that CLOSE statement.

Regards,
Phelype

P.S.: Take a look at your private messages.
The administrator has disabled public write access.
The following user(s) said Thank You: pablo123

coupling TELEMAC3D-TOMAWAC 7 years 4 weeks ago #28064

  • pablo123
  • pablo123's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Thank you Phelype! Problem solved
The administrator has disabled public write access.
Moderators: tfouquet

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