Welcome, Guest
Username: Password: Remember me

TOPIC: Writing-Reading of a new variable

Writing-Reading of a new variable 10 years 4 months ago #13798

  • Penic
  • Penic's Avatar
Hello,

I used the variable PRIVE1 in PRERES_TELEMAC2D and I assign the value 50 to this variable. Then I got to read this variable in Prosou.
The problem is that when i assign a value to the variable PRIVE1 in FONSTR.f, I cannot read it in the PROSOU file. It's written in the cmd that PRIVE1=0.
So, I'd like to know how to read in prosou the value of a variable that has been assignated in fonstr.

Thanks for any help!

Penic
The administrator has disabled public write access.

Writing-Reading of a new variable 10 years 4 months ago #13799

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

Your request in nor really clear and withour any file, it's hard to answer.
Nevertheless, I think your problem comes from the declarations.

In preres, due to the "use declarations_telemac2d", PRIVE1 is known.
In fonstr, there is no "use declarations_telemac2d", in prosou, the "use declarations_telemac2d" exist but with some restrictions driven by the ONLY term, that means PRIVE1 in unknown by default in these subroutines.

I would remember you that some manuals exists. Take some time to read them carefully to well understand how telemac system is coded. In particular, if you would like to add some personal lines in some subroutines, the document "telemac guide for programming" is probably a prerequisite...

hope this helps
Christophe
The administrator has disabled public write access.

Writing-Reading of a new variable 10 years 4 months ago #13804

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes, Christophe is right, note also that PRIVE1 is a pointer to PRIVE%ADR(1)%P%R.

I am just worried by the fact that you assign the value 50 in PRERES_TELEMAC2D, which is perhaps called after PROSOU (unless maybe if the initial conditions are added to the results file, which is the default, but this would be to check also, e.g. it would raise problems if you program variations in time).

Regards,

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

Writing-Reading of a new variable 10 years 3 months ago #13817

  • Penic
  • Penic's Avatar
Hello,

Thanks for you answerd, i'll try to be more explicit.
I added the line USE DECLARATIONS_TELEMAC2D : ONLY PRIVE, PRIVE1 in the FONSTR subroutine so that the variable PRIVE1 is declared in FONSTR.
Moreover, when I write in FONSTR : PRIVE1(1)=50.D0
PRINT* , 'Fonstr : PRIVE1=' ,PRIVE1(1)
I read in the cmd Fonstr : PRIVE1= 50.0000000000
In Prosou, I modify this line
USE DECLARATIONS_TELEMAC2D, ONLY : V2DPAR, PRIVE1, PRIVE
So I think that PRIVE1 is declared in prosou.
But when I Write in prosou PRINT* , 'Prosou : PRIVE1=' ,PRIVE1(1)
I read in the cmd : Prosou : PRIVE1=0.00000000000
The administrator has disabled public write access.

Writing-Reading of a new variable 10 years 3 months ago #13818

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

Personally I prefer use the complete structure instead of alias.
Maybe you could try to use PRIVE%ADR(1)%P%R in your subroutine...

Otherwise maybe you could have a look to see if PRIVE1 is use somewhere...

Hope this helps
Christophe
The administrator has disabled public write access.

Writing-Reading of a new variable 10 years 3 months ago #13819

  • Penic
  • Penic's Avatar
Hello,

It works! The problem was that in subroutine TELEMAC2d, the variable prive was initialised after Fonstr was called!
Thanks for your Help

Penic
The administrator has disabled public write access.
Moderators: pham

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