/[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.1 by dimitri, Fri Apr 27 22:22:17 2012 UTC revision 1.2 by dimitri, Fri Apr 27 22:25:23 2012 UTC
# Line 55  CEndOfInterface Line 55  CEndOfInterface
55    
56  C !LOCAL VARIABLES: ====================================================  C !LOCAL VARIABLES: ====================================================
57  C     i,j,bi,bj :: Loop counters  C     i,j,bi,bj :: Loop counters
58  #if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC)  CToM<<<
59    C     msgBuf      :: Informational/error message buffer
60          CHARACTER*(MAX_LEN_MBUF) msgBuf
61          CHARACTER*10 HlimitMsgFormat
62    C#if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC)
63    #if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)
64    C>>>ToM
65        INTEGER i, j, bi, bj        INTEGER i, j, bi, bj
66  #endif  #endif
67    CToM<<<
68    #ifdef SEAICE_ITD
69          INTEGER k
70    #endif
71    C>>>ToM
72  #ifdef ALLOW_SITRACER  #ifdef ALLOW_SITRACER
73        INTEGER iTr        INTEGER iTr
74  #endif  #endif
# Line 199  C--   (called from DO_OCEANIC_PHYSICS) t Line 210  C--   (called from DO_OCEANIC_PHYSICS) t
210  C NOW DO ADVECTION and DIFFUSION  C NOW DO ADVECTION and DIFFUSION
211        IF ( SEAICEadvHeff .OR. SEAICEadvArea .OR. SEAICEadvSnow        IF ( SEAICEadvHeff .OR. SEAICEadvArea .OR. SEAICEadvSnow
212       &        .OR. SEAICEadvSalt ) THEN       &        .OR. SEAICEadvSalt ) THEN
213    CToM<<<
214    #ifdef SEAICE_ITD
215    c just for testing until seaice_growth includes itd
216    c       DO bj=myByLo(myThid),myByHi(myThid)
217    c        DO bi=myBxLo(myThid),myBxHi(myThid)
218    c         DO j=1-OLy,sNy+OLy
219    c          DO i=1-OLx,sNx+OLx
220    c           AREAITD (i,j,1,bi,bj)=AREA (i,j,bi,bj)
221    c           HEFFITD (i,j,1,bi,bj)=HEFF (i,j,bi,bj)
222    c           HSNOWITD(i,j,1,bi,bj)=HSNOW(i,j,bi,bj)
223    c          ENDDO
224    c         ENDDO
225    c         DO k=2,nITD
226    c          DO j=1-OLy,sNy+OLy
227    c           DO i=1-OLx,sNx+OLx
228    c            AREAITD (i,j,k,bi,bj) = ZERO
229    c            HEFFITD (i,j,k,bi,bj) = ZERO
230    c            HSNOWITD(i,j,k,bi,bj) = ZERO
231    c           ENDDO
232    c          ENDDO
233    c         ENDDO
234    c        ENDDO
235    c       ENDDO
236    c end this test
237    C     test if REDIST works (1/2):
238           WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'
239           DO bj=myByLo(myThid),myByHi(myThid)
240            DO bi=myBxLo(myThid),myBxHi(myThid)
241    c         DO j=1-OLy,sNy+OLy
242    c          DO i=1-OLx,sNx+OLx
243    ccc           WRITE(msgBuf,HlimitMsgFormat)
244               WRITE(msgBuf,'(A,F6.2,x,F6.2)')
245         &       ' SEAICE_MODEL: AREA and HEFF before advection: ',
246         &       AREA(20,20,bi,bj), HEFF(20,20,bi,bj)
247               CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
248         &       SQUEEZE_RIGHT , myThid)
249               WRITE(msgBuf,HlimitMsgFormat)
250         &       ' SEAICE_MODEL: HEFFITD before advection: ',
251         &       HEFFITD(20,20,:,bi,bj)
252               CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
253         &       SQUEEZE_RIGHT , myThid)
254               WRITE(msgBuf,HlimitMsgFormat)
255         &       ' SEAICE_MODEL: AREAITD before advection: ',
256         &       AREAITD(20,20,:,bi,bj)
257               CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
258         &       SQUEEZE_RIGHT , myThid)
259    c          ENDDO
260    c         ENDDO
261            ENDDO
262           ENDDO
263    #endif
264    C>>>ToM
265  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
266         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )
267  #endif  #endif
268         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )
269    CToM<<<
270    #ifdef SEAICE_ITD
271    C     test if REDIST works (1/2):
272           WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'
273           DO bj=myByLo(myThid),myByHi(myThid)
274            DO bi=myBxLo(myThid),myBxHi(myThid)
275               WRITE(msgBuf,HlimitMsgFormat)
276         &       ' SEAICE_MODEL: HEFFITD before 1. sorting: ',
277         &       HEFFITD(20,20,:,bi,bj)
278               CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
279         &       SQUEEZE_RIGHT , myThid)
280               WRITE(msgBuf,HlimitMsgFormat)
281         &       ' SEAICE_MODEL: AREAITD before 1. sorting: ',
282         &       AREAITD(20,20,:,bi,bj)
283               CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
284         &       SQUEEZE_RIGHT , myThid)
285            ENDDO
286           ENDDO
287    C
288    C     check that all ice thickness categories meet their limits
289    C     (includes Hibler-type ridging)
290    #ifdef ALLOW_DEBUG
291            IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ITD_REDIST', myThid )
292    #endif
293           CALL SEAICE_ITD_REDIST(myTime, myIter, myThid)
294    C     store the mean ice thickness in HEFF (for dynamic solver and diagnostics)
295           CALL SEAICE_ITD_SUM(myTime, myIter, myThid)
296    #endif
297    C>>>ToM
298  #ifdef SEAICE_GROWTH_LEGACY  #ifdef SEAICE_GROWTH_LEGACY
299        ELSE        ELSE
300         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
# Line 230  C     because of ugly time level busines Line 322  C     because of ugly time level busines
322          IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH', myThid )          IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH', myThid )
323  #endif  #endif
324          CALL SEAICE_GROWTH( myTime, myIter, myThid )          CALL SEAICE_GROWTH( myTime, myIter, myThid )
325    CToM<<<
326    #ifdef SEAICE_ITD
327    C     test if GROWTH works:
328            WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'
329            DO bj=myByLo(myThid),myByHi(myThid)
330             DO bi=myBxLo(myThid),myBxHi(myThid)
331                WRITE(msgBuf,HlimitMsgFormat)
332         &        ' SEAICE_MODEL: HEFFITD after growth: ',
333         &        HEFFITD(20,20,:,bi,bj)
334                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
335         &        SQUEEZE_RIGHT , myThid)
336                WRITE(msgBuf,HlimitMsgFormat)
337         &        ' SEAICE_MODEL: AREAITD after growth: ',
338         &        AREAITD(20,20,:,bi,bj)
339                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
340         &        SQUEEZE_RIGHT , myThid)
341                WRITE(msgBuf,HlimitMsgFormat)
342         &        ' SEAICE_MODEL: HSNOWITD after growth: ',
343         &        HSNOWITD(20,20,:,bi,bj)
344                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
345         &        SQUEEZE_RIGHT , myThid)
346             ENDDO
347            ENDDO
348    C
349    C     redistribute sea ice into proper sea ice category after growth/melt
350    C     in case model runs with ice thickness distribution
351    C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|
352    #ifdef ALLOW_DEBUG
353            IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ITD_REDIST', myThid )
354    #endif
355           CALL SEAICE_ITD_REDIST(myTime, myIter, myThid)
356    C     store the mean ice thickness in HEFF (for dynamic solver and diagnostics)
357           CALL SEAICE_ITD_SUM(myTime, myIter, myThid)
358    
359    C     test if REDIST works (2/2):
360            WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'
361            DO bj=myByLo(myThid),myByHi(myThid)
362             DO bi=myBxLo(myThid),myBxHi(myThid)
363                WRITE(msgBuf,HlimitMsgFormat)
364         &        ' SEAICE_MODEL: HEFFITD after 2. sorting: ',
365         &        HEFFITD(20,20,:,bi,bj)
366                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
367         &        SQUEEZE_RIGHT , myThid)
368                WRITE(msgBuf,HlimitMsgFormat)
369         &        ' SEAICE_MODEL: AREAITD after 2. sorting: ',
370         &        AREAITD(20,20,:,bi,bj)
371                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
372         &        SQUEEZE_RIGHT , myThid)
373                WRITE(msgBuf,HlimitMsgFormat)
374         &        ' SEAICE_MODEL: HSNOWITD after 2. sorting: ',
375         &        HSNOWITD(20,20,:,bi,bj)
376                CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
377         &        SQUEEZE_RIGHT , myThid)
378             ENDDO
379            ENDDO
380    #endif
381    C
382    C>>>ToM
383         ENDIF         ENDIF
384  #endif /* DISABLE_SEAICE_GROWTH */  #endif /* DISABLE_SEAICE_GROWTH */
385    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22