/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_advect_thickness.F
ViewVC logotype

Diff of /MITgcm_contrib/dgoldberg/streamice/streamice_advect_thickness.F

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

revision 1.8 by dgoldberg, Sat Jun 8 22:15:33 2013 UTC revision 1.9 by dgoldberg, Tue Jun 11 17:42:17 2013 UTC
# Line 34  C     === Global variables === Line 34  C     === Global variables ===
34  #ifdef ALLOW_STREAMICE  #ifdef ALLOW_STREAMICE
35    
36        INTEGER i, j, bi, bj        INTEGER i, j, bi, bj
37        _RL thick_bd, uflux, vflux        _RL thick_bd, uflux, vflux, max_icfl, loc_icfl
38          _RL time_step_full, time_step_rem
39        _RL sec_per_year, time_step_loc, MR, SMB, TMB        _RL sec_per_year, time_step_loc, MR, SMB, TMB
40        _RL BCVALX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL BCVALX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
41        _RL BCVALY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL BCVALY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
# Line 52  C     === Global variables === Line 53  C     === Global variables ===
53        sec_per_year = 365.*86400.        sec_per_year = 365.*86400.
54    
55        time_step_loc = time_step / sec_per_year        time_step_loc = time_step / sec_per_year
56          time_step_full = time_step_loc
57          time_step_rem = time_step_loc
58        PRINT *, "time_step_loc ", time_step_loc        PRINT *, "time_step_loc ", time_step_loc
59    
60  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
# Line 130  CADJ STORE streamice_hmask  = comlev1, k Line 132  CADJ STORE streamice_hmask  = comlev1, k
132        _EXCH_XY_RL(BCVALX,myThid)        _EXCH_XY_RL(BCVALX,myThid)
133        _EXCH_XY_RL(BCVALY,myThid)        _EXCH_XY_RL(BCVALY,myThid)
134    
135    #ifndef ALLOW_AUTODIFF_TAMC
136    
137          max_icfl = 1.e-20
138    
139          DO bj=myByLo(myThid),myByHi(myThid)
140           DO bi=myBxLo(myThid),myBxHi(myThid)
141            DO j=1,sNy
142             DO i=1,sNx
143              IF (streamice_hmask(i,j,bi,bj).eq.1.0) THEN
144               loc_icfl=max(abs(utrans(i,j,bi,bj)),
145         &                  abs(utrans(i+1,j,bi,bj))) / dxF(i,j,bi,bj)
146               loc_icfl=max(loc_icfl,max(abs(vtrans(i,j,bi,bj)),
147         &                  abs(vtrans(i,j+1,bi,bj))) / dyF(i,j,bi,bj))
148               if (loc_icfl.gt.max_icfl) then
149                max_icfl = loc_icfl
150               ENDIF
151              ENDIF
152             ENDDO
153            ENDDO
154           ENDDO
155          ENDDO
156    
157          CALL GLOBAL_MAX_R8 (max_icfl, myThid)
158    
159    #endif
160          
161    
162  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
163  CADJ STORE streamice_hmask  = comlev1, key=ikey_dynamics  CADJ STORE streamice_hmask  = comlev1, key=ikey_dynamics
164  CADJ STORE H_streamice  = comlev1, key=ikey_dynamics  CADJ STORE H_streamice  = comlev1, key=ikey_dynamics
165  #endif  #endif
166    
167    #ifndef ALLOW_AUTODIFF_TAMC
168          do while (time_step_rem .gt. 1.e-15)
169           time_step_loc = min (
170         &  streamice_cfl_factor / max_icfl,
171         &  time_step_rem )
172           if (time_step_loc .lt. time_step_full) then
173            PRINT *, "TAKING PARTIAL TIME STEP", time_step_loc
174           endif
175    #endif
176    
177        CALL STREAMICE_ADV_FLUX_FL_X ( myThid ,        CALL STREAMICE_ADV_FLUX_FL_X ( myThid ,
178       I   utrans ,       I   utrans ,
# Line 234  CADJ STORE streamice_hmask  = comlev1, k Line 272  CADJ STORE streamice_hmask  = comlev1, k
272       &  bcMasky )       &  bcMasky )
273  #endif  #endif
274    
275    #ifndef ALLOW_AUTODIFF_TAMC
276          time_step_rem = time_step_rem - time_step_loc      
277          enddo
278    #endif
279    
280    
281    
282  ! NOW WE APPLY MELT RATES !!  ! NOW WE APPLY MELT RATES !!
283  ! THIS MAY BE MOVED TO A SEPARATE SUBROUTINE  ! THIS MAY BE MOVED TO A SEPARATE SUBROUTINE

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22