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

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

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

revision 1.5 by jmc, Fri Feb 11 19:33:59 2005 UTC revision 1.7 by heimbach, Sun Apr 9 17:35:30 2006 UTC
# Line 29  C     === Global variables === Line 29  C     === Global variables ===
29  #include "FFIELDS.h"  #include "FFIELDS.h"
30  #include "THSICE_PARAMS.h"  #include "THSICE_PARAMS.h"
31  #include "THSICE_VARS.h"  #include "THSICE_VARS.h"
32  #ifdef ALLOW_BULK_FORCE  #ifdef ALLOW_AUTODIFF_TAMC
33  #include "BULKF.h"  # include "tamc.h"
34    # include "tamc_keys.h"
35  #endif  #endif
36    
37  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
# Line 83  C      to be valid at the boundaries ( d Line 84  C      to be valid at the boundaries ( d
84        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
85         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
86    
87    #ifdef ALLOW_AUTODIFF_TAMC
88              act1 = bi - myBxLo(myThid)
89              max1 = myBxHi(myThid) - myBxLo(myThid) + 1
90              act2 = bj - myByLo(myThid)
91              max2 = myByHi(myThid) - myByLo(myThid) + 1
92              act3 = myThid - 1
93              max3 = nTx*nTy
94              act4 = ikey_dynamics - 1
95              iicekey = (act1 + 1) + act2*max1
96         &                         + act3*max1*max2
97         &                         + act4*max1*max2*max3
98    #endif /* ALLOW_AUTODIFF_TAMC */
99    
100  C--     Mixed layer thickness: take the 1rst layer  C--     Mixed layer thickness: take the 1rst layer
101  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
102          IF ( staggerTimeStep .AND. nonlinFreeSurf.GT.0 ) THEN          IF ( staggerTimeStep .AND. nonlinFreeSurf.GT.0 ) THEN
# Line 115  C--     Mixed layer thickness: take the Line 129  C--     Mixed layer thickness: take the
129            ENDDO            ENDDO
130          ENDIF          ENDIF
131    
132    #ifdef ALLOW_AUTODIFF_TAMC
133    CADJ STORE uvel (:,:,1,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
134    CADJ STORE vvel (:,:,1,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
135    #endif
136    
137           DO j = jMin, jMax           DO j = jMin, jMax
138            DO i = iMin, iMax            DO i = iMin, iMax
139             tOceMxL(i,j,bi,bj) = theta(i,j,1,bi,bj)             tOceMxL(i,j,bi,bj) = theta(i,j,1,bi,bj)
# Line 130  C--     Mixed layer thickness: take the Line 149  C--     Mixed layer thickness: take the
149             flxSW (i,j) = 0.             flxSW (i,j) = 0.
150             snowPrc(i,j,bi,bj) = 0. _d 0             snowPrc(i,j,bi,bj) = 0. _d 0
151             siceAlb(i,j,bi,bj) = 0. _d 0             siceAlb(i,j,bi,bj) = 0. _d 0
 #ifdef ALLOW_BULK_FORCE  
            prcAtm(i,j) = ( rain(i,j,bi,bj)+runoff(i,j,bi,bj) )*rhofw  
            flxSW (i,j) = solar(i,j,bi,bj)  
            IF ( iceMask(i,j,bi,bj).GT.0. _d 0  
      &       .AND. Tair(i,j,bi,bj).LE.Tf0kel )  THEN  
              snowPrc(i,j,bi,bj) = rain(i,j,bi,bj)*rhofw  
            ENDIF  
 #endif  
152            ENDDO            ENDDO
153           ENDDO           ENDDO
154    
155    #ifdef ALLOW_AUTODIFF_TAMC
156    CADJ STORE iceMask = comlev1, key = iicekey
157    CADJ STORE iceHeight  = comlev1, key = iicekey
158    CADJ STORE snowHeight = comlev1, key = iicekey
159    CADJ STORE Tsrf    = comlev1, key = iicekey
160    CADJ STORE Qice1   = comlev1, key = iicekey
161    CADJ STORE Qice2   = comlev1, key = iicekey
162    CADJ STORE snowAge = comlev1, key = iicekey
163    
164    CADJ STORE sHeating = comlev1, key = iicekey
165    CADJ STORE flxCndBt = comlev1, key = iicekey
166    CADJ STORE snowPrc  = comlev1, key = iicekey
167    
168    CADJ STORE hOceMxL = comlev1, key = iicekey
169    CADJ STORE tOceMxL = comlev1, key = iicekey
170    CADJ STORE sOceMxL = comlev1, key = iicekey
171    CADJ STORE v2ocMxL = comlev1, key = iicekey
172    
173    CADJ STORE empmr   = comlev1, key = iicekey
174    CADJ STORE qnet    = comlev1, key = iicekey
175    #endif
176    
177    #ifdef ALLOW_BULK_FORCE
178             IF ( useBulkforce ) THEN
179               CALL THSICE_GET_PRECIP(
180         I                  iceMask,
181         O                  prcAtm, snowPrc(1-Olx,1-Oly,bi,bj), flxSW,
182         I                  iMin,iMax,jMin,jMax, bi,bj, myThid )
183             ENDIF
184    #endif
185    
186    
187           CALL THSICE_STEP_FWD(           CALL THSICE_STEP_FWD(
188       I                     bi, bj, iMin, iMax, jMin, jMax,       I                     bi, bj, iMin, iMax, jMin, jMax,
189       I                     prcAtm,       I                     prcAtm,
# Line 155  c      ENDDO Line 198  c      ENDDO
198  c     ENDDO  c     ENDDO
199    
200  c       IF ( .FALSE. ) THEN  c       IF ( .FALSE. ) THEN
201    #ifdef ALLOW_AUTODIFF_TAMC
202    CADJ STORE fu(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
203    CADJ STORE fv(:,:,bi,bj) = comlev1_bibj, key=iicekey, byte=isbyte
204    #endif
205          IF ( stressReduction.GT. 0. _d 0 ) THEN          IF ( stressReduction.GT. 0. _d 0 ) THEN
206           DO j = jMin, jMax           DO j = jMin, jMax
207            DO i = iMin+1,iMax            DO i = iMin+1,iMax

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22