Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: use additional variables in Selafin files

use additional variables in Selafin files 7 years 7 months ago #25989

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hi Olivier and Sven,

Before the new functionnality PRIVATE VARIABLES has been introduced, it was possible to do similar thing by creating and allocating an array, reading the data from the geometry file (for example) and then deallocating it once the job done.

You can actually find pretty good examples on the SISYPHE forum, just search for "find in sel noerod". Costas and I, amongst others, posted examples for noerod.f on how to read the non erodible depth from the geometry file.

PRIVATE VARIABLES makes this operation automatically but you are then limited to 4 variables. I guess you can do the creation/allocation/deallocation step for how many variables you want.

Good luck!

Best regards
PL
The administrator has disabled public write access.
The following user(s) said Thank You: o.gourgue

use additional variables in Selafin files 7 years 7 months ago #25990

  • o.gourgue
  • o.gourgue's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 155
  • Thank you received: 11
Thank you Sven, PL and everyone who contributed to this topic.

I solved my problem by simply using the subroutine FIND_VARIABLE and defining BIEF objects locally in DRAGFO. That works perfectly for what I need to do.

Thanks again!

My files in attachment, in case it might be useful for someone sometime.
The administrator has disabled public write access.

use additional variables in Selafin files 7 years 7 months ago #26111

  • o.gourgue
  • o.gourgue's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 155
  • Thank you received: 11
Hi all.

I would like to do the same the other way around now. I have some variables that I compute in Telemac and I would like to export them in the result file.

Again, I would have more than 4 variables, so I would need something else than the PRIVE variables...

How could I do that?

Once again, thank you for your help.
The administrator has disabled public write access.

use additional variables in Selafin files 7 years 7 months ago #26114

  • o.gourgue
  • o.gourgue's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 155
  • Thank you received: 11
I found the solution by myself :-) I will write it down here, in case somebody else want to do the same.

So I want to create a variable FL that will track the relative flooding time, that is, the percentage of time during the simulation during which a node is flooded (H>0.1). And I want to export it in the result file.

I first declare the variable in declarations_telemac2d.f:

      TYPE(BIEF_OBJ),TARGET :: FL

Then I create the object in point_telemac2d.f:

      CALL BIEF_ALLVEC(1, FL, 'FL    ', IELMT, 1, 2, MESH)
      CALL ADDBLO(VARSOR, FL)
      CALL OS('X=0     ',X = FL)

The name for the result file is given in nomvar_telemac2d.f (note that I did not verify if the integer I is correct; in my case, NTRAC, NPERIAF and NADVAR are all 0 and it works):

      I = 34 + NTRAC + 2 * NPERIAF + NADVAR
      TEXTE(I)  = 'FLOODING TIME                   '
      TEXTPR(I) = 'FLOODING TIME                   '
      MNEMO(I)  = 'FL      '

The actual calculation of the variable FL is done in preres_telemac2d.f:

!     RELATIVE TIME STEP
      RDT = 1.D0 / NIT
!
      DO I = 1, NPOIN
        IF(H%R(I) > 0.1D0) THEN
          FL%R(I) = FL%R(I) + RDT
        ENDIF
      ENDDO

I hope it can be useful for someone else!
The administrator has disabled public write access.
The following user(s) said Thank You: pilou1253, nshettigar
  • Page:
  • 1
  • 2
Moderators: pham

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