trcbbl.F90 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. MODULE trcbbl
  2. !!======================================================================
  3. !! *** MODULE trcbbl ***
  4. !! Ocean passive tracers physics : advective and/or diffusive bottom boundary
  5. !! layer scheme
  6. !!======================================================================
  7. !!==============================================================================
  8. !! History : OPA ! 1996-06 (L. Mortier) Original code
  9. !! 8.0 ! 1997-11 (G. Madec) Optimization
  10. !! NEMO 1.0 ! 2002-08 (G. Madec) free form + modules
  11. !! - ! 2004-01 (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl
  12. !! 3.3 ! 2009-11 (G. Madec) merge trabbl and trabbl_adv + style + optimization
  13. !! - ! 2010-04 (G. Madec) Campin & Goosse advective bbl
  14. !! - ! 2010-06 (C. Ethe, G. Madec) merge TRA-TRC
  15. !!----------------------------------------------------------------------
  16. #if defined key_top && defined key_trabbl
  17. !!----------------------------------------------------------------------
  18. !! 'key_trabbl diffusive or/and adevective bottom boundary layer
  19. !!----------------------------------------------------------------------
  20. !! trc_bbl : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
  21. !!----------------------------------------------------------------------
  22. USE oce_trc ! ocean dynamics and active tracers variables
  23. USE trc ! ocean passive tracers variables
  24. USE trcnam_trp ! passive tracers transport namelist variables
  25. USE trabbl !
  26. USE prtctl_trc ! Print control for debbuging
  27. USE trd_oce
  28. USE trdtra
  29. PUBLIC trc_bbl ! routine called by step.F90
  30. !! * Substitutions
  31. # include "top_substitute.h90"
  32. !!----------------------------------------------------------------------
  33. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  34. !! $Id: trcbbl.F90 4990 2014-12-15 16:42:49Z timgraham $
  35. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  36. !!----------------------------------------------------------------------
  37. CONTAINS
  38. SUBROUTINE trc_bbl( kt )
  39. !!----------------------------------------------------------------------
  40. !! *** ROUTINE bbl ***
  41. !!
  42. !! ** Purpose : Compute the before tracer (t & s) trend associated
  43. !! with the bottom boundary layer and add it to the general trend
  44. !! of tracer equations.
  45. !!
  46. !!----------------------------------------------------------------------
  47. INTEGER, INTENT( in ) :: kt ! ocean time-step
  48. CHARACTER (len=22) :: charout
  49. REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd
  50. !!----------------------------------------------------------------------
  51. !
  52. IF( nn_timing == 1 ) CALL timing_start('trc_bbl')
  53. !
  54. IF( .NOT. lk_offline .AND. nn_dttrc == 1 ) THEN
  55. CALL bbl( kt, nittrc000, 'TRC' ) ! Online coupling with dynamics : Computation of bbl coef and bbl transport
  56. l_bbl = .FALSE. ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files
  57. ENDIF
  58. IF( l_trdtrc ) THEN
  59. CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
  60. ztrtrd(:,:,:,:) = tra(:,:,:,:)
  61. ENDIF
  62. !* Diffusive bbl :
  63. IF( nn_bbl_ldf == 1 ) THEN
  64. !
  65. CALL tra_bbl_dif( trb, tra, jptra )
  66. IF( ln_ctl ) THEN
  67. WRITE(charout, FMT="(' bbl_dif')") ; CALL prt_ctl_trc_info(charout)
  68. CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
  69. ENDIF
  70. !
  71. END IF
  72. !* Advective bbl : bbl upstream advective trends added to the tracer trends
  73. IF( nn_bbl_adv /= 0 ) THEN
  74. !
  75. CALL tra_bbl_adv( trb, tra, jptra )
  76. IF( ln_ctl ) THEN
  77. WRITE(charout, FMT="(' bbl_adv')") ; CALL prt_ctl_trc_info(charout)
  78. CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
  79. ENDIF
  80. !
  81. END IF
  82. IF( l_trdtrc ) THEN ! save the horizontal diffusive trends for further diagnostics
  83. DO jn = 1, jptra
  84. ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn)
  85. CALL trd_tra( kt, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
  86. END DO
  87. CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
  88. ENDIF
  89. !
  90. IF( nn_timing == 1 ) CALL timing_stop('trc_bbl')
  91. !
  92. END SUBROUTINE trc_bbl
  93. #else
  94. !!----------------------------------------------------------------------
  95. !! Dummy module : No bottom boundary layer scheme
  96. !!----------------------------------------------------------------------
  97. CONTAINS
  98. SUBROUTINE trc_bbl( kt ) ! Empty routine
  99. WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt
  100. END SUBROUTINE trc_bbl
  101. #endif
  102. !!======================================================================
  103. END MODULE trcbbl