Welcome, Guest
Username: Password: Remember me

TOPIC: DEFINE NEW KEYWORDS

DEFINE NEW KEYWORDS 8 years 9 months ago #19624

  • qilong
  • qilong's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 340
  • Thank you received: 33
Hello,

we're trying to introduce a new keyword in Telemac-3D for the flocculation model we're developing. I'm wondering how to do it properly? Can we add new keyword in the dictionary file and declare a new logical variable associated with it and use it in the steering file? Currently we know how to create a new global variable in Telemac-3D but don't know about the rest...

Thanks in advance!

Qilong
The administrator has disabled public write access.

DEFINE NEW KEYWORDS 8 years 9 months ago #19625

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi

It's possible but you have also to manage the reading of this new keyword in lecdon-telemac3d.
There is a numbering of the keywords (for integer, real and string).
This is not very simple but this is possible if you take care about the numbering...

Regards
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: qilong

DEFINE NEW KEYWORDS 8 years 9 months ago #19626

  • qilong
  • qilong's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 340
  • Thank you received: 33
Thanks!

It sounds more complicated than I thought. We will check the subroutines and try to have better understanding about it.

Regards,
Qilong
The administrator has disabled public write access.

DEFINE NEW KEYWORDS 8 years 9 months ago #19627

  • jmhervouet
  • jmhervouet's Avatar
Hello Qilong,

It is not so complicated, you just need to:

Find an available INDEX for the keyword. You can look at lecdon_telemac3d.f to see what is the last index used for this category. If you find let's say 102, you can check in the dictionary that you do not have INDEX = 102 somewhere for this kind of keyword.

Then you write a new block for this keyword in the dictionary, you can inspire from other keywords.

Then you choose a Fortran name for this keyword and add the declarationin declarations_telemac3d.f

Then you recover the value in lecdon_telemac3d.f (look how other keywords are recovered).

That's it !

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

DEFINE NEW KEYWORDS 8 years 9 months ago #19628

  • qilong
  • qilong's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 340
  • Thank you received: 33
Hello Jean-Michel,

It's more clear to me now.
Thanks for the explanation! I'll try as you said.

Have a good weekend!

Qilong
The administrator has disabled public write access.

DEFINE NEW KEYWORDS 8 years 9 months ago #19681

  • qilong
  • qilong's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 340
  • Thank you received: 33
Hello,

Thanks for the help. I have successfully defined some Keywords in the telemac3d.dico and used them in the steering file. For example, I defined a logical type keyword called "TCPBE FLOCULATION MODEL".

First, I add the definition in telemac3d.dico, give the INDEX number and MNEMO (used as variable name in Telemac-3D):
NOM = 'TCPBE FLOCULATION MODEL'
NOM1 = 'TCPBE FLOCULATION MODEL'
TYPE = LOGIQUE
INDEX = 127
MNEMO = 'TCPBE'
TAILLE = 0
DEFAUT = NON
DEFAUT1 = NO
RUBRIQUE = 'SEDIMENT'
RUBRIQUE1 = 'SEDIMENT'
NIVEAU = 1
AIDE = 'Decides if TCPBE FLOCULATION MODEL is to be used'
AIDE1 = 'Decides if TCPBE FLOCULATION MODEL is to be used'

Second, I declared TCPBE as a logical variable in declarations_telemac3d.f like:
!     FOR TCPBE FLOCCULATION MODEL
      LOGICAL TCPBE

Then, I add a line in lecdon_telemac3d.f to get the value for the keyword:
TCPBE     = MOTLOG(ADRESS(3, 127))

For different types of keywords, use different variable:
Integer number keyword, MOTINT(ADRESS(1,INDEX))
Real number keyword, MOTREA(ADRESS(2, INDEX))
Logical keyword, MOTLOG(ADRESS(3, INDEX))
Character keyword, MOTCAR(ADRESS(4, INDEX))

Hope this can be helpful to others.

Best regards,
Qilong
The administrator has disabled public write access.
The following user(s) said Thank You: Julio, nshettigar, jeirual
Moderators: pham

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