C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/generic_advdiff/gad_calc_rhs.F,v 1.35 2005/04/03 16:01:21 heimbach Exp $ C $Name: $ #include "GAD_OPTIONS.h" CBOP C !ROUTINE: GAD_CALC_RHS C !INTERFACE: ========================================================== SUBROUTINE GAD_CALC_RHS( I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown, I xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp, I uVel, vVel, wVel, I diffKh, diffK4, KappaR, Tracer, I tracerIdentity, advectionScheme, vertAdvecScheme, I calcAdvection, implicitAdvection, U fVerT, gTracer, I myTime, myIter, myThid ) C !DESCRIPTION: C Calculates the tendancy of a tracer due to advection and diffusion. C It calculates the fluxes in each direction indepentently and then C sets the tendancy to the divergence of these fluxes. The advective C fluxes are only calculated here when using the linear advection schemes C otherwise only the diffusive and parameterized fluxes are calculated. C C Contributions to the flux are calculated and added: C \begin{equation*} C {\bf F} = {\bf F}_{adv} + {\bf F}_{diff} +{\bf F}_{GM} + {\bf F}_{KPP} C \end{equation*} C C The tendancy is the divergence of the fluxes: C \begin{equation*} C G_\theta = G_\theta + \nabla \cdot {\bf F} C \end{equation*} C C The tendancy is assumed to contain data on entry. C !USES: =============================================================== IMPLICIT NONE #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "GRID.h" #include "SURFACE.h" #include "GAD.h" #ifdef ALLOW_AUTODIFF_TAMC #include "tamc.h" #include "tamc_keys.h" #endif /* ALLOW_AUTODIFF_TAMC */ C !INPUT PARAMETERS: =================================================== C bi,bj :: tile indices C iMin,iMax :: loop range for called routines C jMin,jMax :: loop range for called routines C kup :: index into 2 1/2D array, toggles between 1|2 C kdown :: index into 2 1/2D array, toggles between 2|1 C kp1 :: =k+1 for k