Welcome, Guest
Username: Password: Remember me

TOPIC: Tidal Turbine Modelling Using dragfo

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40079

  • msuryaprawira
  • msuryaprawira's Avatar
Hi Chi-Tuan,

I have added the "fflags_debug_gfo:" line into my systel_v8p2.cfg as shown in the file attached. However, when I run my model there's nothing different. And then, once the run has finished I run gdb on out_user_fortran.exe from the temporary files, just the procedure I found here:
www.opentelemac.org/index.php/assistance...lemac2d?limitstart=0

it shows:

GRACJG (BIEF): EXCEEDING MAXIMUM ITERATIONS: 1500 RELATIVE PRECISION: NaN

Program received signal SIGSEGV, Segmentation fault.
0x0000000000004018b0 in dragfo_ ()
(gdb) 1

Did I perform the correct procedure? Does this mean something fails in the dragfo subroutine? Thanks.
Attachments:
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40081

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

In addition to what you have written, you should use the options for cmd_exe and cmd_obj, e.g.

[win7gforsdbg]
#
cmd_obj: gfortran -cpp -c -O0 -fopenmp -fconvert=big-endian -frecord-marker=4 -g -Wall -fcheck=all -fbacktrace -fbounds-check -finit-integer=-1 -finit-real=nan -ffpe-trap=invalid,zero,overflow <mods> <incs> <f95name>
cmd_lib: ar cru <libname> <objs>
cmd_exe: gfortran -fopenmp -fconvert=big-endian -frecord-marker=4 -v -lm -o -g -Wall -fcheck=all -fbacktrace -fbounds-check -finit-integer=-1 -finit-real=nan -ffpe-trap=invalid,zero,overflow <exename> <objs> <libs>
#
mods_all: -I <config>
#
sfx_obj: .o
#

or something like that (I do not use windows).
You should also use -O0 for debug rather than -O3 (even for normal configuration -O3 is not recommended with TELEMAC, -O2 is OK).

It should show you the 1st suspicious line when the NaN appears.

With your preliminary test, it seems that your own implementation of DRAGFO subroutine is suspicious.

Hope this helps,

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

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40083

  • msuryaprawira
  • msuryaprawira's Avatar
Hi Chi-Tuan

Thank you for your suggestions I can understand better now how to debug.
I will try the configuration that you have suggested and see the results.
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40106

  • msuryaprawira
  • msuryaprawira's Avatar
Hi, Chi-Tuan

I tried to debug using gdb but still no succession. It shows that the calculation stopped at the DRAGFO subroutine. However, I can't find the information on which line or function did the error occurred. I attached my systel and DRAGFO file below. I also reduced the number of turbines to only 3.


I read on the stack overflow forum that the problem might occur due to an old version of gdb and it suggests updating the gdb. How do you overwrite the 2013 gdb version (the one that comes along with TELEMAC) with the new one? Because whenever I change the environment path to the new gdb, my program fails to run on debug configuration.

Thanks
Attachments:
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40108

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
Your systel leads only to the compilation of wingfors version which is not the debug one...
You should indicate wingforsdbg on the beginning to have both and specify -c wingforsdbg in the launching script

Regards
Christophe
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40112

  • msuryaprawira
  • msuryaprawira's Avatar
Hi,

I see I understand. Do I need to run my calculation through gdb or just add -c wingforsdgb on the usual such as:

<dir>python telemac2d.py casfile.cas -c wingforsdbg ?

Thank you Cristoph.
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40113

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
first you have to compile with -c winforsgdb
then you run the model as usual with the -c wingforsdbg
This could probably gives you more information when the crash occur.
If info are not enough clear, then you could run with gdb...

Hope this helps
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: msuryaprawira

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40127

  • msuryaprawira
  • msuryaprawira's Avatar
Hi,

Thanks to you, I manage to compile the win7gforsdbg version. Although it did not show which line the calculation fail when I run it in the usual way, I can get the information when I run it with gdb.

Now i know that the problem is in the dragfo file, and it gave me this error message:

================================================================================
ITERATION 28800 TIME: 4 H 0 MIN 0.0000 S ( 14400.0000 S)
ADVECTION STEP
DIFFUSION-PROPAGATION STEP
EQUNOR (BIEF) : 11 ITERATIONS, RELATIVE PRECISION: 0.8101051E-04
POSITIVE DEPTHS OBTAINED IN 7 ITERATIONS
BALANCE OF WATER VOLUME
VOLUME IN THE DOMAIN : 0.1906963E+14 M3
FLUX BOUNDARY 1: 76518.83 M3/S ( >0 : ENTERING <0 : EXITING )
FLUX BOUNDARY 2: 439596.9 M3/S ( >0 : ENTERING <0 : EXITING )
RELATIVE ERROR IN VOLUME AT T = 0.1440E+05 S : 0.2749332E-13
PRERES: MAXIMUM COURANT NUMBER: 0.1896932
EQUNOR (BIEF) : EXCEEDING MAXIMUM ITERATIONS: 15000 RELATIVE PRECISION: NaN

Program received signal SIGSEGV, Segmentation fault.
0x0000000000406257 in dragfo (fudrag=..., fvdrag=...)
at C:\Users\surya\OneDrive\Documents\TELEMAC\ntt_turbine\15_cas_1bc_1i_6.cas_2022-03-30-21h35min54s\user_fortran\dragfo_4.f:382
382 IF(IPID.EQ.DDPID(I,IANGLE))THEN

(gdb) list 382
377 IANGLE=INT(ALPHA+0.5D0)
378 XDD = XTEC(I) - DD(I)*COS(DBLE(IANGLE)*DTR)
379 YDD = YTEC(I) + DD(I)*SIN(DBLE(IANGLE)*DTR)
380 UREFX=0.D0
381 UREFY=0.D0
382 IF(IPID.EQ.DDPID(I,IANGLE))THEN
383 N1=IKLE%I(DDELEM(I,IANGLE))
384 N2=IKLE%I(NELEM+DDELEM(I,IANGLE))
385 N3=IKLE%I(2*NELEM+DDELEM(I,IANGLE))
386 !

(gdb) bt
#0 0x0000000000406257 in dragfo (fudrag=..., fvdrag=...)
at C:\Users\surya\OneDrive\Documents\TELEMAC\ntt_turbine\15_cas_1bc_1i_6.cas_2022-03-30-21h35min54s\user_fortran\dragfo_4.f:382
#1 0x000000000064be90 in fricti (fu_imp=..., fv_imp=..., fudrag=..., fvdrag=..., un=..., vn=..., hn=..., cf=...,
mesh=..., t1=..., t2=..., vertic=.TRUE., unsv2d=..., msk=.FALSE., maskel=..., hfrot=1)
at C:\opentelemac-mascaret\v8p2\sources\telemac2d\fricti.f:164
#2 0x0000000000501543 in propag (u=..., v=..., h=..., uconv=..., vconv=..., convv=..., h0=..., patmos=...,
atmos=.FALSE., hprop=..., un=..., vn=..., hn=..., utild=..., vtild=..., htild=..., dh=..., du=..., dv=...,
dhn=..., visc=..., visc_s=..., fu=..., fv=..., smh=..., mesh=..., zf=..., am1=..., am2=..., am3=..., bm1=...,
bm2=..., cm1=..., cm2=..., tm1=..., a23=..., a32=..., mbor=..., cv1=..., cv2=..., cv3=..., ubor=..., vbor=...,
aubor=..., hbor=..., dirbor=..., te1=..., te2=..., te3=..., te4=..., te5=..., t1=..., t2=..., t3=..., t4=...,
t5=..., t6=..., t8=..., limpro=..., mask=..., grav=9.8100000000000005, roeau=1025, cf=..., difvit=.TRUE.,
iordrh=1, iordru=1, lt=30037, dt=0.5, tetah=0.55000000000000004, tetau=0.55000000000000004, tetad=1, aggloh=1,
agglou=1, kdir=2, infogr=.FALSE., kfrot=4, iconvf=..., isousi=1, bilmas=.TRUE., masses=0, mass_rain=0,
yasmh=.FALSE., optban=1, corcon=.TRUE., optsup=..., msk=.FALSE., maskel=..., maskpt=..., ro=..., rovar=.FALSE.,
mat=..., rhs=..., unk=..., tb=..., s=..., preccu=.FALSE., solsys=2, opdvit=1, optsou=1, nfrliq=2, slvpro=...,
equa=..., vertic=.TRUE., adjo=.FALSE., zflats=..., tetazcomp=0, udel=..., vdel=..., dm1=..., zconv=...,
flbor=..., bm1s=..., bm2s=..., cv1s=..., volu2d=..., v2dpar=..., unsv2d=..., ndga1=..., ndgb1=..., nweirs=0,
npsing=..., hfrot=1, flulim=..., yaflulim=.FALSE., flulimebe=..., yaflulimebe=.FALSE., rain=.FALSE., pluie=...,
maxadv=15000, optadv_vi=1, ikle=..., nelmax=214349, _equa=20)
at C:\opentelemac-mascaret\v8p2\sources\telemac2d\propag.F:1021
#3 0x0000000000450748 in telemac2d (pass=-1, atdep=0, niter=0,
code=<error reading variable: Cannot access memory at address 0x1417f71>,
dtdep=<error reading variable: Cannot access memory at address 0x0>,
newtime=<error reading variable: Cannot access memory at address 0x0>,
doprint=<error reading variable: Cannot access memory at address 0x0>,
niterori=<error reading variable: Cannot access memory at address 0x0>,
convergence_level=<error reading variable: Cannot access memory at address 0x0>, _code=7)
at C:\opentelemac-mascaret\v8p2\sources\telemac2d\telemac2d.F:1229
#4 0x0000000000408dbe in homere_telemac2d () at C:\opentelemac-mascaret\v8p2\sources\telemac2d\homere_telemac2d.F:296
#5 0x000000000040a059 in main (argc=1, argv=0x2cb4dc0)
at C:\opentelemac-mascaret\v8p2\sources\telemac2d\homere_telemac2d.F:35
#6 0x00000000004013e5 in __tmainCRTStartup () at /home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:315
#7 0x0000000000401508 in mainCRTStartup () at /home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:195

Can anyone please help me identify the problem? My amateur analysis thinks that it might be due to the angle of the reference velocity. How do I overcome this? thanks.
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40128

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
as you're in gdb, what is the value of angle when crash occur?
Christophe
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 7 months ago #40129

  • msuryaprawira
  • msuryaprawira's Avatar
Hi,

I am trying to extract the calculation results, is it by "print" command in gdb? I cannot find the command I am sorry.

However, as far as I can tell, the angle is directly facing the TEC, which is supposed to be fine.
Angle.png
The administrator has disabled public write access.
Moderators: pham

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