Welcome, Guest
Username: Password: Remember me

TOPIC: Salinity value NAN

Salinity value NAN 3 months 2 weeks ago #45363

  • claire_couderc
  • claire_couderc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 27
  • Thank you received: 1
Hello,

I'm running a 2D Telemac model at an estuary, and I would like to incorporate salinity into the model at the liquid boundaries.
I also have culverts present in the model.
When I run a simulation with only the culverts, it works. When I run a simulation with only the salinity, it also works.

However, when I include both salinity and culverts in the model, NAN values appear for the salinity.
I have already included the following keywords in the case file:
-TYPE OF SOURCES=2
-DIFFUSION OF TRACERS =0
-TREATMENT OF FLUXES AT THE BOUNDARIES = 2;2

Has anyone encountered this problem before? If so, how did you resolve it?
Thanks
Attachments:
The administrator has disabled public write access.

Salinity value NAN 3 months 2 weeks ago #45368

  • nicogodet
  • nicogodet's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 157
  • Thank you received: 39
When NaN appears, first thing to do is to run in debug mode (see debug config in various systel.cfg).

Which TELEMAC version are you using ?
The administrator has disabled public write access.

Salinity value NAN 3 months 2 weeks ago #45374

  • claire_couderc
  • claire_couderc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 27
  • Thank you received: 1
Debug mode doesn't allow me to pinpoint the problem because the simulation runs with NaN values.
I'm using version V8P4r1.
By adding the keyword: IMPLICITATION COEFFICIENT OF TRACERS = 0, I've solved the problem but I don't know how..
The administrator has disabled public write access.

Salinity value NAN 2 months 4 weeks ago #45444

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

What do you mean by "debug mode":
- using keyword DEBUGGER = 1, which prints the calls to main subroutines?
- or what nicogodet suggests (as me many times).

For the 1st idea, indeed, you will still get NaN and the computation may continue with many NaN written in the listing.

But with the 2nd solution, as written many times on this forum, if a segmentation fault or a NaN (Not a Number) occurs, you should use a debug configuration with debug options to investigate.
See e.g. the S11.gfortran.debug configuration in the $HOMETEL/configs/systel.edf.cfg configuration file, in particular the flag fflags_debug_gfo for gfortran compiler.
fflags_debug_gfo: -g -Wall -fcheck=all -fbacktrace -fbounds-check -finit-integer=-1 -finit-real=nan -ffpe-trap=invalid,zero,overflow

It will show in which subroutine the issue/nan/segfault occurs, the first suspicious line and may help you to change something in your computation.
And in particular, the computation will stop as soon as a segfault or a NaN accurs.

Anyway, if you do not want to take into account the diffusion of tracers, using DIFFUSION OF TRACERS = 0 is not a good idea, you should rather let it to its default value (= 1) and set every COEFFICIENT FOR DIFFUSION OF TRACERS to 0. Depending on the advection scheme, DIFFUSION OF TRACERS = 0 may not only vanish diffusion but also source terms.

If your issue still occurs, it would be interesting to know which version you use and provide at least the steering file.

Hope this helps,

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

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