Welcome, Guest
Username: Password: Remember me

TOPIC: add access to a new variable

add access to a new variable 2 years 9 months ago #39870

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Hello.
I am using telemac api.
I want to add a time-varying discharge source during the simuulation.
So i add access to DSCE followed the step that mentioned in telapy mannual.
The error appears"Array 'dsce' at (1) cannot have a deferred shape"
How can I solve it?
The attachment is the error message.
Thanks advanced.
Attachments:
The administrator has disabled public write access.

add access to a new variable 2 years 9 months ago #39878

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello,

Perhaps you can try to write as it is done in other lines of the declarations_telemac2d module:
DOUBLE PRECISION, ALLOCATABLE, TARGET :: DSCE(:)

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

add access to a new variable 2 years 9 months ago #39881

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Thanks for your help.
It seems work.However, more error appears as the attachment showed.
Attachments:
The administrator has disabled public write access.

add access to a new variable 2 years 9 months ago #39885

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello,

For this kind of issue, I have 2 suggestions:
- read carefully the TelApy user manual, in particular subsection 4.1.2 "How to add access to a new variable". I am not a specialist of this module, but I can read that using a script does the job easily (but you have to know what you want to declare as a new variable, the script cannot guess for you). I have just tried and it generates the enclosed file e.g. (if DSCE is supposed to be an 1 dimension array of double precision), you also need to change the declarations_telemac2d module by hand,
- or copy and paste of what is done for a similar variable as DSCE, e.g. FLUX_BOUNDARIES.

Anyway, in your implementation, you seem to mix double precision array and BIEF_OBJ or reals (for which %R suffix can be used).

Hope this helps,

Chi-Tuan


File Attachment:

File Name: api_instance_t2d.f
File Size: 18 KB



File Attachment:

File Name: api_handle_var_t2d.f
File Size: 100 KB



File Attachment:

File Name: desc_file.csv
File Size: 0 KB
The administrator has disabled public write access.

add access to a new variable 2 years 8 months ago #39895

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Hi
You're right,I have copied and pasted of what is done for a similar variable yesterday.And the compile is successful now.
I can read and change the DSCE in api.
However,when I tried to change the DSCE,the results did not change.
TELEMAC seems to have read the discharge from the cas file in the beginning and stored it for calculation. It means that I changed DSCE but it does not participate in the calculation,the program still used the old value.
The administrator has disabled public write access.

add access to a new variable 2 years 8 months ago #39898

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Sorry,I made a folly mistake.
I forgot that python is begin with 0 but not 1.So I have changed the value to a empty source.
Now everything work well.
Thanks!
The administrator has disabled public write access.

add access to a new variable 2 years 8 months ago #39907

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Good news that it works now.

Chi-Tuan
The administrator has disabled public write access.
Moderators: pham

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