I checked the code and found bugs in t3dmix2_geo.h, t3dmix2_iso.h, t3dmix2_s.h, t3dmix4_geo.h,t3dmix4_iso.h t3dmix4_s.h,ad_t3dmix2_geo.h and so on. In my configuration, i have set LtracerCLM == T T F and LnudgeTCLM == T T F ( temperature, salinity, inert) in my *.in file, which means the tracer mixing should not be dealed with t-tclm, however in mixing subroutine such as t3dmix2_geo.h, the tracer mixing is still calculated by t-tclm when itrc is equual to 3.
I have fixed these bugs in these subroutines. And the tracer is properly mixed.
For example,the orginal code in lines 229-237 of t3dmix2_geo.h has been fixed as following.
The orginal code in src 766.
Code: Select all
#ifdef MIX_STABILITY
dTdx(i,j,k2)=cff*(0.75_r8*(t(i ,j,k+1,nrhs,itrc)- &
& t(i-1,j,k+1,nrhs,itrc))+ &
& 0.25_r8*(t(i ,j,k+1,nstp,itrc)- &
& t(i-1,j,k+1,nstp,itrc)))
#elif defined CLIMA_TS_MIX
dTdx(i,j,k2)=cff*((t(i ,j,k+1,nrhs,itrc)- &
& tclm(i ,j,k+1,itrc))- &
& (t(i-1,j,k+1,nrhs,itrc)- &
& tclm(i-1,j,k+1,itrc)))
#else
dTdx(i,j,k2)=cff*(t(i ,j,k+1,nrhs,itrc)- &
& t(i-1,j,k+1,nrhs,itrc))
#endif
Code: Select all
#ifdef MIX_STABILITY
dTde(i,j,k2)=cff*(0.75_r8*(t(i,j ,k+1,nrhs,itrc)- &
& t(i,j-1,k+1,nrhs,itrc))+ &
& 0.25_r8*(t(i,j ,k+1,nstp,itrc)- &
& t(i,j-1,k+1,nstp,itrc)))
!
! The following code has been Changed by YDZ 2015.06.29
!
#elif defined CLIMA_TS_MIX
if (LtracerCLM(itrc,ng)) then
dTdx(i,j,k2)=cff*((t(i ,j,k+1,nrhs,itrc)- &
& tclm(i ,j,k+1,itrc))- &
& (t(i-1,j,k+1,nrhs,itrc)- &
& tclm(i-1,j,k+1,itrc)))
else
#ifdef MIX_STABILITY
dTdx(i,j,k2)=cff*(0.75_r8*(t(i ,j,k+1,nrhs,itrc)- &
& t(i-1,j,k+1,nrhs,itrc))+ &
& 0.25_r8*(t(i ,j,k+1,nstp,itrc)- &
& t(i-1,j,k+1,nstp,itrc)))
#else
dTdx(i,j,k2)=cff*(t(i ,j,k+1,nrhs,itrc)- &
& t(i-1,j,k+1,nrhs,itrc))
#endif
end if
#else
dTdx(i,j,k2)=cff*(t(i ,j,k+1,nrhs,itrc)- &
& t(i-1,j,k+1,nrhs,itrc))
#endif