/[MITgcm]/MITgcm/pkg/thsice/thsice_step_fwd.F
ViewVC logotype

Diff of /MITgcm/pkg/thsice/thsice_step_fwd.F

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

revision 1.19 by jmc, Sun Apr 15 21:58:33 2007 UTC revision 1.20 by heimbach, Mon Apr 16 22:38:24 2007 UTC
# Line 30  C     === Global variables === Line 30  C     === Global variables ===
30  #include "THSICE_VARS.h"  #include "THSICE_VARS.h"
31  #include "THSICE_TAVE.h"  #include "THSICE_TAVE.h"
32  #include "THSICE_2DYN.h"  #include "THSICE_2DYN.h"
33    #ifdef ALLOW_AUTODIFF_TAMC
34    # include "tamc.h"
35    # include "tamc_keys.h"
36    #endif
37    
38        INTEGER siLo, siHi, sjLo, sjHi        INTEGER siLo, siHi, sjLo, sjHi
39        PARAMETER ( siLo = 1-OLx , siHi = sNx+OLx )        PARAMETER ( siLo = 1-OLx , siHi = sNx+OLx )
40        PARAMETER ( sjLo = 1-OLy , sjHi = sNy+OLy )        PARAMETER ( sjLo = 1-OLy , sjHi = sNy+OLy )
# Line 97  C-    define grid-point location where t Line 102  C-    define grid-point location where t
102    
103  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
104    
105    #ifdef ALLOW_AUTODIFF_TAMC
106          act1 = bi - myBxLo(myThid)
107          max1 = myBxHi(myThid) - myBxLo(myThid) + 1
108          act2 = bj - myByLo(myThid)
109          max2 = myByHi(myThid) - myByLo(myThid) + 1
110          act3 = myThid - 1
111          max3 = nTx*nTy
112          act4 = ikey_dynamics - 1
113          iicekey = (act1 + 1) + act2*max1
114         &                     + act3*max1*max2
115         &                     + act4*max1*max2*max3
116    #endif /* ALLOW_AUTODIFF_TAMC */
117    
118  C-    Initialise  C-    Initialise
119        dBugFlag = debugLevel.GE.debLevB        dBugFlag = debugLevel.GE.debLevB
120        DO j = 1-OLy, sNy+OLy        DO j = 1-OLy, sNy+OLy
# Line 184  C------- Line 202  C-------
202         ENDDO         ENDDO
203        ENDDO        ENDDO
204    
205    #ifdef ALLOW_AUTODIFF_TAMC
206    CADJ STORE iceMask(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
207    #endif
208    
209        CALL THSICE_CALC_THICKN(        CALL THSICE_CALC_THICKN(
210       I          bi, bj, siLo, siHi, sjLo, sjHi,       I          bi, bj, siLo, siHi, sjLo, sjHi,
211       I          iMin,iMax, jMin,jMax, dBugFlag,       I          iMin,iMax, jMin,jMax, dBugFlag,
# Line 201  C------- Line 223  C-------
223  C--    Net fluxes :  C--    Net fluxes :
224        DO j = jMin, jMax        DO j = jMin, jMax
225         DO i = iMin, iMax         DO i = iMin, iMax
226    #ifdef ALLOW_AUTODIFF_TAMC
227              ikey_1 = i
228         &         + sNx*(j-1)
229         &         + sNx*sNy*act1
230         &         + sNx*sNy*max1*act2
231         &         + sNx*sNy*max1*max2*act3
232         &         + sNx*sNy*max1*max2*max3*act4
233    #endif /* ALLOW_AUTODIFF_TAMC */
234    C--
235    #ifdef ALLOW_AUTODIFF_TAMC
236    CADJ STORE  icemask(i,j,bi,bj) = comlev1_thsice_1, key=ikey_1
237    #endif
238          IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN          IF (iceMask(i,j,bi,bj).GT.0. _d 0) THEN
239  C-     weighted average net fluxes:  C-     weighted average net fluxes:
240    #ifdef ALLOW_AUTODIFF_TAMC
241    CADJ STORE  fsalt(i,j) = comlev1_thsice_1, key=ikey_1
242    CADJ STORE  flx2oc(i,j) = comlev1_thsice_1, key=ikey_1
243    CADJ STORE  frw2oc(i,j) = comlev1_thsice_1, key=ikey_1
244    CADJ STORE  icemask(i,j,bi,bj) = comlev1_thsice_1, key=ikey_1
245    #endif
246            icFrac = iceMask(i,j,bi,bj)            icFrac = iceMask(i,j,bi,bj)
247            opFrac= 1. _d 0-icFrac            opFrac= 1. _d 0-icFrac
248            icFlxAtm(i,j,bi,bj) = icFrac*icFlxAtm(i,j,bi,bj)            icFlxAtm(i,j,bi,bj) = icFrac*icFlxAtm(i,j,bi,bj)

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22