/[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.6 by torge, Wed Sep 26 17:50:17 2012 UTC revision 1.11 by torge, Wed Mar 27 18:59:53 2013 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    #ifdef SEAICE_DEBUG
59  CToM<<<  CToM<<<
60  C     msgBuf      :: Informational/error message buffer  C     msgBuf      :: Informational/error message buffer
61        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
62        CHARACTER*10 HlimitMsgFormat        CHARACTER*10 HlimitMsgFormat
63  C#if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC)  #endif
64  #if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)  #ifdef SEAICE_ITD
65          INTEGER IT
66    #endif
67    #if defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)
68  C>>>ToM  C>>>ToM
69        INTEGER i, j, bi, bj        INTEGER i, j, bi, bj
70  #endif  #endif
# Line 83  C--   Map thSice-variables to HEFF and A Line 87  C--   Map thSice-variables to HEFF and A
87        ENDIF        ENDIF
88  #endif /* ALLOW_THSICE */  #endif /* ALLOW_THSICE */
89    
 #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  
   
90  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
91        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
92         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
93          DO j=1-OLy,sNy+OLy          DO j=1-OLy,sNy+OLy
94           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  
95            uIceNm1(i,j,bi,bj) = 0. _d 0            uIceNm1(i,j,bi,bj) = 0. _d 0
96            vIceNm1(i,j,bi,bj) = 0. _d 0            vIceNm1(i,j,bi,bj) = 0. _d 0
97  # ifdef ALLOW_SITRACER  # ifdef ALLOW_SITRACER
# Line 195  C--   Apply ice velocity open boundary c Line 161  C--   Apply ice velocity open boundary c
161  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
162    
163  #ifdef ALLOW_THSICE  #ifdef ALLOW_THSICE
164        IF ( .NOT.useThSice ) THEN        IF ( useThSice ) THEN
165    #ifndef OLD_THSICE_CALL_SEQUENCE
166    #ifdef ALLOW_DEBUG
167            IF (debugMode) CALL DEBUG_CALL( 'THSICE_DO_ADVECT', myThid )
168    #endif
169            CALL THSICE_DO_ADVECT( 0, 0, myTime, myIter, myThid )
170    #endif /* OLD_THSICE_CALL_SEQUENCE */
171          ELSE
172  #endif  #endif
173  C--   Only call advection of heff, area, snow, and salt and  C--   Only call advection of heff, area, snow, and salt and
174  C--   growth for the generic 0-layer thermodynamics of seaice  C--   growth for the generic 0-layer thermodynamics of seaice
# Line 207  C NOW DO ADVECTION and DIFFUSION Line 180  C NOW DO ADVECTION and DIFFUSION
180       &        .OR. SEAICEadvSalt ) THEN       &        .OR. SEAICEadvSalt ) THEN
181  CToM<<<  CToM<<<
182  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
183    #ifdef SEAICE_DEBUG
184  C     ToM: generate some test output  C     ToM: generate some test output
185         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
186         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
187          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
188  c         DO j=1-OLy,sNy+OLy             WRITE(msgBuf,'(A,F8.4,x,F8.4)')
 c          DO i=1-OLx,sNx+OLx  
 ccc           WRITE(msgBuf,HlimitMsgFormat)  
            WRITE(msgBuf,'(A,F6.2,x,F6.2)')  
189       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',
190       &       AREA(20,20,bi,bj), HEFF(20,20,bi,bj)       &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)
191  c     &       ' SEAICE_MODEL: AREA and HEFF/AREA before advection: ',  c     &       ' SEAICE_MODEL: AREA and HEFF/AREA before advection: ',
192  c     &       AREA(20,20,bi,bj), HEFF(20,20,bi,bj)/AREA(20,20,bi,bj)  c     &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)/AREA(1,1,bi,bj)
193             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
194       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
195             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
196       &       ' SEAICE_MODEL: HEFFITD       before advection: ',       &       ' SEAICE_MODEL: HEFFITD       before advection: ',
197       &       HEFFITD(20,20,:,bi,bj)       &       HEFFITD(1,1,:,bi,bj)
198  c     &       ' SEAICE_MODEL: HEFFITD/AREAITD before advection: ',  c     &       ' SEAICE_MODEL: HEFFITD/AREAITD before advection: ',
199  c     &       HEFFITD(20,20,:,bi,bj) / AREAITD(20,20,:,bi,bj)  c     &       HEFFITD(1,1,:,bi,bj) / AREAITD(1,1,:,bi,bj)
200             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
201       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
202             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
203       &       ' SEAICE_MODEL: AREAITD       before advection: ',       &       ' SEAICE_MODEL: AREAITD       before advection: ',
204       &       AREAITD(20,20,:,bi,bj)       &       AREAITD(1,1,:,bi,bj)
205             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
206       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
 c          ENDDO  
 c         ENDDO  
207          ENDDO          ENDDO
208         ENDDO         ENDDO
209  #endif  #endif
210    #endif
211  C>>>ToM  C>>>ToM
212  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
213         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )         IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid )
# Line 245  C>>>ToM Line 215  C>>>ToM
215         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )         CALL SEAICE_ADVDIFF( myTime, myIter, myThid )
216  CToM<<<  CToM<<<
217  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
218    #ifdef SEAICE_DEBUG
219  C     ToM: generate some test output  C     ToM: generate some test output
220         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
221         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
222          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
223             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
224       &       ' SEAICE_MODEL: HEFFITD        after advection: ',       &       ' SEAICE_MODEL: HEFFITD        after advection: ',
225       &       HEFFITD(20,20,:,bi,bj)       &       HEFFITD(1,1,:,bi,bj)
226             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
227       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
228             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
229       &       ' SEAICE_MODEL: AREAITD        after advection: ',       &       ' SEAICE_MODEL: AREAITD        after advection: ',
230       &       AREAITD(20,20,:,bi,bj)       &       AREAITD(1,1,:,bi,bj)
231             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
232       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
233              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 265  C     ToM: generate some test output Line 236  C     ToM: generate some test output
236       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
237          ENDDO          ENDDO
238         ENDDO         ENDDO
239    #endif
240  C  C
241  C     check that all ice thickness categories meet their limits  C     check that all ice thickness categories meet their limits
242  C     (includes Hibler-type ridging)  C     (includes Hibler-type ridging)
# Line 288  C     to match single category values Line 260  C     to match single category values
260         ENDDO         ENDDO
261  #endif  #endif
262  C>>>ToM  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
266  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
267    
268  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
269    #ifdef SEAICE_DEBUG
270  C     ToM: generate some test output  C     ToM: generate some test output
271         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
272         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
273          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
274             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
275       &       ' SEAICE_MODEL: HEFFITD          before growth: ',       &       ' SEAICE_MODEL: HEFFITD          before growth: ',
276       &       HEFFITD(20,20,:,bi,bj)       &       HEFFITD(1,1,:,bi,bj)
277             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
278       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
279             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
280       &       ' SEAICE_MODEL: AREAITD          before growth: ',       &       ' SEAICE_MODEL: AREAITD          before growth: ',
281       &       AREAITD(20,20,:,bi,bj)       &       AREAITD(1,1,:,bi,bj)
282             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
283       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
284             WRITE(msgBuf,HlimitMsgFormat)             WRITE(msgBuf,HlimitMsgFormat)
285       &       ' SEAICE_MODEL: HSNOWITD         before growth: ',       &       ' SEAICE_MODEL: HSNOWITD         before growth: ',
286       &       HSNOWITD(20,20,:,bi,bj)       &       HSNOWITD(1,1,:,bi,bj)
287             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,             CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
288       &       SQUEEZE_RIGHT , myThid)       &       SQUEEZE_RIGHT , myThid)
289          ENDDO          ENDDO
290         ENDDO         ENDDO
291  #endif  #endif
292    #endif
293    
294  #ifndef DISABLE_SEAICE_GROWTH  #ifndef DISABLE_SEAICE_GROWTH
295  C     thermodynamics growth  C     thermodynamics growth
# Line 341  C     because of ugly time level busines Line 302  C     because of ugly time level busines
302          CALL SEAICE_GROWTH( myTime, myIter, myThid )          CALL SEAICE_GROWTH( myTime, myIter, myThid )
303  CToM<<<  CToM<<<
304  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
305    #ifdef SEAICE_DEBUG
306  C     ToM: generate some test output  C     ToM: generate some test output
307          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
308          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
309           DO bi=myBxLo(myThid),myBxHi(myThid)           DO bi=myBxLo(myThid),myBxHi(myThid)
310              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
311       &        ' SEAICE_MODEL: HEFFITD           after growth: ',       &        ' SEAICE_MODEL: HEFFITD           after growth: ',
312       &        HEFFITD(20,20,:,bi,bj)       &        HEFFITD(1,1,:,bi,bj)
313              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
314       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
315              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
316       &        ' SEAICE_MODEL: AREAITD           after growth: ',       &        ' SEAICE_MODEL: AREAITD           after growth: ',
317       &        AREAITD(20,20,:,bi,bj)       &        AREAITD(1,1,:,bi,bj)
318              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
319       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
320              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
321       &        ' SEAICE_MODEL: HSNOWITD          after growth: ',       &        ' SEAICE_MODEL: HSNOWITD          after growth: ',
322       &        HSNOWITD(20,20,:,bi,bj)       &        HSNOWITD(1,1,:,bi,bj)
323              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
324       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
325              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 366  C     ToM: generate some test output Line 328  C     ToM: generate some test output
328       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
329           ENDDO           ENDDO
330          ENDDO          ENDDO
331    #endif
332  C  C
333  C     redistribute sea ice into proper sea ice category after growth/melt  C     redistribute sea ice into proper sea ice category after growth/melt
334  C     in case model runs with ice thickness distribution  C     in case model runs with ice thickness distribution
# Line 385  C     store the mean ice thickness in HE Line 348  C     store the mean ice thickness in HE
348          ENDDO          ENDDO
349         ENDDO         ENDDO
350    
351    #ifdef SEAICE_DEBUG
352  C     ToM: generate some test output  C     ToM: generate some test output
353          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F6.2)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
354          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
355           DO bi=myBxLo(myThid),myBxHi(myThid)           DO bi=myBxLo(myThid),myBxHi(myThid)
356              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
357       &        ' SEAICE_MODEL: HEFFITD    after final sorting: ',       &        ' SEAICE_MODEL: HEFFITD    after final sorting: ',
358       &        HEFFITD(20,20,:,bi,bj)       &        HEFFITD(1,1,:,bi,bj)
359              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
360       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
361              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
362       &        ' SEAICE_MODEL: AREAITD    after final sorting: ',       &        ' SEAICE_MODEL: AREAITD    after final sorting: ',
363       &        AREAITD(20,20,:,bi,bj)       &        AREAITD(1,1,:,bi,bj)
364              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
365       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
366              WRITE(msgBuf,HlimitMsgFormat)              WRITE(msgBuf,HlimitMsgFormat)
367       &        ' SEAICE_MODEL: HSNOWITD   after final sorting: ',       &        ' SEAICE_MODEL: HSNOWITD   after final sorting: ',
368       &        HSNOWITD(20,20,:,bi,bj)       &        HSNOWITD(1,1,:,bi,bj)
369              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
370       &        SQUEEZE_RIGHT , myThid)       &        SQUEEZE_RIGHT , myThid)
371              WRITE(msgBuf,'(A)')              WRITE(msgBuf,'(A)')
# Line 411  C     ToM: generate some test output Line 375  C     ToM: generate some test output
375           ENDDO           ENDDO
376          ENDDO          ENDDO
377  #endif  #endif
378    #endif
379  C  C
380  C>>>ToM  C>>>ToM
381         ENDIF         ENDIF

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22