Hi again,
I have tried a different strategy, but without success. I tried bringing in the code from my USER_BED_INIT directly and putting it at the end of the COMPUTATION CONTINUED segment, with some variable name changes. In addition, I put write-out lines that should show when I am changing each point, but these lines do not show up in the output log, so it would appear that this code does not run. It should be noted that the roughness should be accessible, as I have added it to declarations. The code runs without error or warning; from previous trials, I know that this code should override the default subroutine.
In essence, at any given point, if the roughness is 0.02501 or 0.01001, I want to make the bottom non-erodible at this point, so I set ES equal to 0.0 and ZR (non-erodible bottom) equal to ZF (surface bottom). And if the roughness is 0.02502, I want it to change the layer composition so that it will match what is in the steering file.
USE DECLARATIONS_TELEMAC2D, ONLY: CHESTR
! .... case: computation continued
! THIS IS FROM MY USER_BED_INIT
DO ILAYER=1,NOMBLAY
DO IPOIN=1,NPOIN
IF ((ABS(CHESTR%R(IPOIN)-0.02501).LT.0.000001).OR.
& (ABS(CHESTR%R(IPOIN)-0.01001).LT.0.000001)) THEN
ES(ILAYER,IPOIN) = 0.D0
ZR%R(IPOIN)=ZF%R(IPOIN)
WRITE(LU,*)'CHANGING NOEROD TO FOND'
ELSE IF (ABS(CHESTR%R(IPOIN)-0.02502).LT.0.000001) THEN
ES(ILAYER,IPOIN) = SED_THICK(ILAYER)
DO ICLA=1,NSICLA
RATIO_SAND(ICLA,ILAYER,IPOIN) = AVA0(ICLA)
WRITE(LU,*)'CHANGING LAYER COMPO'
END DO
END IF
END DO
END DO
!
!
ENDIF !(.NOT.DEBU.OR..NOT.DEBU_MASS)
! .....
Is there anything I'm missing that I need to change, like masses, or am I changing things at the wrong time? If so, where should the above code be positioned in the subroutine? Again, I'm trying to make some last-minute changes to a computation continued file to add in extra elements, based on roughness as suggested in a different post by Rebekka Kopmann. I have confirmed that the TELEMAC geometry file has the target roughness values.
Thanks for any help you can offer!