Hi,
I'm trying to implement a user defined tracer degradation routine using USER_CALCS2D_DEGRADATION but am running into segmentation faults. Currently using v8p4r0.
The degradation law is dependant on spatially and temporally varying salinity and temperature fields as well as irradiance defined in the atmospheric file. Am currently running the Telemac2d model coupled with waqtel number 11 for thermic successfully and also successfully coupled with waqtel number 187 (11 for thermic and 17 for degradation) using a simpler constant degradation law that varies with time of day only) so am confident it's not related to combining waqtel thermic and degradation.
Am confident the equation is producing the numbers I'm expecting but maybe I'm going wrong somewhere in defining TIMP%ADR(ITRAC)%P%R(I).
DO J = 1,NWAQ_DEGRA
ITRAC = RANK_DEGRA(J)
IF(LOITRAC(ITRAC).EQ.4) THEN
DO I = 1,NPOIN
RADSOL=RAY3%R(I)*EXP((1.7D0/0.9D0)*H%R(I))
PRIVE%ADR(1)%P%R(I)=((0.8D0+0.017D0*TN%ADR(IND_S)%P%R(I))*
& 1.07D0**(TN%ADR(IND_T)%P%R(I)-20.D0)+(RADSOL*0.086D0))*
& (-1/86400.D0)
TIMP%ADR(ITRAC)%P%R(I)=TIMP%ADR(3)%P%R(I)+
& (HPROP%R(I)*PRIVE%ADR(1)%P%R(I))
ENDDO
ENDIF
ENDDO
So far all I can deduce is the segmentation fault occurs in the bilant subroutine which is to do with tracer mass balance.
Any pointers would be greatly appreciated. Find attached the user subroutine.
Cheers
David