/[MITgcm]/MITgcm_contrib/torge/itd/code/seaice_model.F
ViewVC logotype

Diff of /MITgcm_contrib/torge/itd/code/seaice_model.F

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

revision 1.10 by torge, Tue Oct 30 21:32:54 2012 UTC revision 1.12 by torge, Fri May 3 18:59:40 2013 UTC
# Line 56  CEndOfInterface Line 56  CEndOfInterface
56  C !LOCAL VARIABLES: ====================================================  C !LOCAL VARIABLES: ====================================================
57  C     i,j,bi,bj :: Loop counters  C     i,j,bi,bj :: Loop counters
58  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
59  CToM<<<  C     coordinates for debugging output
60          INTEGER i_dbOut, j_dbOut
61  C     msgBuf      :: Informational/error message buffer  C     msgBuf      :: Informational/error message buffer
62        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
63        CHARACTER*10 HlimitMsgFormat        CHARACTER*10 HlimitMsgFormat
# Line 64  C     msgBuf      :: Informational/error Line 65  C     msgBuf      :: Informational/error
65  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
66        INTEGER IT        INTEGER IT
67  #endif  #endif
68  C#if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC)  #if defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)
 #if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)  
 C>>>ToM  
69        INTEGER i, j, bi, bj        INTEGER i, j, bi, bj
70  #endif  #endif
71  #ifdef ALLOW_SITRACER  #ifdef ALLOW_SITRACER
72        INTEGER iTr        INTEGER iTr
73  #endif  #endif
74  CEOP  CEOP
75    #ifdef SEAICE_DEBUG
76          i_dbOut = 1
77          j_dbOut = 1
78    #endif
79    
80  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
81        IF (debugMode) CALL DEBUG_ENTER( 'SEAICE_MODEL', myThid )        IF (debugMode) CALL DEBUG_ENTER( 'SEAICE_MODEL', myThid )
# Line 88  C--   Map thSice-variables to HEFF and A Line 91  C--   Map thSice-variables to HEFF and A
91        ENDIF        ENDIF
92  #endif /* ALLOW_THSICE */  #endif /* ALLOW_THSICE */
93    
 #ifdef SEAICE_GROWTH_LEGACY  
       IF ( .NOT.useThSice ) THEN  
 #ifdef ALLOW_AUTODIFF_TAMC  
 CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte  
 CADJ STORE heffm = comlev1, key=ikey_dynamics, kind=isbyte  
 CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte  
 CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte  
 CADJ STORE tice  = comlev1, key=ikey_dynamics, kind=isbyte  
 #ifdef SEAICE_VARIABLE_SALINITY  
 CADJ STORE hsalt = comlev1, key=ikey_dynamics, kind=isbyte  
 #endif  
 #endif  
       DO bj=myByLo(myThid),myByHi(myThid)  
        DO bi=myBxLo(myThid),myBxHi(myThid)  
         DO j=1-OLy,sNy+OLy  
          DO i=1-OLx,sNx+OLx  
           IF ( (heff(i,j,bi,bj).EQ.0.)  
      &     .OR.(area(i,j,bi,bj).EQ.0.)  
      &     ) THEN  
            HEFF(i,j,bi,bj) = 0. _d 0  
            AREA(i,j,bi,bj) = 0. _d 0  
            HSNOW(i,j,bi,bj) = 0. _d 0  
            TICE(i,j,bi,bj) = celsius2K  
 #ifdef SEAICE_VARIABLE_SALINITY  
            HSALT(i,j,bi,bj) = 0. _d 0  
 #endif  
           ENDIF  
          ENDDO  
         ENDDO  
        ENDDO  
       ENDDO  
       ENDIF  
 #endif  
   
94  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
95        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
96         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
97          DO j=1-OLy,sNy+OLy          DO j=1-OLy,sNy+OLy
98           DO i=1-OLx,sNx+OLx           DO i=1-OLx,sNx+OLx
 # ifdef SEAICE_GROWTH_LEGACY  
           areaNm1(i,j,bi,bj) = 0. _d 0  
           hEffNm1(i,j,bi,bj) = 0. _d 0  
 # endif  
99            uIceNm1(i,j,bi,bj) = 0. _d 0            uIceNm1(i,j,bi,bj) = 0. _d 0
100            vIceNm1(i,j,bi,bj) = 0. _d 0            vIceNm1(i,j,bi,bj) = 0. _d 0
101  # ifdef ALLOW_SITRACER  # ifdef ALLOW_SITRACER
# Line 200  C--   Apply ice velocity open boundary c Line 165  C--   Apply ice velocity open boundary c
165  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
166    
167  #ifdef ALLOW_THSICE  #ifdef ALLOW_THSICE
168        IF ( .NOT.useThSice ) THEN        IF ( useThSice ) THEN
169    #ifndef OLD_THSICE_CALL_SEQUENCE
170    #ifdef ALLOW_DEBUG
171            IF (debugMode) CALL DEBUG_CALL( 'THSICE_DO_ADVECT', myThid )
172    #endif
173            CALL THSICE_DO_ADVECT( 0, 0, myTime, myIter, myThid )
174    #endif /* OLD_THSICE_CALL_SEQUENCE */
175          ELSE
176  #endif  #endif
177  C--   Only call advection of heff, area, snow, and salt and  C--   Only call advection of heff, area, snow, and salt and
178  C--   growth for the generic 0-layer thermodynamics of seaice  C--   growth for the generic 0-layer thermodynamics of seaice
# Line 210  C--   (called from DO_OCEANIC_PHYSICS) t Line 182  C--   (called from DO_OCEANIC_PHYSICS) t
182  C NOW DO ADVECTION and DIFFUSION  C NOW DO ADVECTION and DIFFUSION
183        IF ( SEAICEadvHeff .OR. SEAICEadvArea .OR. SEAICEadvSnow        IF ( SEAICEadvHeff .OR. SEAICEadvArea .OR. SEAICEadvSnow
184       &        .OR. SEAICEadvSalt ) THEN       &        .OR. SEAICEadvSalt ) THEN
 CToM<<<  
185  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
186  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
 C     ToM: generate some test output  
187         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
188         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
189          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
190             WRITE(msgBuf,'(A,F8.4,x,F8.4)')             WRITE(msgBuf,'(A,F8.4,x,F8.4)')
191       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',
192       &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)       &       AREA(i_dbOut,j_dbOut,bi,bj), HEFF(i_dbOut,j_dbOut,bi,bj)
193  c     &       ' SEAICE_MODEL: AREA and HEFF/AREA before advection: ',  c     &       ' SEAICE_MODEL: AREA and HEFF/AREA before advection: ',
194  c     &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)/AREA(1,1,bi,bj)  c     &       AREA(i_dbOut,j_dbOut,bi,bj), HEFF(i_dbOut,j_dbOut,bi,bj)
195    c     &                                   /AREA(i_dbOut,j_dbOut,bi,bj)
196             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
197       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
198             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
199       &       ' SEAICE_MODEL: HEFFITD       before advection: ',       &       ' SEAICE_MODEL: HEFFITD       before advection: ',
200       &       HEFFITD(1,1,:,bi,bj)       &       HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
201  c     &       ' SEAICE_MODEL: HEFFITD/AREAITD before advection: ',  c     &       ' SEAICE_MODEL: HEFFITD/AREAITD before advection: ',
202  c     &       HEFFITD(1,1,:,bi,bj) / AREAITD(1,1,:,bi,bj)  c     &       HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
203    c     &      /AREAITD(i_dbOut,j_dbOut,:,bi,bj)
204             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
205       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
206             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
207       &       ' SEAICE_MODEL: AREAITD       before advection: ',       &       ' SEAICE_MODEL: AREAITD       before advection: ',
208       &       AREAITD(1,1,:,bi,bj)       &       AREAITD(i_dbOut,j_dbOut,:,bi,bj)
209             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
210       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
211          ENDDO          ENDDO
212         ENDDO         ENDDO
213  #endif  #endif
214  #endif  #endif
 C>>>ToM  
215  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
216         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )
217  #endif  #endif
218         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )
 CToM<<<  
219  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
220  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
 C     ToM: generate some test output  
221         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
222         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
223          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
224             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
225       &       ' SEAICE_MODEL: HEFFITD        after advection: ',       &       ' SEAICE_MODEL: HEFFITD        after advection: ',
226       &       HEFFITD(1,1,:,bi,bj)       &       HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
227             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
228       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
229             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
230       &       ' SEAICE_MODEL: AREAITD        after advection: ',       &       ' SEAICE_MODEL: AREAITD        after advection: ',
231       &       AREAITD(1,1,:,bi,bj)       &       AREAITD(i_dbOut,j_dbOut,:,bi,bj)
232             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
233       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
234              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 291  C     to match single category values Line 260  C     to match single category values
260          ENDDO          ENDDO
261         ENDDO         ENDDO
262  #endif  #endif
 C>>>ToM  
 #ifdef SEAICE_GROWTH_LEGACY  
       ELSE  
        DO bj=myByLo(myThid),myByHi(myThid)  
         DO bi=myBxLo(myThid),myBxHi(myThid)  
          DO j=1-OLy,sNy+OLy  
           DO i=1-OLx,sNx+OLx  
            areaNm1(i,j,bi,bj) = AREA(i,j,bi,bj)  
            hEffNm1(i,j,bi,bj) = HEFF(i,j,bi,bj)  
           ENDDO  
          ENDDO  
         ENDDO  
        ENDDO  
 #endif /* SEAICE_GROWTH_LEGACY */  
263        ENDIF        ENDIF
264  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
265  CADJ STORE heffm  = comlev1, key=ikey_dynamics, kind=isbyte  CADJ STORE heffm  = comlev1, key=ikey_dynamics, kind=isbyte
# Line 312  CADJ STORE heffm  = comlev1, key=ikey_dy Line 267  CADJ STORE heffm  = comlev1, key=ikey_dy
267    
268  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
269  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
 C     ToM: generate some test output  
270         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
271         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
272          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
273             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
274       &       ' SEAICE_MODEL: HEFFITD          before growth: ',       &       ' SEAICE_MODEL: HEFFITD          before growth: ',
275       &       HEFFITD(1,1,:,bi,bj)       &       HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
276             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
277       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
278             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
279       &       ' SEAICE_MODEL: AREAITD          before growth: ',       &       ' SEAICE_MODEL: AREAITD          before growth: ',
280       &       AREAITD(1,1,:,bi,bj)       &       AREAITD(i_dbOut,j_dbOut,:,bi,bj)
281             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
282       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
283             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
284       &       ' SEAICE_MODEL: HSNOWITD         before growth: ',       &       ' SEAICE_MODEL: HSNOWITD         before growth: ',
285       &       HSNOWITD(1,1,:,bi,bj)       &       HSNOWITD(i_dbOut,j_dbOut,:,bi,bj)
286             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
287       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
288          ENDDO          ENDDO
# Line 345  C     because of ugly time level busines Line 299  C     because of ugly time level busines
299          IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH', myThid )          IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH', myThid )
300  #endif  #endif
301          CALL SEAICE_GROWTH( myTime, myIter, myThid )          CALL SEAICE_GROWTH( myTime, myIter, myThid )
 CToM<<<  
302  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
303  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
 C     ToM: generate some test output  
304          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
305          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
306           DO bi=myBxLo(myThid),myBxHi(myThid)           DO bi=myBxLo(myThid),myBxHi(myThid)
307              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
308       &        ' SEAICE_MODEL: HEFFITD           after growth: ',       &        ' SEAICE_MODEL: HEFFITD           after growth: ',
309       &        HEFFITD(1,1,:,bi,bj)       &        HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
310              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
311       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
312              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
313       &        ' SEAICE_MODEL: AREAITD           after growth: ',       &        ' SEAICE_MODEL: AREAITD           after growth: ',
314       &        AREAITD(1,1,:,bi,bj)       &        AREAITD(i_dbOut,j_dbOut,:,bi,bj)
315              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
316       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
317              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
318       &        ' SEAICE_MODEL: HSNOWITD          after growth: ',       &        ' SEAICE_MODEL: HSNOWITD          after growth: ',
319       &        HSNOWITD(1,1,:,bi,bj)       &        HSNOWITD(i_dbOut,j_dbOut,:,bi,bj)
320              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
321       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
322              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 394  C     store the mean ice thickness in HE Line 346  C     store the mean ice thickness in HE
346         ENDDO         ENDDO
347    
348  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
 C     ToM: generate some test output  
349          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
350          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
351           DO bi=myBxLo(myThid),myBxHi(myThid)           DO bi=myBxLo(myThid),myBxHi(myThid)
352              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
353       &        ' SEAICE_MODEL: HEFFITD    after final sorting: ',       &        ' SEAICE_MODEL: HEFFITD    after final sorting: ',
354       &        HEFFITD(1,1,:,bi,bj)       &        HEFFITD(i_dbOut,j_dbOut,:,bi,bj)
355              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
356       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
357              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
358       &        ' SEAICE_MODEL: AREAITD    after final sorting: ',       &        ' SEAICE_MODEL: AREAITD    after final sorting: ',
359       &        AREAITD(1,1,:,bi,bj)       &        AREAITD(i_dbOut,j_dbOut,:,bi,bj)
360              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
361       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
362              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
363       &        ' SEAICE_MODEL: HSNOWITD   after final sorting: ',       &        ' SEAICE_MODEL: HSNOWITD   after final sorting: ',
364       &        HSNOWITD(1,1,:,bi,bj)       &        HSNOWITD(i_dbOut,j_dbOut,:,bi,bj)
365              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
366       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
367              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 422  C     ToM: generate some test output Line 373  C     ToM: generate some test output
373  #endif  #endif
374  #endif  #endif
375  C  C
 C>>>ToM  
376         ENDIF         ENDIF
377  #endif /* DISABLE_SEAICE_GROWTH */  #endif /* DISABLE_SEAICE_GROWTH */
378    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22