trctrp.F90 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. MODULE trctrp
  2. !!======================================================================
  3. !! *** MODULE trctrp ***
  4. !! Ocean Physics : manage the passive tracer transport
  5. !!======================================================================
  6. !! History : 1.0 ! 2004-03 (C. Ethe) Original code
  7. !! 3.3 ! 2010-07 (C. Ethe) Merge TRA-TRC
  8. !!----------------------------------------------------------------------
  9. #if defined key_top
  10. !!----------------------------------------------------------------------
  11. !! 'key_top' TOP models
  12. !!----------------------------------------------------------------------
  13. !! trc_trp : passive tracer transport
  14. !!----------------------------------------------------------------------
  15. USE oce_trc ! ocean dynamics and active tracers variables
  16. USE trc ! ocean passive tracers variables
  17. USE trcnam_trp ! passive tracers transport namelist variables
  18. USE trabbl ! bottom boundary layer (trc_bbl routine)
  19. USE trcbbl ! bottom boundary layer (trc_bbl routine)
  20. USE zdfkpp ! KPP non-local tracer fluxes (trc_kpp routine)
  21. USE trcdmp ! internal damping (trc_dmp routine)
  22. USE trcldf ! lateral mixing (trc_ldf routine)
  23. USE trcadv ! advection (trc_adv routine)
  24. USE trczdf ! vertical diffusion (trc_zdf routine)
  25. USE trcnxt ! time-stepping (trc_nxt routine)
  26. USE trcrad ! positivity (trc_rad routine)
  27. USE trcsbc ! surface boundary condition (trc_sbc routine)
  28. USE zpshde ! partial step: hor. derivative (zps_hde routine)
  29. #if defined key_agrif
  30. USE agrif_top_sponge ! tracers sponges
  31. USE agrif_top_update ! tracers updates
  32. #endif
  33. IMPLICIT NONE
  34. PRIVATE
  35. PUBLIC trc_trp ! called by trc_stp
  36. !! * Substitutions
  37. # include "top_substitute.h90"
  38. !!----------------------------------------------------------------------
  39. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  40. !! $Id: trctrp.F90 4990 2014-12-15 16:42:49Z timgraham $
  41. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  42. !!----------------------------------------------------------------------
  43. CONTAINS
  44. SUBROUTINE trc_trp( kstp )
  45. !!----------------------------------------------------------------------
  46. !! *** ROUTINE trc_trp ***
  47. !!
  48. !! ** Purpose : Management of passive tracers transport
  49. !!
  50. !! ** Method : - Compute the passive tracers trends
  51. !! - Update the passive tracers
  52. !!----------------------------------------------------------------------
  53. INTEGER, INTENT( in ) :: kstp ! ocean time-step index
  54. !! ---------------------------------------------------------------------
  55. !
  56. IF( nn_timing == 1 ) CALL timing_start('trc_trp')
  57. !
  58. IF( .NOT. lk_c1d ) THEN
  59. !
  60. CALL trc_sbc( kstp ) ! surface boundary condition
  61. IF( lk_trabbl ) CALL trc_bbl( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme
  62. IF( ln_trcdmp ) CALL trc_dmp( kstp ) ! internal damping trends
  63. CALL trc_adv( kstp ) ! horizontal & vertical advection
  64. IF( ln_zps ) THEN
  65. IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kstp, jptra, trb, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi ) ! both top & bottom
  66. ELSE ; CALL zps_hde ( kstp, jptra, trb, gtru, gtrv ) ! only bottom
  67. ENDIF
  68. ENDIF
  69. CALL trc_ldf( kstp ) ! lateral mixing
  70. IF( .NOT. lk_offline .AND. lk_zdfkpp ) &
  71. & CALL trc_kpp( kstp ) ! KPP non-local tracer fluxes
  72. #if defined key_agrif
  73. IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc ! tracers sponge
  74. #endif
  75. CALL trc_zdf( kstp ) ! vertical mixing and after tracer fields
  76. !
  77. CALL trc_nxt( kstp ) ! tracer fields at next time step
  78. IF( ln_trcrad ) CALL trc_rad( kstp ) ! Correct artificial negative concentrations
  79. IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kstp ) ! internal damping trends on closed seas only
  80. #if defined key_agrif
  81. IF( .NOT. Agrif_Root()) CALL Agrif_Update_Trc( kstp ) ! Update tracer at AGRIF zoom boundaries : children only
  82. #endif
  83. ELSE ! 1D vertical configuration
  84. CALL trc_sbc( kstp ) ! surface boundary condition
  85. IF( .NOT. lk_offline .AND. lk_zdfkpp ) &
  86. & CALL trc_kpp( kstp ) ! KPP non-local tracer fluxes
  87. CALL trc_zdf( kstp ) ! vertical mixing and after tracer fields
  88. CALL trc_nxt( kstp ) ! tracer fields at next time step
  89. IF( ln_trcrad ) CALL trc_rad( kstp ) ! Correct artificial negative concentrations
  90. !
  91. END IF
  92. !
  93. IF( nn_timing == 1 ) CALL timing_stop('trc_trp')
  94. !
  95. 9400 FORMAT(a25,i4,D23.16)
  96. !
  97. END SUBROUTINE trc_trp
  98. #else
  99. !!----------------------------------------------------------------------
  100. !! Dummy module : No TOP models
  101. !!----------------------------------------------------------------------
  102. CONTAINS
  103. SUBROUTINE trc_trp( kstp ) ! Empty routine
  104. INTEGER, INTENT(in) :: kstp
  105. WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
  106. END SUBROUTINE trc_trp
  107. #endif
  108. !!======================================================================
  109. END MODULE trctrp