Welcome, Guest
Username: Password: Remember me

TOPIC: TelApy error with tracer

TelApy error with tracer 8 years 1 month ago #24008

  • slm06
  • slm06's Avatar
Greetings everyone, it was very nice to meet many of you at the TUC in Paris, last week. A very energetic and vibrant community, indeed.

I encountered an error when using the Python API.

If I run the 'breach' example, as in the tutorial, everything works fine. However, if I introduce my own problem which includes a tracer, I get the following error when I call my_problem.finalize()

At line 667 of file /salome-hydro/Salome-V771H-c9/tools/Telemac/sources/telemac2d/deall_telemac2d.f
Fortran runtime error: Attempt to DEALLOCATE unallocated 'masten'

The code attempts to deallocate a number of arrays that have already been deallocated.

To fix the problem, I have replaced the deallocate statements with a check to see if they are allocated:

if (allocated(masten)) deallocate(masten)

I did this for all arrays in lines 667 to 676, of the deall_telemac2d.f circulated in 'patch', of the workshop. I think those lines should just be deleted, as the arrays are deallocated further up in the code.

-Simon
The administrator has disabled public write access.

TelApy error with tracer 8 years 1 month ago #24014

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

Yes this is a bug you should remove the line where you have if(ntrac.gt.0) then
deallocate(masten)
...
deallocate(yasmi)
endif

They come from an earlier version.

Thanks for the info it will be corrected in v7p2.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: slm06

TelApy error with tracer 8 years 1 month ago #24026

  • slm06
  • slm06's Avatar
Thanks yugi.

I've now encountered another limitation . I noticed that I can not access the telemac tracer fields from the Python API, as the 'instance_t2d' variable does not point towards the telemac tracer fields.

I am happy to try and implement this myself.

My initial attempts were to edit api_instance_t2d.f to modify the instance_t2d data structure by adding a type(bief_obj) :: tracer

I also made sure that 'update_instance_t2d' subroutine updates the instance_t2d%tracer to the actual telemac tracer.

Whatever I do, however, I always end up with memory errors, such as this:

*** Error in `python': free(): invalid next size (fast): 0x0000000003437380 ***

or segmentation errors, or 'double linked-list' errors.

If you can offer any help for me to get this implemented, I would be very happy.
The administrator has disabled public write access.

TelApy error with tracer 8 years 1 month ago #24027

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
You need to do the following action to add a new variable :

Get the name of the variable in \verb!declarations_telemac2d!.

Add that variable in the instance structure (file api_instance_t2d.f).
Add the initialisation in create_instance_t2d.
Add the variable in the get/set function that befits it.
Add the size of the variable in get_var_size_t2d_d.
Add the type of the variable in get_var_type_t2d_d.
Add the variable in GET_VAR_LIST_T2D_D.
Increase the value of t2d_nb_var in api_handle_var_t2d.f.

Hope it helps
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: slm06

TelApy error with tracer 8 years 1 month ago #24028

  • slm06
  • slm06's Avatar
Thank you, I will let you know how it goes. :cheer:

Simon
The administrator has disabled public write access.

TelApy error with tracer 8 years 1 month ago #24050

  • slm06
  • slm06's Avatar
Hi yugi, just to let you know it's now working as expected. Thanks for you help.

Simon
The administrator has disabled public write access.

TelApy error with tracer 8 years 1 month ago #24079

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Happy to ear that.
Could you send me your modifications so i can add them to the trunk ?
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
Moderators: pham

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