Thank you for your answer Jean-Michel.
However, I might be missing something, but I am not sure removing the lines
IF(NCSIZE.GT.1) N=MESH%KNOLG%I(N)
before calling SL and VIT will change something, as it is the discharge Q that I want to prescribe as a function of the mean water level along the liquid boundary, and it does not take N as an argument.
Actually, for the moment, I am hard coding the global node numbers for each liquid boundary (in the future, it could be read from an external file) and computing the mean water level along it.
Therefore, I tried your second solution by calling the function GLOBAL_TO_LOCAL_POINT (I'll figure out a way to call it only once at start later), but I got a segmentation fault... Could you explain me why?
I only attached my modified Q function. I will send the other files if needed.
Thank you in advance!