In ROMS standard TS_DIAGNOSTICS output, the advection terms (x and y) are combined into one term (salt_hadv and temp_adv). I'm trying to separate them in step3d_t.F but am not sure:
1. whether my modifications (see below) are correct or not?
Another related question is that the advection terms are computed in a flux-form. For example, x-advection term is computed as FX (i+1)- FX(i) where FX = u * S .
2. How can I separate d/dx ( u * S ) into two terms ?
Any suggestion is appreciated!!!
-----------------------------------------------------------------------------------------------------
My modifications with TS_MPDATA in step3d_t.F (under flag HADV_SEP)
Code: Select all
!
! Time-step horizontal advection term.
!
DO j=J_RANGE
DO i=I_RANGE
cff=dt(ng)*pm(i,j)*pn(i,j)
cff1=cff*(FX(i+1,j)-FX(i,j)+ &
& FE(i,j+1)-FE(i,j))
# ifdef HADV_SEP
cff_x=cff*(FX(i+1,j)-FX(i,j))
cff_y=cff*(FE(i,j+1)-FE(i,j))
# endif
# ifdef TS_MPDATA
Ta(i,j,k,itrc)=t(i,j,k,3,itrc)-cff1
# else
t(i,j,k,nnew,itrc)=t(i,j,k,nnew,itrc)-cff1
# endif
# ifdef DIAGNOSTICS_TS
DiaTwrk(i,j,k,itrc,iThadv)=-cff1
# ifdef HADV_SEP
DiaTwrk(i,j,k,itrc,iTxadv)=-cff_x
DiaTwrk(i,j,k,itrc,iTyadv)=-cff_y
# endif
# endif
END DO
END DO
Code: Select all
!
! Time-step corrected horizontal advection (Tunits m).
!
DO j=Jstr,Jend
DO i=Istr,Iend
cff1=dt(ng)*(FX(i+1,j)-FX(i,j)+ &
& FE(i,j+1)-FE(i,j))* &
& pm(i,j)*pn(i,j)
t(i,j,k,nnew,itrc)=Ta(i,j,k,itrc)*Hz(i,j,k)-cff1
# ifdef HADV_SEP
cff_x=dt(ng)*(FX(i+1,j)-FX(i,j))* &
& pm(i,j)*pn(i,j)
cff_y=dt(ng)*(FE(i,j+1)-FE(i,j))* &
& pm(i,j)*pn(i,j)
# endif
# ifdef DIAGNOSTICS_TS
DiaTwrk(i,j,k,itrc,iThadv)=DiaTwrk(i,j,k,itrc,iThadv)- &
& cff1
# ifdef HADV_SEP
DiaTwrk(i,j,k,itrc,iTxadv)=DiaTwrk(i,j,k,itrc,iTxadv)- &
& cff_x
DiaTwrk(i,j,k,itrc,iTyadv)=DiaTwrk(i,j,k,itrc,iTyadv)- &
& cff_y
# endif
# endif
END DO
END DO