Hi JMH,
Thanks very much for your help, the code does seem to be working to an extent. The issue now is that the power is being calculated in the wrong region of the channel, as shown by attachment 1, image 1. Instead of being calculated at the start of the channel at each node, it should be at the nodes in the square region in the center of the channel. This is defined in the dragfo file through the use of a do loop: do m=1,n_inpoly.
I find it strange that it is not doing this because the drag force calculation seems to be correct in that when I simulate flow velocity in Blue Kenue, flow is affected in the correct region (see attachment, image 2). However, by making the drag force equal to PRIVE%ADR(1)%P%R(m) and removing the calculation for power seems to give the same problem, in that when displaying variable 23 which is now the drag force in Blue Kenue the only nodes that have drag force that varies with time are the ones at the start of the channel, not in the central region. (So it looks the same as image 1).
Could this be because there is a different file that is manipulating which nodes are used? I have attached the dragfo file again.
Thanks
Danny