ldfdyn_c1d.h90 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. !!----------------------------------------------------------------------
  2. !! *** ldfdyn_c1d.h90 ***
  3. !!----------------------------------------------------------------------
  4. !!----------------------------------------------------------------------
  5. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  6. !! $Id: ldfdyn_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_dyn_c1d( ld_print )
  10. !!----------------------------------------------------------------------
  11. !! *** ROUTINE ldf_dyn_c1d ***
  12. !!
  13. !! ** Purpose : initializations of the horizontal ocean physics
  14. !!
  15. !! ** Method : 1D eddy viscosity coefficients ( depth )
  16. !! ahm3, ahm4 never used
  17. !! harmonic operator : ahm1 defined at T-level
  18. !! biharmonic operator : ahm2 defined at T-level
  19. !! isopycnal or geopotential harmonic operator
  20. !! : ahm1 defined at T-level
  21. !! : ahm2 defined at w-level
  22. !!
  23. !!----------------------------------------------------------------------
  24. LOGICAL, INTENT(in) :: ld_print ! If true, output arrays on numout
  25. !
  26. INTEGER :: jk ! dummy loop indice
  27. REAL(wp) :: zdam, zwam, zm00, zm01, zmhf, zmhs
  28. REAL(wp) :: zdam2, zwam2, zm200, zm201, zmh2f, zmh2s
  29. REAL(wp) :: zahmf, zahms
  30. !!----------------------------------------------------------------------
  31. IF(lwp) WRITE(numout,*)
  32. IF(lwp) WRITE(numout,*) 'inildf: 1D eddy viscosity coefficient'
  33. IF(lwp) WRITE(numout,*) '~~~~~~ --'
  34. ! Set ahm1 for laplacian (always at t-level)
  35. ! =============
  36. ! (USER: modify ahm1 following your desiderata)
  37. ! initialization of the profile
  38. ! ahms, ahmf: surface and bottom values
  39. zahms = ahm0
  40. zahmf = ahm0/4.
  41. ! zdam, zwam: depth of the inflection pt and width of inflection
  42. zdam = -300.
  43. zwam = 300.
  44. ! computation coefficients
  45. zm00 = TANH( (0-zdam)/zwam )
  46. zm01 = TANH( (-fsdept(1,1,jpk)-zdam)/zwam )
  47. zmhf = (zahms-zahmf)/(zm00-zm01)
  48. zmhs = zahms-zmhf * zm00
  49. ! Set ahm2 for bilaplacian (always at t-level)
  50. ! =============
  51. ! (USER: modify ahm2 following your desiderata)
  52. ! initialization of the profile
  53. ! ahms, ahmf: surface and bottom values
  54. zahm2s = ahm0_blp
  55. zahm2f = ahm0_blp/4.
  56. ! zdam, zwam: depth of the inflection pt and width of inflection
  57. zdam2 = -300.
  58. zwam2 = 300.
  59. ! computation coefficients
  60. zm200 = TANH( (0-zdam2)/zwam2 )
  61. zm201 = TANH( (-fsdept(1,1,jpk)-zdam2)/zwam2 )
  62. zmh2f = (zahm2s-zahm2f)/(zm200-zm201)
  63. zmh2s = zahm2s-zmh2f * zm00
  64. ! set ahm1 and ahm2 at T-level
  65. DO jk = 1, jpk
  66. ahm1(jk) = zmhs + zmhf * TANH( (-fsdept(1,1,jk)-zdam ) / zwam )
  67. ahm2(jk) = zmh2s + zmh2f * TANH( (-fsdept(1,1,jk)-zdam2) / zwam2 )
  68. END DO
  69. ! Control print
  70. IF(lwp .AND. ld_print ) THEN
  71. WRITE(numout,*)
  72. WRITE(numout,*) ' ahm profile (laplacian): '
  73. WRITE(numout,*)
  74. WRITE(numout,9100)
  75. DO jk = 1, jpk
  76. WRITE(numout,9110) jk, ahm1(jk), fsdept(1,1,jk)
  77. END DO
  78. WRITE(numout,*)
  79. WRITE(numout,*) ' ahm profile (bilaplacian): '
  80. WRITE(numout,*)
  81. WRITE(numout,9100)
  82. DO jk = 1, jpk
  83. WRITE(numout,9110) jk, ahm2(jk), fsdept(1,1,jk)
  84. END DO
  85. ENDIF
  86. 9100 FORMAT(' jk ahm ',' depth t-level ' )
  87. 9110 FORMAT(i6,2f12.4,3x,2f12.4)
  88. ! Set ahm3=ahm4 (always defined at w-level)
  89. ! =============
  90. ! define ahm3 from the same vertical profile used for ahm4
  91. ! (always defined at w-level)
  92. ! (USER: modify ahm1 following your desiderata)
  93. DO jk = 1, jpk
  94. ahm3(jk) = zmhs + zmhf * TANH( (-fsdepw(1,1,jk)-zdam) / zwam )
  95. ahm4(jk) = ahm3(jk)
  96. END DO
  97. ! Control print
  98. IF(lwp .AND. ld_print ) THEN
  99. WRITE(numout,*)
  100. WRITE(numout,*) ' ahm3=ahm4 profile : '
  101. WRITE(numout,*)
  102. WRITE(numout,9120)
  103. DO jk = 1, jpk
  104. WRITE(numout,9110) jk, ahm3(jk), fsdepw(1,1,jk)
  105. END DO
  106. ENDIF
  107. 9120 FORMAT(' jk ahm ',' depth w-level ' )
  108. !
  109. END SUBROUTINE ldf_dyn_c1d