HI PL,
Just a "quick" answer to your requests. I will take more time sooner to complete.
You can use HN%R(I) if you want the water depth at the previous time step for node number I (HN is a structure, HN%R is a pointer on floats).
XSOM and YSOM are arrays containing abscissae and ordinates of the polygon you want to define and NSOM is the number of vertices of this polygon (FYI SOM is the abbreviation of "sommet" which means vertex in French, it can be helpful to know some French words to understand some implementations in TELEMAC
). So you can fill in XSOM and YSOM with a lot of values (e.g. 10) but if you declare NSOM = 4 and give this value to INPOLY, you will then only consider a quadrilateral.
If you read carefully the dragfo subroutine, you may see that SOM is equal to the inverse of the area (the drag force applies on an area, not only for one point).
INPOLY is a function defined in bief directory. OS (for Operation on Structures) is a subroutine defined in bief directory also.
You can read the description of these functions and subroutines in the heading.
FYI, as told in other posts, the description of every subroutine, function and module follow doxygen standards and by looking at
docs.opentelemac.org/ website, you can have the automatically generated description of each of them + call graphs. It is very convenient when you do not know so much about TELEMAC implementation.
So I can say that you were right with INPOLY.
'CALL OS('X=CX ',X=FUDRAG,C=SOM)' means that after this operation, FUDRAG is replaced by the product of the constant SOM and FUDRAG calculated before the calling of OS subroutine (SOM=1/AIRE is a constant and FUDRAG a structure).
Hope this helps,
Chi-Tuan