Hello,
In coupling, the logical units change because the two or three programs would otherwise open the same logical units. So the logical units are dynamically decided, but this is no problem if you use the parameterised values :
For example the geometry file has the number T2DGEO (which is always 1) but its logical unit is T2D_FILES(T2DGEO)%LU which is also 1 if there is no coupling but may change in coupling. If you use these parameterised values there will be no problem.
Example, for BINARY DATA FILE 1, instead of opening logical unit 24 open logical unit T2D_FILES(T2DBI1)%LU
if T2D_FILES and T2DBI1 are not in your subroutine use :
USE DECLARATIONS_TELEMAC2D, ONLY : T2DBI1,T2D_FILES
With best regards,
Jean-Michel Hervouet