Welcome, Guest
Username: Password: Remember me

TOPIC: Create a new keyword

Create a new keyword 3 months 1 week ago #44094

  • lucas
  • lucas's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,

I would like to create a new keyword for a telemac2D model.

Is there a document explaining everything that needs to be modified to add a new keyword and how to call it in the program?

The developer_guide explains how to add a keyword in the telemac2d.dico file. However, this doesn't seem to be sufficient since when i try to add my keyword in the steering file, i get the error :

utils.exceptions.TelemacException: Unknown keyword OPTION ST MAUR in steering file cas

Thank you
The administrator has disabled public write access.

Create a new keyword 3 months 1 week ago #44117

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1460
  • Thank you received: 563
Hello Lucas,

If you want to change the TELEMAC-2D dictionary e.g. to add a new keyword, you have to modify the telemac2d.dico file in the subfolder associated to the configuration you run, $HOMETEL/sources/telemac2d/telemac2d.dico
Otherwise the keyword will not be known and you will get the same error message when running telemac2d.py name_of_steering_file.cas

Anyway, so that the keyword is read, you have to declare a new variable which will be used by the code in the DECLARATIONS_TELEMAC2D subroutine + this variable should be read in the LECDON_TELEMAC2D subroutine.
I recommend you to copy and paste what is already done for another keyword of the same type in the last 2 subroutines (e.g. what is done for the 112th integer corresponding to keyword MAXIMUM NUMBER OF POINTS FOR SOURCES REGIONS and MNEMO MAXPTSCE).

In the telemac2d.dico and lecdon_telemac2d.f files, choose an index which is not already used (see in the headlines INDICES IN USE, you can use e.g. index 122 for integers as it is free).

Then, you will be able to use the new variable with MNEMO in the parts of TELEMAC-2D you want to modify.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: lucas

Create a new keyword 3 months 6 days ago #44138

  • lucas
  • lucas's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Thank you Chi-Tuan,

I had already attempted to modify those files. My mistake was attempting to include the dictionary in a user file using the variable:
DICTIONNAIRE = '../telemac2d_mod.dico'

However, it appears that the keyword search is automatically performed within the dictionary of the source code. Furthermore, the dico indicates the SUBMIT "INUTILE" for the keyword DICTIONNAIRE, which means "useless" in french.

By placing my new variable in the telemac2d.dico file of the source code rather than the user's, i can effectively reference it in my steering file.

Best regards.
The administrator has disabled public write access.
Moderators: pham

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