Hi folks,
I would like to change the bed roughness of my BOTTOM_FRICTION for each iteration. The equation for each node is: Current_Water_Level**(1/6)*RoughnessValues = New_Roughness. The RoughnessValues are defined and extracted in Blue Kenue as: BOTTOM_FRICTION → save as → TriGrid Node File *.nod
So far, I have a kind of working code, but I have two questions:
! ***************** Part of the code START
unit = 20
Open (unit,file='test.txt',STATUS="old",ACTION="read")
read(unit,*) n ! ”read first line, this is the node number n needed for allocation...”
allocate(xx(n,1)) ! “Do some allocation, only rough will be needed.....”
allocate(yy(n,1))
allocate(zz(n,1))
allocate(rough(n,1))
write(*,*) "We have nodes: ", n , " Currenrt Iteration ", LT
do ii = 1, n ! ”get the values from my ascii file: 'RoughnessValue' and store it in rough(:,1)“
read(unit,*) xx(ii,1), yy(ii,1), zz(ii,1), rough(ii,1)
end do
close(unit)
DO I = 1 , NPOIN
CHESTR%R(I) = HN%R(I)**(1/6) * rough(I,1) !”Recalculate a new roughness, depending on water depth”
ENDDO
! ***************** Part of the code END
Question 1: Does this also work for a parallelized telemac2d run? If I print the value of NPOIN it tells me that not all points are used (e.g if PARALLEL PROCESSORS : 4 than size is: NPOIN/4). Nevertheless, if I check the roughness again in Blue Kenue the new CHESTR is recalculated for the hole domain, so obviously it is ok.
Question 2: How can I avoid to reload the ascii file for each iteration? With a simple IF Statement it's not working (scope); can I set a global variable or is there even a better way?
Thanks for your help!
Doeby