/[MITgcm]/MITgcm/model/src/calc_gs.F
ViewVC logotype

Diff of /MITgcm/model/src/calc_gs.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.41 by jmc, Sun Nov 6 22:19:08 2005 UTC revision 1.46 by jmc, Tue Mar 7 15:28:02 2006 UTC
# Line 51  C     == GLobal variables == Line 51  C     == GLobal variables ==
51  #ifdef ALLOW_GENERIC_ADVDIFF  #ifdef ALLOW_GENERIC_ADVDIFF
52  #include "GAD.h"  #include "GAD.h"
53  #endif  #endif
54    #ifdef ALLOW_AUTODIFF_TAMC
55    # include "tamc.h"
56    # include "tamc_keys.h"
57    #endif
58    
59  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
60  C     == Routine arguments ==  C     == Routine arguments ==
# Line 92  C     === Local variables === Line 96  C     === Local variables ===
96  #endif  #endif
97    
98  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
99              act1 = bi - myBxLo(myThid)
100              max1 = myBxHi(myThid) - myBxLo(myThid) + 1
101              act2 = bj - myByLo(myThid)
102              max2 = myByHi(myThid) - myByLo(myThid) + 1
103              act3 = myThid - 1
104              max3 = nTx*nTy
105              act4 = ikey_dynamics - 1
106              itdkey = (act1 + 1) + act2*max1
107         &                      + act3*max1*max2
108         &                      + act4*max1*max2*max3
109              kkey = (itdkey-1)*Nr + k
110    #endif /* ALLOW_AUTODIFF_TAMC */
111    
112    #ifdef ALLOW_AUTODIFF_TAMC
113  C--   only the kUp part of fverS is set in this subroutine  C--   only the kUp part of fverS is set in this subroutine
114  C--   the kDown is still required  C--   the kDown is still required
115        fVerS(1,1,kDown) = fVerS(1,1,kDown)        fVerS(1,1,kDown) = fVerS(1,1,kDown)
116    # ifdef NONLIN_FRSURF
117    CADJ STORE fVerS(:,:,:) =
118    CADJ &     comlev1_bibj_k, key=kkey, byte=isbyte
119    CADJ STORE gsNm1(:,:,k,bi,bj) =
120    CADJ &     comlev1_bibj_k, key=kkey, byte=isbyte
121    # endif
122  #endif  #endif
123    
124  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
# Line 104  C---+----1----+----2----+----3----+----4 Line 128  C---+----1----+----2----+----3----+----4
128        IF (staggerTimeStep) iterNb = myIter - 1        IF (staggerTimeStep) iterNb = myIter - 1
129    
130  #ifdef ALLOW_ADAMSBASHFORTH_3  #ifdef ALLOW_ADAMSBASHFORTH_3
       IF ( AdamsBashforth_S ) THEN  
131          m1 = 1 + MOD(iterNb+1,2)          m1 = 1 + MOD(iterNb+1,2)
132          m2 = 1 + MOD( iterNb ,2)          m2 = 1 + MOD( iterNb ,2)
133          CALL GAD_CALC_RHS(          CALL GAD_CALC_RHS(
# Line 114  C---+----1----+----2----+----3----+----4 Line 137  C---+----1----+----2----+----3----+----4
137       I           diffKhS, diffK4S, KappaRS,       I           diffKhS, diffK4S, KappaRS,
138       I           gsNm(1-Olx,1-Oly,1,1,1,m2), salt,       I           gsNm(1-Olx,1-Oly,1,1,1,m2), salt,
139       I           GAD_SALINITY, saltAdvScheme, saltVertAdvScheme,       I           GAD_SALINITY, saltAdvScheme, saltVertAdvScheme,
140       I           calcAdvection, saltImplVertAdv,       I           calcAdvection, saltImplVertAdv, AdamsBashforth_S,
141       U           fVerS, gS,       U           fVerS, gS,
142       I           myTime, myIter, myThid )       I           myTime, myIter, myThid )
143        ELSE  #else /* ALLOW_ADAMSBASHFORTH_3 */
 #endif /* ALLOW_ADAMSBASHFORTH_3 */  
144          CALL GAD_CALC_RHS(          CALL GAD_CALC_RHS(
145       I           bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,       I           bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
146       I           xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp,       I           xA,yA,uTrans,vTrans,rTrans,rTransKp1,maskUp,
147       I           uVel, vVel, wVel,       I           uVel, vVel, wVel,
148       I           diffKhS, diffK4S, KappaRS, salt, salt,       I           diffKhS, diffK4S, KappaRS, gsNm1, salt,
149       I           GAD_SALINITY, saltAdvScheme, saltVertAdvScheme,       I           GAD_SALINITY, saltAdvScheme, saltVertAdvScheme,
150       I           calcAdvection, saltImplVertAdv,       I           calcAdvection, saltImplVertAdv, AdamsBashforth_S,
151       U           fVerS, gS,       U           fVerS, gS,
152       I           myTime, myIter, myThid )       I           myTime, myIter, myThid )
153  #ifdef ALLOW_ADAMSBASHFORTH_3  #endif /* ALLOW_ADAMSBASHFORTH_3 */
       ENDIF  
 #endif  
154    
155  C--   External salinity forcing term(s) inside Adams-Bashforth:  C--   External salinity forcing term(s) inside Adams-Bashforth:
156        IF ( saltForcing .AND. forcing_In_AB )        IF ( saltForcing .AND. tracForcingOutAB.NE.1 )
157       & CALL EXTERNAL_FORCING_S(       & CALL EXTERNAL_FORCING_S(
158       I     iMin,iMax,jMin,jMax,bi,bj,k,       I     iMin,iMax,jMin,jMax,bi,bj,k,
159       I     myTime,myThid)       I     myTime,myThid)
# Line 153  C--   External salinity forcing term(s) Line 173  C--   External salinity forcing term(s)
173        ENDIF        ENDIF
174    
175  C--   External salinity forcing term(s) outside Adams-Bashforth:  C--   External salinity forcing term(s) outside Adams-Bashforth:
176        IF ( saltForcing .AND. .NOT.forcing_In_AB )        IF ( saltForcing .AND. tracForcingOutAB.EQ.1 )
177       & CALL EXTERNAL_FORCING_S(       & CALL EXTERNAL_FORCING_S(
178       I     iMin,iMax,jMin,jMax,bi,bj,k,       I     iMin,iMax,jMin,jMax,bi,bj,k,
179       I     myTime,myThid)       I     myTime,myThid)

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.22