ldftra_c2d.h90 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. !!----------------------------------------------------------------------
  2. !! *** ldftra_c2d.h90 ***
  3. !!----------------------------------------------------------------------
  4. !!----------------------------------------------------------------------
  5. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  6. !! $Id: ldftra_c2d.h90 4147 2013-11-04 11:51:55Z cetlod $
  7. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  8. !!----------------------------------------------------------------------
  9. SUBROUTINE ldf_tra_c2d( ld_print )
  10. !!----------------------------------------------------------------------
  11. !! *** ROUTINE ldftra_c2d ***
  12. !!
  13. !! ** Purpose : initializations of horizontally non uniform eddy
  14. !! diffusivity coefficients
  15. !!
  16. !! ** Method :
  17. !! biharmonic operator : ahtt = defined at T-level
  18. !! ahtu,ahtv,ahtw never used
  19. !! harmonic operator (ahtt never used)
  20. !! iso-model level : ahtu, ahtv defined at u-, v-points
  21. !! isopycnal : ahtu, ahtv, ahtw defined at u-, v-, w-pts
  22. !! or geopotential
  23. !! eddy induced velocity
  24. !! always harmonic : aeiu, aeiv, aeiw defined at u-, v-, w-pts
  25. !!----------------------------------------------------------------------
  26. LOGICAL, INTENT (in) :: ld_print ! If true, print arrays in numout
  27. !
  28. INTEGER :: ji, jj ! dummy loop indices
  29. REAL(wp) :: za00, zd_max, zeumax, zevmax, zetmax
  30. !!----------------------------------------------------------------------
  31. IF( lk_traldf_eiv ) THEN
  32. IF(lwp) WRITE(numout,*)
  33. IF(lwp) WRITE(numout,*) ' ldf_tra_c2d : 2D eddy diffusivity and eddy'
  34. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~ -- induced velocity coefficients'
  35. ELSE
  36. IF(lwp) WRITE(numout,*)
  37. IF(lwp) WRITE(numout,*) ' ldf_tra2d : 2D eddy diffusivity coefficient'
  38. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~ --'
  39. ENDIF
  40. zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) )
  41. IF( lk_mpp ) CALL mpp_max( zd_max ) ! max over the global domain
  42. ! harmonic operator : (U-, V-, W-points)
  43. ! ==================
  44. IF( ln_traldf_lap ) THEN
  45. !
  46. za00 = aht0 / zd_max
  47. !
  48. DO jj = 1, jpj
  49. DO ji = 1, jpi
  50. zeumax = MAX( e1u(ji,jj), e2u(ji,jj) )
  51. zevmax = MAX( e1v(ji,jj), e2v(ji,jj) )
  52. zetmax = MAX( e1t(ji,jj), e2t(ji,jj) )
  53. ahtu(ji,jj) = za00 * zeumax ! set ahtu = ahtv at u- and v-points,
  54. ahtv(ji,jj) = za00 * zevmax ! and ahtw at w-point (idem T-point)
  55. ahtw(ji,jj) = za00 * zetmax !
  56. END DO
  57. END DO
  58. CALL lbc_lnk( ahtu, 'U', 1. ) ! Lateral boundary conditions
  59. CALL lbc_lnk( ahtv, 'V', 1. ) ! (no change of sign)
  60. CALL lbc_lnk( ahtw, 'W', 1. )
  61. ! Special case for ORCA R2 and R4 configurations (overwrite the value of ahtu ahtv ahtw)
  62. ! ==============================================
  63. IF( cp_cfg == "orca" .AND. ( jp_cfg == 2 .OR. jp_cfg == 4 ) ) THEN
  64. ahtu(:,:) = aht0 ! set ahtu = ahtv at u- and v-points,
  65. ahtv(:,:) = aht0 ! and ahtw at w-point
  66. ahtw(:,:) = aht0 ! (here : no space variation)
  67. IF(lwp) WRITE(numout,*) ' ORCA R2 or R4 case'
  68. IF(lwp) WRITE(numout,*) ' Constant values used for eddy diffusivity coefficients'
  69. IF(lwp) WRITE(numout,*) ' Variation lat/lon only for eddy induced velocity coefficients'
  70. ENDIF
  71. ! Control print
  72. IF( lwp .AND. ld_print ) THEN
  73. WRITE(numout,*)
  74. WRITE(numout,*) 'inildf: ahtu array'
  75. CALL prihre( ahtu, jpi, jpj, 1, jpi, 1, &
  76. & 1, jpj, 1, 1.e-3, numout )
  77. WRITE(numout,*)
  78. WRITE(numout,*) 'inildf: ahtv array'
  79. CALL prihre( ahtv, jpi, jpj, 1, jpi, 1, &
  80. & 1, jpj, 1, 1.e-3, numout )
  81. WRITE(numout,*)
  82. WRITE(numout,*) 'inildf: ahtw array'
  83. CALL prihre( ahtw, jpi, jpj, 1, jpi, 1, &
  84. & 1, jpj, 1, 1.e-3, numout )
  85. ENDIF
  86. ENDIF
  87. ! biharmonic operator : (T-point)
  88. ! ====================
  89. IF( ln_traldf_bilap ) THEN
  90. ! (USER: modify ahtt following your desiderata)
  91. ! Here: ahm is proportional to the cube of the maximum of the gridspacing
  92. ! in the to horizontal direction
  93. zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) )
  94. IF( lk_mpp ) CALL mpp_max( zd_max ) ! max over the global domain
  95. za00 = aht0 / ( zd_max * zd_max * zd_max )
  96. DO jj = 1, jpj
  97. DO ji = 1, jpi
  98. zetmax = MAX( e1t(ji,jj), e2t(ji,jj) )
  99. ahtt(ji,jj) = za00 * zetmax * zetmax * zetmax ! set ahtt at T-point
  100. END DO
  101. END DO
  102. CALL lbc_lnk( ahtt, 'T', 1. ) ! Lateral boundary conditions on ( ahtt )
  103. ! Control print
  104. IF( lwp .AND. ld_print ) THEN
  105. WRITE(numout,*)
  106. WRITE(numout,*) 'inildf: 2D ahtt array'
  107. CALL prihre( ahtt, jpi, jpj, 1, jpi, 1, &
  108. & 1, jpj, 1, 1.e-3, numout )
  109. ENDIF
  110. ENDIF
  111. # if defined key_traldf_eiv
  112. ! set aeiu = aeiv at u- and v-points, and aeiw at w-point (idem T-point)
  113. ! (here no space variation)
  114. aeiu(:,:) = aeiv0
  115. aeiv(:,:) = aeiv0
  116. aeiw(:,:) = aeiv0
  117. IF( cp_cfg == "orca" .AND. jp_cfg == 4 ) THEN
  118. ! ! Cancel eiv in Gibraltar strait
  119. aeiu( mi0(68):mi1(71) , mj0(50):mj1(53) ) = 0.e0
  120. aeiv( mi0(68):mi1(71) , mj0(50):mj1(53) ) = 0.e0
  121. aeiw( mi0(68):mi1(71) , mj0(50):mj1(53) ) = 0.e0
  122. ! ! Cancel eiv in Mediterrannean sea
  123. aeiu( mi0(70):mi1(90) , mj0(49):mj1(56) ) = 0.e0
  124. aeiv( mi0(70):mi1(90) , mj0(49):mj1(56) ) = 0.e0
  125. aeiw( mi0(70):mi1(90) , mj0(49):mj1(56) ) = 0.e0
  126. ENDIF
  127. ! Lateral boundary conditions on ( aeiu, aeiv, aeiw )
  128. CALL lbc_lnk( aeiu, 'U', 1. )
  129. CALL lbc_lnk( aeiv, 'V', 1. )
  130. CALL lbc_lnk( aeiw, 'W', 1. )
  131. ! Control print
  132. IF( lwp .AND. ld_print ) THEN
  133. WRITE(numout,*)
  134. WRITE(numout,*) 'inildf: aeiu array'
  135. CALL prihre(aeiu,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  136. WRITE(numout,*)
  137. WRITE(numout,*) 'inildf: aeiv array'
  138. CALL prihre(aeiv,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  139. WRITE(numout,*)
  140. WRITE(numout,*) 'inildf: aeiw array'
  141. CALL prihre(aeiw,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  142. ENDIF
  143. # endif
  144. !
  145. END SUBROUTINE ldf_tra_c2d