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

TOPIC: changing the values of (BIEF_OBJ) variables

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42777

  • MartinPHYS
  • MartinPHYS's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 24
  • Thank you received: 1
Hello yet again,

Thanks for the previous tips, they resolved my issues with the declarations in user_corfon.f, however I am now getting a weird error on the syntax of my IF statements. I did not change anything with the syntax of the IF statements from the ones used in my user_bord.f file which compiles fine, and yet when compiling the attached user_corfon.f file I get the following errors:


48 | IF(LIHBOR(BPTA).EQ.5.AND.LIUBOR(BPTA).EQ.4) THEN
| 1
Error: Syntax error in IF-expression at (1)

54 | ENDIF
| 1
Error: Expecting END DO statement at (1)

59 | IF(LIHBOR(BPTA).EQ.4.AND.LIUBOR(BPTA).EQ.5) THEN
| 1
Error: Syntax error in IF-expression at (1)

65 | ENDIF
| 1
Error: Expecting END DO statement at (1)


I've tried a bunch of different variations of this but nothing seems to work, and gfortran only seems to care about LIHBOR and not LIUBOR so I'm not sure what I am doing wrong here.

-Martin
Attachments:
The administrator has disabled public write access.

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42778

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
Maybe a problem of line ending character?
Christophe
The administrator has disabled public write access.

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42779

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

Have a look at how LIHBOR and LUBOR are declared in DECLARATIONS_TELEMAC2D module:
      TYPE(BIEF_OBJ), TARGET :: LIUBOR,LIVBOR,LIHBOR,LITBOR
They are defined as a BIEF_OBJ.
To manipulate the real arrays associated to these BIEF_OBJs, use the %R suffix.

Hope this helps,

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

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42787

  • MartinPHYS
  • MartinPHYS's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 24
  • Thank you received: 1
Thanks for the help Chi-Tuan, my file compiles without error now!

I had previously tried using the suffix %I because I thought that the values for LIHBOR and LIUBOR could only take integer values, I guess most BIEF_OBJ are real arrays?
The administrator has disabled public write access.

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42792

  • MartinPHYS
  • MartinPHYS's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 24
  • Thank you received: 1
Hello again,

I have some updates with how my code is working. It turns out, using the suffix %R for LIHBOR and LIUBOR gives a "segmentation fault error, improper memory reference". I changed this suffix to %I and the code now runs without error. Also, I found that using the user_corfon.f file was not adequate for my needs because it seems that it is only called once at the beginning of the simulation. I found an old post on the forum about this (post #9744) and learned that in order to change the bottom elevation at every time step, you need to use the "user_utimp_telemac2d.f" subroutine, which is called at every time step. Copying my previous user_corfon code into the user_utimp_telemac2d.f file seems to have resolved this issue, however it appears that I am now back at my original problem where the code runs as expected, and print statements give the expected printouts, but no change is observed in the output files. The simulation runs as if I had not compiled it with my user_bord.f or user_utimp_telemac2d.f files. I have attached my user_utimp_telemac2d.f file.

Could it be that my changes are being overwritten by the regular telemac simulation procedures before my changes are recorded in the selafin output file? Or am I doing some other thing wrong?
Attachments:
The administrator has disabled public write access.

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42797

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

Sorry, my mistake, I would have written %I as integer is expected for LIHBOR, LIUBOR etc.
You can check that by reading POINT_TELEMAC2D subroutine when calling BIEF_ALLVEC. The first number gives you the nature of the field (1 for reals, 2 for integers).

Indeed USER_CORFON and CORFON are only called once.
As you have found, UTIMP_TELEMAC2D and USER_UTIMP_TELEMAC2D are called in TELEMAC2D, but only at the end of the time loop. That may explain what you encounter.
You can try to move the call to UTIMP_TELEMAC2D in TELEMAC2D subroutine before the subroutine you want your modifications to be applied (at least before the calls to BIEF_DESIMP), it should better work.

Hope this helps,

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

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42801

  • MartinPHYS
  • MartinPHYS's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 24
  • Thank you received: 1
Hi Chi-Tuan,

I have tried moving the call to UTIMP_TELEMAC2D to a couple of different places in telemac2d.f and unfortunately nothing has changed in my output files. I tried placing the call both before and after the call to bord.f and also just before the first calls to BIEF_DESIMP. The output is the same each time. The line to call UTIMP is as follows:

CALL UTIMP_TELEMAC2D(LT,AT,PTINIG,LEOPRD,PTINIL,LISPRD)

Do I need to change anything in the arguments of the call to UTIMP? Is there anything else that could be interfering with changing the ZF values on a boundary node?

This is really odd because everything I print to the console is what I want and expect but somehow it is not translating into the selafin file output.

Thanks for the help.
-Martin
The administrator has disabled public write access.

changing the values of (BIEF_OBJ) variables 1 year 5 months ago #42803

  • MartinPHYS
  • MartinPHYS's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 24
  • Thank you received: 1
Could it be that I am coupling with GAIA? I probably should have mentioned this already...
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

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