Welcome, Guest
Username: Password: Remember me

TOPIC: Automatic Installer: user_fortran compilation within the API

Automatic Installer: user_fortran compilation within the API 10 months 2 weeks ago #43933

  • DeVos_TUM
  • DeVos_TUM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 4
Dear all,

I am trying to work with the API to code a coupling between Telemac and SWMM. At the moment, I face the issue that my user_fortran files cannot be compiled when using the API. To test this, I adapted the provided jupyter notebook "telemac2d_example.ipynb" to run the "pluie" example with the SCS-CN method, but it fails when trying to compile the fortran files.
Is there something I missed when using the automatic installer?

I have attached my python script and the error message.

Kind regards
Frederik
Attachments:
The administrator has disabled public write access.

Automatic Installer: user_fortran compilation within the API 10 months 1 week ago #43940

  • abernard
  • abernard's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 210
  • Thank you received: 45
Hi Frederik,

As already explained by boris, for an advance use of the code with compilation, you shouldn't use the automatic installer that doesn't allow compilation.

http://www.opentelemac.org/index.php/kunena/2-windows-version/14514-clean-compilation-in-v8p4-with-automatic-installer#43857

http://www.opentelemac.org/index.php/kunena/2-windows-version/14516-importerror-no-module-named-request-when-install-with-telemac-v8p4r0#43855

You can compile your modification following the procedure described here: gitlab.pam-retd.fr/otm/wintel

Alexis
The administrator has disabled public write access.
The following user(s) said Thank You: DeVos_TUM

Automatic Installer: user_fortran compilation within the API 10 months 1 week ago #43942

  • DeVos_TUM
  • DeVos_TUM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 4
Hi Alexis,

thanks for your reply.

I am afraid I misused the word compilation, as I simply took it from my error prompt. Maybe I have also put this topic into the wrong section of the forum (I assumed something went wrong with the Windows installation, but maybe it is a problem solely fixed on the api).

The pluie example requires some user fortran routines. When I run the example via the Telemac command window from the automatic installer, everything works fine. However, when I try to run the pluie example with using the python api for Telemac (as with the adapted example notebook), I get the error from the original post, that it couldn't compile my fortran. I am confused why telemac can apparently compile my fortran from the command window, but not from the api... :huh:

In the mean time, I am trying to install Telemac from the Wintel tutorial, but this has failed for me already a couple of times last year and I also encounter issues now (it does not find my python 3.10...)

Kind regards
Frederik
The administrator has disabled public write access.

Automatic Installer: user_fortran compilation within the API 9 months 1 week ago #44160

  • DeVos_TUM
  • DeVos_TUM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 4
Hi Alexis,

I managed to install telemac from wintel gitlab and managed to run different simulations using the command window. However, I still cannot use the API.
I tried to run the notebook telapy/telemac2d_example.ipynb, it imports the modules without an error, but gives me the attached error, when I create a Telemac2d object. Apparently it fails to find the DLL and suggests to check the pythonpath.
My pythonpath after running pysource.gnu.bat is:
C:\telemac\builds\gnu.static\wrap_api\lib;C:\telemac\scripts\python3;C:\telemac\builds\gnu.static\wrap_api\lib;C:\telemac\scripts\python3;C:\opentelemac-mascaret\v8p4\scripts\python3

Is there a problem with my mingw maybe? I have two versions of MingW on my C:/, that's why I had to adapt my pysource.gnu.bat script to specifically set the correct mingw64 path.

Thanks for your help.

Frederik
Attachments:
The administrator has disabled public write access.

Automatic Installer: user_fortran compilation within the API 10 months 5 days ago #43974

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Hello Frederik, I have posted something on SLACK ... just in case you did not see it :
We are (with a chinese company called Yuansuan) also trying to couple these two software but directly through Fortran-C binding. What we can do is run SWMM (calling open, looping on step, etc...) from a Fortran file.
.. and we can get/set Node etc variables through arguments of the Fortran programme.
Results are the same as running SWMM on it own.

The thing we are trying to do now for the coupling is to look at the right variables to exchange between SWMM and TELEMAC. we think we can start with inflow - outflow, but we are not sure, and TELEMAC will compute DEPTH anyway as input to SWMM.
Have you already looked into this ?
What are the variables you are going to exchange (level, source_sinks) and what other feature from SWMM would be nice to exchange (rain, etc.)

We can carry on this discussion on SLACK,
Thank,
Sébastien.
The administrator has disabled public write access.

Automatic Installer: user_fortran compilation within the API 10 months 5 days ago #43976

  • wsy9208
  • wsy9208's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
Hello Sebourban!

I am very interested in your project, but I am unsure how to inquire about it through the SLACK. In fact, I have previously implemented the coupling of TELEMAC with SWMM through API. At each time step, I calculated the interaction flow based on the 1D and 2D water depths of the network nodes. This flow is then used as the point source flow for 2D and as the node inflow for 1D. However, this process requires both systems to maintain synchronized time steps, limiting it to computations with a fixed time step. If it is possible to implement coupling directly from the source code, it should address this issue.

Can you please guide me on how to follow your progress?

WSY
The administrator has disabled public write access.
The following user(s) said Thank You: DeVos_TUM

Automatic Installer: user_fortran compilation within the API 10 months 5 days ago #43978

  • DeVos_TUM
  • DeVos_TUM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 4
Hi WSY,

that is exciting news!

Sebastien can send you an invite to the SLACK and then we can discuss more.

I went through your posts of the last year, seems like you faced all the issues, I also faced (and will face) :laugh:

Kind regards
Frederik
The administrator has disabled public write access.

Automatic Installer: user_fortran compilation within the API 8 months 3 days ago #44456

  • Maxvim
  • Maxvim's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,
I have the same question with you ,can I ask how slove this problem aboout DLL . I set PYTYHONPYTH as <C:\telemac\external\python-3.10.11\Scripts>, is that right?

PS: How can I join in your SLACK group, I also want to attend in study about SWMM and TELEMAC coupling.

Thank you very much if you can answer back.

Maxvim
The administrator has disabled public write access.
Moderators: borisb

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