zdfevd.F90 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. MODULE zdfevd
  2. !!======================================================================
  3. !! *** MODULE zdfevd ***
  4. !! Ocean physics: parameterization of convection through an enhancement
  5. !! of vertical eddy mixing coefficient
  6. !!======================================================================
  7. !! History : OPA ! 1997-06 (G. Madec, A. Lazar) Original code
  8. !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module
  9. !! - ! 2005-06 (C. Ethe) KPP parameterization
  10. !! 3.2 ! 2009-03 (M. Leclair, G. Madec, R. Benshila) test on both before & after
  11. !!----------------------------------------------------------------------
  12. !!----------------------------------------------------------------------
  13. !! zdf_evd : increase the momentum and tracer Kz at the location of
  14. !! statically unstable portion of the water column (ln_zdfevd=T)
  15. !!----------------------------------------------------------------------
  16. USE oce ! ocean dynamics and tracers variables
  17. USE dom_oce ! ocean space and time domain variables
  18. USE zdf_oce ! ocean vertical physics variables
  19. USE zdfkpp ! KPP vertical mixing
  20. USE trd_oce ! trends: ocean variables
  21. USE trdtra ! trends manager: tracers
  22. USE in_out_manager ! I/O manager
  23. USE iom ! for iom_put
  24. USE lbclnk ! ocean lateral boundary conditions (or mpp link)
  25. USE timing ! Timing
  26. IMPLICIT NONE
  27. PRIVATE
  28. PUBLIC zdf_evd ! called by step.F90
  29. !! * Substitutions
  30. # include "domzgr_substitute.h90"
  31. !!----------------------------------------------------------------------
  32. !! NEMO/OPA 4.0 , NEMO Consortium (2011)
  33. !! $Id: zdfevd.F90 4990 2014-12-15 16:42:49Z timgraham $
  34. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  35. !!----------------------------------------------------------------------
  36. CONTAINS
  37. SUBROUTINE zdf_evd( kt )
  38. !!----------------------------------------------------------------------
  39. !! *** ROUTINE zdf_evd ***
  40. !!
  41. !! ** Purpose : Local increased the vertical eddy viscosity and diffu-
  42. !! sivity coefficients when a static instability is encountered.
  43. !!
  44. !! ** Method : avt, avm, and the 4 neighbouring avmu, avmv coefficients
  45. !! are set to avevd (namelist parameter) if the water column is
  46. !! statically unstable (i.e. if rn2 < -1.e-12 )
  47. !!
  48. !! ** Action : avt, avm, avmu, avmv updted in static instability cases
  49. !!
  50. !! References : Lazar, A., these de l'universite Paris VI, France, 1997
  51. !!----------------------------------------------------------------------
  52. USE oce, zavt_evd => ua , zavm_evd => va ! (ua,va) used ua workspace
  53. !
  54. INTEGER, INTENT( in ) :: kt ! ocean time-step indexocean time step
  55. !
  56. INTEGER :: ji, jj, jk ! dummy loop indices
  57. !!----------------------------------------------------------------------
  58. !
  59. IF( nn_timing == 1 ) CALL timing_start('zdf_evd')
  60. !
  61. IF( kt == nit000 ) THEN
  62. IF(lwp) WRITE(numout,*)
  63. IF(lwp) WRITE(numout,*) 'zdf_evd : Enhanced Vertical Diffusion (evd)'
  64. IF(lwp) WRITE(numout,*) '~~~~~~~ '
  65. IF(lwp) WRITE(numout,*)
  66. ENDIF
  67. zavt_evd(:,:,:) = avt(:,:,:) ! set avt prior to evd application
  68. SELECT CASE ( nn_evdm )
  69. !
  70. CASE ( 1 ) ! enhance vertical eddy viscosity and diffusivity (if rn2<-1.e-12)
  71. !
  72. zavm_evd(:,:,:) = avm(:,:,:) ! set avm prior to evd application
  73. !
  74. DO jk = 1, jpkm1
  75. DO jj = 2, jpj ! no vector opt.
  76. DO ji = 2, jpi
  77. #if defined key_zdfkpp
  78. ! no evd mixing in the boundary layer with KPP
  79. IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 .AND. fsdepw(ji,jj,jk) > hkpp(ji,jj) ) THEN
  80. #else
  81. IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) THEN
  82. #endif
  83. avt (ji ,jj ,jk) = rn_avevd * tmask(ji ,jj ,jk)
  84. avm (ji ,jj ,jk) = rn_avevd * tmask(ji ,jj ,jk)
  85. avmu(ji ,jj ,jk) = rn_avevd * umask(ji ,jj ,jk)
  86. avmu(ji-1,jj ,jk) = rn_avevd * umask(ji-1,jj ,jk)
  87. avmv(ji ,jj ,jk) = rn_avevd * vmask(ji ,jj ,jk)
  88. avmv(ji ,jj-1,jk) = rn_avevd * vmask(ji ,jj-1,jk)
  89. ENDIF
  90. END DO
  91. END DO
  92. END DO
  93. CALL lbc_lnk( avt , 'W', 1. ) ; CALL lbc_lnk( avm , 'W', 1. ) ! Lateral boundary conditions
  94. CALL lbc_lnk( avmu, 'U', 1. ) ; CALL lbc_lnk( avmv, 'V', 1. )
  95. !
  96. zavm_evd(:,:,:) = avm(:,:,:) - zavm_evd(:,:,:) ! change in avm due to evd
  97. CALL iom_put( "avm_evd", zavm_evd ) ! output this change
  98. !
  99. CASE DEFAULT ! enhance vertical eddy diffusivity only (if rn2<-1.e-12)
  100. DO jk = 1, jpkm1
  101. !!! WHERE( rn2(:,:,jk) <= -1.e-12 ) avt(:,:,jk) = tmask(:,:,jk) * avevd ! agissant sur T SEUL!
  102. DO jj = 1, jpj ! loop over the whole domain (no lbc_lnk call)
  103. DO ji = 1, jpi
  104. #if defined key_zdfkpp
  105. ! no evd mixing in the boundary layer with KPP
  106. IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 .AND. fsdepw(ji,jj,jk) > hkpp(ji,jj) ) &
  107. #else
  108. IF( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) &
  109. #endif
  110. avt(ji,jj,jk) = rn_avevd * tmask(ji,jj,jk)
  111. END DO
  112. END DO
  113. END DO
  114. !
  115. END SELECT
  116. zavt_evd(:,:,:) = avt(:,:,:) - zavt_evd(:,:,:) ! change in avt due to evd
  117. CALL iom_put( "avt_evd", zavt_evd ) ! output this change
  118. IF( l_trdtra ) CALL trd_tra( kt, 'TRA', jp_tem, jptra_evd, zavt_evd )
  119. !
  120. IF( nn_timing == 1 ) CALL timing_stop('zdf_evd')
  121. !
  122. END SUBROUTINE zdf_evd
  123. !!======================================================================
  124. END MODULE zdfevd