ldftra_c1d.h90 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. !!----------------------------------------------------------------------
  2. !! *** ldftra_c1d.h90 ***
  3. !!----------------------------------------------------------------------
  4. !!----------------------------------------------------------------------
  5. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  6. !! $Id: ldftra_c1d.h90 2715 2011-03-30 15:58:35Z rblod $
  7. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  8. !!----------------------------------------------------------------------
  9. SUBROUTINE ldf_tra_c1d( ld_print )
  10. !!----------------------------------------------------------------------
  11. !! *** ROUTINE ldftra_c1d ***
  12. !!
  13. !! ** Purpose : 1D eddy diffusivity coefficient
  14. !!
  15. !! ** Method : 1D eddy diffusivity coefficients ( depth )
  16. !! biharmonic operator : ahtt = defined at T-level
  17. !! ahtu,ahtv,ahtw never used
  18. !!
  19. !! harmonic operator : ahtt never used
  20. !! -1- iso-model level: ahtu = ahtv defined at T-level
  21. !! ahtw never used
  22. !! -2- isopycnal or : ahtu = ahtv defined at T-level
  23. !! geopotential ahtw defined at w-level
  24. !!
  25. !! eddy induced velocity
  26. !! always harmonic : aeiu = aeiv defined at T-level
  27. !! aeiw defined at w-level
  28. !!----------------------------------------------------------------------
  29. LOGICAL, INTENT (in) :: ld_print ! If true, print arrays in numout
  30. !
  31. INTEGER :: jk ! dummy loop indices
  32. REAL(wp) :: zkah, zahr, za00 , za01 ! local scalars
  33. REAL(wp) :: zahf, zahs, zahtf, zahts ! - -
  34. !!----------------------------------------------------------------------
  35. IF( lk_traldf_eiv ) THEN
  36. IF(lwp) WRITE(numout,*)
  37. IF(lwp) WRITE(numout,*) ' ldf_tra_c1d : 1D eddy diffusivity and eddy induced velocity coefficients'
  38. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~ -- '
  39. IF(lwp) WRITE(numout,*)
  40. ELSE
  41. IF(lwp) WRITE(numout,*)
  42. IF(lwp) WRITE(numout,*) ' inildf : 1D eddy diffusivity coefficient '
  43. IF(lwp) WRITE(numout,*) ' ~~~~~~ -- '
  44. IF(lwp) WRITE(numout,*)
  45. ENDIF
  46. ! initialization of the profile
  47. ! ahts, ahtf: surface and bottom values
  48. zahts = aht0
  49. zahtf = aht0/4.
  50. ! zkah, zahr: depth of the inflection pt and width of inflection
  51. zkah = -300.
  52. zahr = 300.
  53. ! computation coefficients
  54. za00 = TANH( ( -fsdept(1,1,1 ) - zkah ) / zahr )
  55. za01 = TANH( ( -fsdept(1,1,jpk) - zkah ) / zahr )
  56. zahf = ( zahts-zahtf ) / ( za00 - za01 )
  57. zahs = zahts - zahf * za00
  58. ! biharmonic operator : (T-point)
  59. ! ====================
  60. ! set ahtt at T-level
  61. DO jk = 1, jpk
  62. ahtt(jk) = zahs + zahf * TANH( (-fsdept(1,1,jk)-zkah) / zahr )
  63. END DO
  64. ! control print
  65. IF(lwp .AND. ld_print ) THEN
  66. WRITE(numout,*)
  67. WRITE(numout,*) ' aht profile at T-level : '
  68. WRITE(numout,*)
  69. WRITE(numout,*) ' level aht depth t-level '
  70. DO jk = 1, jpk
  71. WRITE(numout,'(i6,2f12.4)') jk, ahtt(jk), fsdept(1,1,jk)
  72. END DO
  73. ENDIF
  74. ! harmonic operator : (U-, V-, W-points)
  75. ! ==================
  76. ! set ahtu = ahtv at T-level, and ahtw at w-level
  77. DO jk = 1, jpk
  78. ahtu(jk) = zahs + zahf * TANH( ( -fsdept(1,1,jk) - zkah ) / zahr )
  79. ahtv(jk) = ahtu(jk)
  80. ahtw(jk) = zahs + zahf * TANH( ( -fsdepw(1,1,jk) - zkah ) / zahr )
  81. END DO
  82. ! control print
  83. IF(lwp .AND. ld_print ) THEN
  84. IF(lwp) WRITE(numout,*)
  85. IF(lwp) WRITE(numout,*) ' aht profile at T-level : '
  86. IF(lwp) WRITE(numout,*)
  87. IF(lwp) WRITE(numout,*) ' level aht depth t-level '
  88. DO jk = 1, jpk
  89. IF(lwp) WRITE(numout,"(i6,2f12.4)") jk, ahtu(jk), fsdept(1,1,jk)
  90. END DO
  91. IF(lwp) WRITE(numout,*)
  92. IF(lwp) WRITE(numout,*) ' aht profile at W-level : '
  93. IF(lwp) WRITE(numout,*)
  94. IF(lwp) WRITE(numout,*) ' jk aht depth w-level '
  95. DO jk = 1, jpk
  96. IF(lwp)WRITE(numout,"(i6,2f12.4)") jk, ahtw(jk), fsdepw(1,1,jk)
  97. END DO
  98. ENDIF
  99. # if defined key_traldf_eiv
  100. ! set aeiu = aeiv and set aeiw (here same profile as on aht)
  101. aeiu(:) = ahtu(:)
  102. aeiv(:) = aeiu(:)
  103. aeiw(:) = ahtw(:)
  104. ! Control print
  105. IF(lwp .AND. ld_print ) THEN
  106. IF(lwp) WRITE(numout,*)
  107. IF(lwp) WRITE(numout,*) ' aeiv profile at T-level : '
  108. IF(lwp) WRITE(numout,*)
  109. IF(lwp) WRITE(numout,*) ' jk aeiv depth t-level '
  110. DO jk = 1, jpk
  111. IF(lwp) WRITE(numout,"(i6,2f12.4)") jk, aeiu(jk), fsdept(1,1,jk)
  112. END DO
  113. ENDIF
  114. #endif
  115. !
  116. END SUBROUTINE ldf_tra_c1d