Hi all
I thought I should mention a bug that I stumbled across in TELEMAC2D (v6p0, but probably others after a brief look at the code). It arises only for certain meshes, without tracers, and only for finite volume calculations. The finite volume scheme used doesn't seem to be important.
After a little digging, the culprit appears to be the DX and DY arrays used by VOLFIN (and its subroutines). In the call from TELEMAC2D, the double arrays AM2%X%R and AM3%X%R are passed as DX and DY to VOLFIN. Unfortunately, the AM arrays has length NSEG (assuming edge-based storage, the default), whilst the DX arrays are expected to have length 3xNPOIN. For certain meshes, one can find that NSEG < 3xNPOIN (it's usually quite close one way or another), and the result is an out-of-range error.
The fix is quite simple. One can simply declare double precision arrays DX and DY in TELEMAC2D, of size 3xNPOIN, and pass them to VOLFIN in place of AM2%X%R and AM3%X%R.
An elegant, though arcane alternative solution is to use the keyword NUMBER OF TRACERS = n, where n>1. This happens to expand the AM... arrays to a size large enough to avoid the out-of-range error.
I hope you find this useful. Apologies if it has already been brought up/fixed!
Happy new year,
Chris