/[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.7 by torge, Mon Oct 22 16:02:25 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 ToM a random number to generate divergence and convergence randomly for the 1-D case  #endif
64        _RL rand_num  #ifdef SEAICE_ITD
       _RL divergence  
65        INTEGER IT        INTEGER IT
66  C#if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC)  #endif
67  #if defined(SEAICE_GROWTH_LEGACY) || defined(ALLOW_AUTODIFF_TAMC) || defined(SEAICE_ITD)  #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 87  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 199  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 211  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,'F8.4)'         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)
 c         DO j=1-OLy,sNy+OLy  
 c          DO i=1-OLx,sNx+OLx  
 ccc           WRITE(msgBuf,HlimitMsgFormat)  
188             WRITE(msgBuf,'(A,F8.4,x,F8.4)')             WRITE(msgBuf,'(A,F8.4,x,F8.4)')
189       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',       &       ' SEAICE_MODEL: AREA and HEFF before advection: ',
190       &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)       &       AREA(1,1,bi,bj), HEFF(1,1,bi,bj)
# Line 237  c     &       HEFFITD(1,1,:,bi,bj) / ARE Line 204  c     &       HEFFITD(1,1,:,bi,bj) / ARE
204       &       AREAITD(1,1,:,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 249  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,'F8.4)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
221         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
# Line 269  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 292  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  c      create some open water  #ifdef SEAICE_DEBUG
        divergence = 1.0/(5*365.*86400./SEAICE_deltaTtherm)  
        DO bj=myByLo(myThid),myByHi(myThid)  
         DO bi=myBxLo(myThid),myBxHi(myThid)  
          DO IT=1,nITD  
           DO J=1-OLy,sNy+OLy  
            DO I=1-OLx,sNx+OLx  
             AREAITD(I,J,IT,bi,bj)=MAX(0.0,AREAITD(I,J,IT,bi,bj)  
      &                           -divergence)  
             HEFFITD(I,J,IT,bi,bj)=HEFFITD(I,J,IT,bi,bj)  
      &                           -divergence*HEFFITD(I,J,IT,bi,bj)  
            ENDDO  
           ENDDO  
          ENDDO  
         ENDDO  
        ENDDO  
270  C     ToM: generate some test output  C     ToM: generate some test output
271         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'         WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
272         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
# Line 349  C     ToM: generate some test output Line 289  C     ToM: generate some test output
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 361  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,'F8.4)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
308          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
# Line 386  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 405  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,'F8.4)'          WRITE(HlimitMsgFormat,'(A,I2,A)') '(A,',nITD,'F8.4)'
354          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
# Line 431  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.7  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22