/[MITgcm]/MITgcm_contrib/atnguyen/code_21Dec2012_saltplume/kpp_calc.F
ViewVC logotype

Diff of /MITgcm_contrib/atnguyen/code_21Dec2012_saltplume/kpp_calc.F

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

revision 1.3 by atn, Tue Apr 29 07:26:42 2014 UTC revision 1.5 by atn, Thu May 1 21:30:48 2014 UTC
# Line 152  c     imin, imax, jmin, jmax  - array co Line 152  c     imin, imax, jmin, jmax  - array co
152    
153  c Local arrays and variables  c Local arrays and variables
154  c     work?  (nx,ny)       - horizontal working arrays  c     work?  (nx,ny)       - horizontal working arrays
155    c     temp?  (nx,ny,Nr)    - 3d working arrays
156  c     ustar  (nx,ny)       - surface friction velocity                  (m/s)  c     ustar  (nx,ny)       - surface friction velocity                  (m/s)
157  c     bo     (nx,ny)       - surface turbulent buoyancy forcing     (m^2/s^3)  c     bo     (nx,ny)       - surface turbulent buoyancy forcing     (m^2/s^3)
158  c     bosol  (nx,ny)       - surface radiative buoyancy forcing     (m^2/s^3)  c     bosol  (nx,ny)       - surface radiative buoyancy forcing     (m^2/s^3)
159  c     boplume(nx,ny)       - surface haline buoyancy forcing        (m^2/s^3)  c     boplume(nx,ny,Nr)    - surface haline buoyancy forcing        (m^2/s^3)
160  c     shsq   (nx,ny,Nr)    - local velocity shear squared  c     shsq   (nx,ny,Nr)    - local velocity shear squared
161  c                            at interfaces for ri_iwmix             (m^2/s^2)  c                            at interfaces for ri_iwmix             (m^2/s^2)
162  c     dVsq   (nx,ny,Nr)    - velocity shear re surface squared  c     dVsq   (nx,ny,Nr)    - velocity shear re surface squared
# Line 182  c     vRef   (nx,ny)       - Reference m Line 183  c     vRef   (nx,ny)       - Reference m
183        _RL bo    ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )        _RL bo    ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
184        _RL bosol ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )        _RL bosol ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy                )
185  #ifdef ALLOW_SALT_PLUME  #ifdef ALLOW_SALT_PLUME
186  #ifndef SALT_PLUME_VOLUME        _RL temp1   ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr          )
187        _RL boplume ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy              )        _RL temp2   ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr          )
188  #endif /* ndef SALT_PLUME_VOLUME */        _RL boplume ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr          )
189  #endif /* ALLOW_SALT_PLUME */  #endif /* ALLOW_SALT_PLUME */
190        _RL shsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )        _RL shsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
191        _RL dVsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )        _RL dVsq  ( 1-OLx:sNx+OLx, 1-OLy:sNy+OLy, Nr            )
# Line 396  c     dVsq in the subroutine that does t Line 397  c     dVsq in the subroutine that does t
397  c     (admittedly this is a bit messy)  c     (admittedly this is a bit messy)
398  c------------------------------------------------------------------------  c------------------------------------------------------------------------
399    
400    #ifdef ALLOW_SALT_PLUME
401          DO j=jMin,jMax
402           DO i=iMin,iMax
403    #ifndef SALT_PLUME_VOLUME
404            temp1(i,j,1) = saltPlumeFlux(i,j,bi,bj)
405            temp2(i,j,1) = 0. _d 0
406            DO k=2,Nr
407             temp1(i,j,k) = 0. _ 0
408             temp2(i,j,k) = 0. _ 0
409            ENDDO
410    #else /* def SALT_PLUME_VOLUME */
411            DO k=1,Nr
412             temp1(i,j,k) = SPforcingS(i,j,k,bi,bj)
413             temp2(i,j,k) = SPforcingT(i,j,k,bi,bj)
414            ENDDO
415    #endif /* SALT_PLUME_VOLUME */
416           ENDDO
417          ENDDO
418    #endif /* ALLOW_SALT_PLUME */
419    
420        CALL KPP_FORCING_SURF(        CALL KPP_FORCING_SURF(
421       I     work2, surfaceForcingU, surfaceForcingV,       I     work2, surfaceForcingU, surfaceForcingV,
422       I     surfaceForcingT, surfaceForcingS, surfaceForcingTice,       I     surfaceForcingT, surfaceForcingS, surfaceForcingTice,
423       I     Qsw,       I     Qsw,
424  #ifdef ALLOW_SALT_PLUME  #ifdef ALLOW_SALT_PLUME
425  #ifndef SALT_PLUME_VOLUME       I     temp1, temp2,
      I     saltPlumeFlux,  
 #endif /* SALT_PLUME_VOLUME */  
426  #endif /* ALLOW_SALT_PLUME */  #endif /* ALLOW_SALT_PLUME */
427       I     ttalpha, ssbeta,       I     ttalpha, ssbeta,
428       O     ustar, bo, bosol,       O     ustar, bo, bosol,
429  #ifdef ALLOW_SALT_PLUME  #ifdef ALLOW_SALT_PLUME
 #ifndef SALT_PLUME_VOLUME  
430       O     boplume,       O     boplume,
 #endif /* SALT_PLUME_VOLUME */  
431  #endif /* ALLOW_SALT_PLUME */  #endif /* ALLOW_SALT_PLUME */
432       O     dVsq,       O     dVsq,
433       I     ikppkey, iMin, iMax, jMin, jMax, bi, bj, myTime, myThid )       I     ikppkey, iMin, iMax, jMin, jMax, bi, bj, myTime, myThid )
# Line 516  C     and salt are not passed to kppmix Line 533  C     and salt are not passed to kppmix
533       I     , maskC(1-Olx,1-Oly,1,bi,bj)       I     , maskC(1-Olx,1-Oly,1,bi,bj)
534       I     , bo, bosol       I     , bo, bosol
535  #ifdef ALLOW_SALT_PLUME  #ifdef ALLOW_SALT_PLUME
 #ifndef SALT_PLUME_VOLUME  
536       I     , boplume, SaltPlumeDepth(1-Olx,1-Oly,bi,bj)       I     , boplume, SaltPlumeDepth(1-Olx,1-Oly,bi,bj)
 #endif /* SALT_PLUME_VOLUME */  
537  #endif /* ALLOW_SALT_PLUME */  #endif /* ALLOW_SALT_PLUME */
538       I     , dbloc, Ritop, work2       I     , dbloc, Ritop, work2
539       I     , KPPdiffKzS(1-Olx,1-Oly,1,bi,bj)       I     , KPPdiffKzS(1-Olx,1-Oly,1,bi,bj)
# Line 604  C     the bottom of the mixing layer. Line 619  C     the bottom of the mixing layer.
619        ENDDO        ENDDO
620    
621  #ifdef ALLOW_SALT_PLUME  #ifdef ALLOW_SALT_PLUME
 #ifndef SALT_PLUME_VOLUME  
622  C     Compute fraction of saltplume (flux) penetrating to  C     Compute fraction of saltplume (flux) penetrating to
623  C     the bottom of the mixing layer.  C     the bottom of the mixing layer.
624        IF ( useSALT_PLUME ) THEN        IF ( useSALT_PLUME ) THEN
# Line 614  C     the bottom of the mixing layer. Line 628  C     the bottom of the mixing layer.
628                worka(i,j) = KPPhbl(i,j,bi,bj)                worka(i,j) = KPPhbl(i,j,bi,bj)
629             ENDDO             ENDDO
630          ENDDO          ENDDO
631    #ifndef SALT_PLUME_VOLUME
632          CALL SALT_PLUME_FRAC(          CALL SALT_PLUME_FRAC(
633       I       (sNx+2*OLx)*(sNy+2*OLy), minusone, work2,       I       (sNx+2*OLx)*(sNy+2*OLy), minusone, work2,
634       U       worka,       U       worka,
# Line 623  C     the bottom of the mixing layer. Line 638  C     the bottom of the mixing layer.
638                KPPplumefrac(i,j,bi,bj) = 1. _d 0 - worka(i,j)                KPPplumefrac(i,j,bi,bj) = 1. _d 0 - worka(i,j)
639             ENDDO             ENDDO
640          ENDDO          ENDDO
641        ENDIF  #else
642    Catn if decide to include in non-local transport, need to rethink
643    C    how to do. For now, set to zero.
644            DO j=1-OLy,sNy+OLy
645             DO i=1-OLx,sNx+OLx
646    C          DO k=1,Nr
647    C           IF(worka(i,j).LT.rF(k) .AND. work2(i,j).GE.rF(k)) THEN
648    Catn:this is wrong KPPplumefrac(i,j,bi,bj) = SPplumek(i,j,k,bi,bj)
649                KPPplumefrac(i,j,bi,bj) = 0. _d 0
650    C           ENDIF
651    C          ENDDO
652             ENDDO
653            ENDDO
654  #endif /* ndef SALT_PLUME_VOLUME */  #endif /* ndef SALT_PLUME_VOLUME */
655          ENDIF
656  #endif /* ALLOW_SALT_PLUME */  #endif /* ALLOW_SALT_PLUME */
657    
658        ENDIF        ENDIF

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22