Hello,
In user_corpor user subroutine, you can see that 1 polygon of NSOM vertices is defined with XSOM.
If you want 3 polygons, I would suggest to define 3 pairs of arrays XSOM1, YSOM1, XSOM2, YSOM2, XSOM3, YSOM3 as done before (with potentially a different number of vertices NSOM1, NSOM2 and NSOM3).
Then, rather than previous test:
IF(INPOLY(XX1,YY1,XSOM,YSOM,NSOM)) THEN
I would write something like
IF(INPOLY(XX1,YY1,XSOM1,YSOM1,NSOM1)
& .OR.INPOLY(XX1,YY1,XSOM2,YSOM2,NSOM2)
& .OR.INPOLY(XX1,YY1,XSOM3,YSOM3,NSOM3)) THEN
which means you check if points with coordinates XX1, YY1 is in polygon 1, or 2 or 3.
Hope this helps,
Chi-Tuan