/[MITgcm]/MITgcm/pkg/kpp/kpp_calc.F
ViewVC logotype

Diff of /MITgcm/pkg/kpp/kpp_calc.F

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

revision 1.33 by heimbach, Sat Feb 25 16:29:55 2006 UTC revision 1.34 by dimitri, Thu Apr 19 04:51:59 2007 UTC
# Line 93  c     (-2:sNx+3,-2:sNy+3) as required by Line 93  c     (-2:sNx+3,-2:sNy+3) as required by
93  c     values of uVel, vVel, surfaceForcingU, surfaceForcingV in the  c     values of uVel, vVel, surfaceForcingU, surfaceForcingV in the
94  c     region (-2:sNx+4,-2:sNy+4).  c     region (-2:sNx+4,-2:sNy+4).
95  c     Hence overlap region needs to be set OLx=4, OLy=4.  c     Hence overlap region needs to be set OLx=4, OLy=4.
 c     When option FRUGAL_KPP is used, computation in overlap regions  
 c     is replaced with exchange calls hence reducing overlap requirements  
 c     to OLx=1, OLy=1.  
96  c \ev  c \ev
97    
98  C !USES: ===============================================================  C !USES: ===============================================================
# Line 138  c     imin, imax, jmin, jmax  - array co Line 135  c     imin, imax, jmin, jmax  - array co
135        _KPP_RL    p0    , p5    , p25     , p125      , p0625        _KPP_RL    p0    , p5    , p25     , p125      , p0625
136        parameter( p0=0.0, p5=0.5, p25=0.25, p125=0.125, p0625=0.0625 )        parameter( p0=0.0, p5=0.5, p25=0.25, p125=0.125, p0625=0.0625 )
137        integer   imin      ,imax          ,jmin      ,jmax        integer   imin      ,imax          ,jmin      ,jmax
 #ifdef FRUGAL_KPP  
       parameter(imin=1    ,imax=sNx      ,jmin=1    ,jmax=sNy      )  
 #else  
138        parameter(imin=2-OLx,imax=sNx+OLx-1,jmin=2-OLy,jmax=sNy+OLy-1)        parameter(imin=2-OLx,imax=sNx+OLx-1,jmin=2-OLy,jmax=sNy+OLy-1)
 #endif  
139    
140  c Local arrays and variables  c Local arrays and variables
141  c     work?  (nx,ny)       - horizontal working arrays  c     work?  (nx,ny)       - horizontal working arrays
# Line 169  c     uRef   (nx,ny)       - Reference z Line 162  c     uRef   (nx,ny)       - Reference z
162  c     vRef   (nx,ny)       - Reference meridional velocity              (m/s)  c     vRef   (nx,ny)       - Reference meridional velocity              (m/s)
163    
164        _RL     worka ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )        _RL     worka ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
165        integer work1 ( ibot:itop    , jbot:jtop                    )        integer work1 ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
166        _KPP_RL work2 ( ibot:itop    , jbot:jtop                    )        _KPP_RL work2 ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
167        _KPP_RL work3 ( ibot:itop    , jbot:jtop                    )        _KPP_RL work3 ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
168        _KPP_RL ustar ( ibot:itop    , jbot:jtop                    )        _KPP_RL ustar ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
169        _KPP_RL bo    ( ibot:itop    , jbot:jtop                    )        _KPP_RL bo    ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
170        _KPP_RL bosol ( ibot:itop    , jbot:jtop                    )        _KPP_RL bosol ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
171        _KPP_RL shsq  ( ibot:itop    , jbot:jtop    , Nr            )        _KPP_RL shsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
172        _KPP_RL dVsq  ( ibot:itop    , jbot:jtop    , Nr            )        _KPP_RL dVsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
173        _KPP_RL dbloc ( ibot:itop    , jbot:jtop    , Nr            )        _KPP_RL dbloc ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
174        _KPP_RL Ritop ( ibot:itop    , jbot:jtop    , Nr            )        _KPP_RL Ritop ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
175        _KPP_RL vddiff( ibot:itop    , jbot:jtop    , 0:Nrp1, mdiff )        _KPP_RL vddiff( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, 0:Nrp1, mdiff )
176        _KPP_RL ghat  ( ibot:itop    , jbot:jtop    , Nr            )        _KPP_RL ghat  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
177        _KPP_RL hbl   ( ibot:itop    , jbot:jtop                    )        _KPP_RL hbl   ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
178  cph(  cph(
179        _KPP_RL TTALPHA( ibot:itop, jbot:jtop, Nrp1 )        _KPP_RL TTALPHA( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nrp1 )
180        _KPP_RL SSBETA ( ibot:itop, jbot:jtop, Nrp1 )        _KPP_RL SSBETA ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nrp1 )
181  cph)  cph)
182  #ifdef KPP_ESTIMATE_UREF  #ifdef KPP_ESTIMATE_UREF
183        _KPP_RL z0    ( ibot:itop    , jbot:jtop                    )        _KPP_RL z0    ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
184        _KPP_RL zRef  ( ibot:itop    , jbot:jtop                    )        _KPP_RL zRef  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
185        _KPP_RL uRef  ( ibot:itop    , jbot:jtop                    )        _KPP_RL uRef  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
186        _KPP_RL vRef  ( ibot:itop    , jbot:jtop                    )        _KPP_RL vRef  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
187  #endif /* KPP_ESTIMATE_UREF */  #endif /* KPP_ESTIMATE_UREF */
188                
189        _KPP_RL tempvar2        _KPP_RL tempvar2
# Line 261  c--------------------------------------- Line 254  c---------------------------------------
254        CALL TIMER_STOP ('STATEKPP      [KPP_CALC]', myThid)        CALL TIMER_STOP ('STATEKPP      [KPP_CALC]', myThid)
255    
256        DO k = 1, Nr        DO k = 1, Nr
257           DO j = jbot, jtop           DO j = 1-OLy, sNy+OLy
258              DO i = ibot, itop              DO i = 1-OLx, sNx+OLx
259                 ghat(i,j,k) = dbloc(i,j,k)                 ghat(i,j,k) = dbloc(i,j,k)
260              ENDDO              ENDDO
261           ENDDO           ENDDO
# Line 277  c     levels therefore k+1 mask must be Line 270  c     levels therefore k+1 mask must be
270        DO k = 1, Nr-1        DO k = 1, Nr-1
271           CALL KPP_SMOOTH_HORIZ (           CALL KPP_SMOOTH_HORIZ (
272       I        k+1, bi, bj,       I        k+1, bi, bj,
273       U        ghat (ibot,jbot,k) )       U        ghat (1-OLx,1-OLy,k) )
274        ENDDO        ENDDO
275    
276  #endif /* KPP_SMOOTH_DBLOC */  #endif /* KPP_SMOOTH_DBLOC */
# Line 290  c     horizontally smooth density relate Line 283  c     horizontally smooth density relate
283        DO k = 1, Nr        DO k = 1, Nr
284           CALL KPP_SMOOTH_HORIZ (           CALL KPP_SMOOTH_HORIZ (
285       I        k+1, bi, bj,       I        k+1, bi, bj,
286       U        dbloc (ibot,jbot,k) )       U        dbloc (1-OLx,1-OLy,k) )
287           CALL KPP_SMOOTH_HORIZ (           CALL KPP_SMOOTH_HORIZ (
288       I        k, bi, bj,       I        k, bi, bj,
289       U        Ritop (ibot,jbot,k)  )       U        Ritop (1-OLx,1-OLy,k)  )
290           CALL KPP_SMOOTH_HORIZ (           CALL KPP_SMOOTH_HORIZ (
291       I        k, bi, bj,       I        k, bi, bj,
292       U        TTALPHA(ibot,jbot,k) )       U        TTALPHA(1-OLx,1-OLy,k) )
293           CALL KPP_SMOOTH_HORIZ (           CALL KPP_SMOOTH_HORIZ (
294       I        k, bi, bj,       I        k, bi, bj,
295       U        SSBETA(ibot,jbot,k) )       U        SSBETA(1-OLx,1-OLy,k) )
296        ENDDO        ENDDO
297  #endif /* KPP_SMOOTH_DENS */  #endif /* KPP_SMOOTH_DENS */
298    
299        DO k = 1, Nr        DO k = 1, Nr
300           DO j = jbot, jtop           DO j = 1-OLy, sNy+OLy
301              DO i = ibot, itop              DO i = 1-OLx, sNx+OLx
302    
303  c     zero out dbloc over land points (so that the convective  c     zero out dbloc over land points (so that the convective
304  c     part of the interior mixing can be diagnosed)  c     part of the interior mixing can be diagnosed)
# Line 349  c     bosol = - g * alpha * Qsw * drF(1) Line 342  c     bosol = - g * alpha * Qsw * drF(1)
342  c------------------------------------------------------------------------  c------------------------------------------------------------------------
343    
344  c initialize arrays to zero  c initialize arrays to zero
345        DO j = jbot, jtop        DO j = 1-OLy, sNy+OLy
346           DO i = ibot, itop           DO i = 1-OLx, sNx+OLx
347              ustar(i,j) = p0              ustar(i,j) = p0
348              bo   (I,J) = p0              bo   (I,J) = p0
349              bosol(I,J) = p0              bosol(I,J) = p0
# Line 411  c--------------------------------------- Line 404  c---------------------------------------
404    
405  c initialize arrays to zero  c initialize arrays to zero
406        DO k = 1, Nr        DO k = 1, Nr
407           DO j = jbot, jtop           DO j = 1-OLy, sNy+OLy
408              DO i = ibot, itop              DO i = 1-OLx, sNx+OLx
409                 shsq(i,j,k) = p0                 shsq(i,j,k) = p0
410                 dVsq(i,j,k) = p0                 dVsq(i,j,k) = p0
411              END DO              END DO
# Line 647  c--------------------------------------- Line 640  c---------------------------------------
640  c     solve for viscosity, diffusivity, ghat, and hbl on "t-grid"  c     solve for viscosity, diffusivity, ghat, and hbl on "t-grid"
641  c-----------------------------------------------------------------------  c-----------------------------------------------------------------------
642    
643        DO j = jbot, jtop        DO j = 1-OLy, sNy+OLy
644           DO i = ibot, itop           DO i = 1-OLx, sNx+OLx
645              work1(i,j) = nzmax(i,j,bi,bj)              work1(i,j) = nzmax(i,j,bi,bj)
646              work2(i,j) = Fcori(i,j,bi,bj)              work2(i,j) = Fcori(i,j,bi,bj)
647           END DO           END DO
# Line 680  c--------------------------------------- Line 673  c---------------------------------------
673          KPPhbl(i,j,bi,bj) = hbl(i,j) * maskC(i,j,1,bi,bj)          KPPhbl(i,j,bi,bj) = hbl(i,j) * maskC(i,j,1,bi,bj)
674         END DO         END DO
675        END DO        END DO
 #ifdef FRUGAL_KPP  
       _EXCH_XYZ_R8(KPPviscAz  , myThid )  
       _EXCH_XYZ_R8(KPPdiffKzS , myThid )  
       _EXCH_XYZ_R8(KPPdiffKzT , myThid )  
       _EXCH_XYZ_R8(KPPghat    , myThid )  
       _EXCH_XY_R8 (KPPhbl     , myThid )  
 #endif  
676    
677  #ifdef KPP_SMOOTH_VISC  #ifdef KPP_SMOOTH_VISC
678  c     horizontal smoothing of vertical viscosity  c     horizontal smoothing of vertical viscosity

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.22