Hi,
In addition of the mistake pointed out by Christophe, you just have to reverse the order of the DO and IF instructions in the 3rd DO loop.
Your case runs fine for me with the enclosed modifications.
I also did some optimisations on your code so as to remove unused variables and to keep only one DO loop instead of 3. I only look at the source.f subroutine.
File Attachment:
File Name:
ptest.fFile Size: 22 KB
Note also that you can stay in hydostatic version if you don't apply head loss to vertical component of momentum.
I hope it helps.
Laurent