trdtrc.F90 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. MODULE trdtrc
  2. !!======================================================================
  3. !! *** MODULE trdtrc ***
  4. !! Ocean diagnostics: mixed layer passive tracer trends
  5. !!======================================================================
  6. !! History : 3.0 ! 2010-07 (C. Ethe) Original code (from trdtrc.F90)
  7. !!----------------------------------------------------------------------
  8. #if defined key_top && ( defined key_trdmxl_trc || defined key_trdtrc )
  9. !!----------------------------------------------------------------------
  10. !! 'key_trdmxl_trc' mixed layer trend diagnostics
  11. !! 'key_trdtrc' 3D trend diagnostics
  12. !!----------------------------------------------------------------------
  13. !! trdtrc : passive tracer trends
  14. !!----------------------------------------------------------------------
  15. USE trc ! tracer definitions (trn, trb, tra, etc.)
  16. USE trcnam_trp
  17. USE trd_oce
  18. USE trdtrc_oce ! definition of main arrays used for trends computations
  19. USE trdmxl_trc ! Mixed layer trends diag.
  20. USE iom ! I/O library
  21. IMPLICIT NONE
  22. PRIVATE
  23. INTERFACE trd_trc
  24. MODULE PROCEDURE trd_trc_trp, trd_trc_bio
  25. END INTERFACE
  26. PUBLIC trd_trc
  27. !! * Substitutions
  28. # include "top_substitute.h90"
  29. !!----------------------------------------------------------------------
  30. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  31. !! $Id: trdtrc.F90 2355 2015-05-20 07:11:50Z ufla $
  32. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  33. !!----------------------------------------------------------------------
  34. CONTAINS
  35. SUBROUTINE trd_trc_trp( ptrtrd, kjn, ktrd, kt )
  36. !!----------------------------------------------------------------------
  37. !! *** ROUTINE trd_trc ***
  38. !!----------------------------------------------------------------------
  39. INTEGER, INTENT( in ) :: kt ! time step
  40. INTEGER, INTENT( in ) :: kjn ! tracer index
  41. INTEGER, INTENT( in ) :: ktrd ! tracer trend index
  42. REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrtrd ! Temperature or U trend
  43. CHARACTER (len=20) :: cltra
  44. !!----------------------------------------------------------------------
  45. IF( kt == nittrc000 ) THEN
  46. ! IF(lwp)WRITE(numout,*)
  47. ! IF(lwp)WRITE(numout,*) 'trd_trc:'
  48. ! IF(lwp)WRITE(numout,*) '~~~~~~~~~~~~'
  49. ENDIF
  50. !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  51. ! Mixed layer trends for passive tracers
  52. !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  53. #if defined key_trdmxl_trc
  54. IF( lk_trdmxl_trc .AND. ln_trdtrc( kjn ) ) THEN
  55. !
  56. SELECT CASE ( ktrd )
  57. CASE ( jptra_xad ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_xad, '3D', kjn )
  58. CASE ( jptra_yad ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_yad, '3D', kjn )
  59. CASE ( jptra_zad ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_zad, '3D', kjn )
  60. CASE ( jptra_ldf ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_ldf, '3D', kjn )
  61. CASE ( jptra_bbl ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_bbl, '3D', kjn )
  62. CASE ( jptra_zdf )
  63. IF( ln_trcldf_iso ) THEN
  64. CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_ldf, '3D', kjn )
  65. ELSE
  66. CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_zdf, '3D', kjn )
  67. ENDIF
  68. CASE ( jptra_dmp ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_dmp , '3D', kjn )
  69. CASE ( jptra_nsr ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_sbc , '2D', kjn )
  70. CASE ( jptra_sms ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_sms , '3D', kjn )
  71. CASE ( jptra_radb ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_radb, '3D', kjn )
  72. CASE ( jptra_radn ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_radn, '3D', kjn )
  73. CASE ( jptra_atf ) ; CALL trd_mxl_trc_zint( ptrtrd, jpmxl_trc_atf , '3D', kjn )
  74. END SELECT
  75. !
  76. END IF
  77. #endif
  78. IF( lk_trdtrc .AND. ln_trdtrc( kjn ) ) THEN
  79. !
  80. SELECT CASE( ktrd )
  81. CASE( jptra_xad ) ; WRITE (cltra,'("XAD_",4a)')
  82. CASE( jptra_yad ) ; WRITE (cltra,'("YAD_",4a)')
  83. CASE( jptra_zad ) ; WRITE (cltra,'("ZAD_",4a)')
  84. CASE( jptra_ldf ) ; WRITE (cltra,'("LDF_",4a)')
  85. CASE( jptra_bbl ) ; WRITE (cltra,'("BBL_",4a)')
  86. CASE( jptra_nsr ) ; WRITE (cltra,'("FOR_",4a)')
  87. CASE( jptra_zdf ) ; WRITE (cltra,'("ZDF_",4a)')
  88. CASE( jptra_dmp ) ; WRITE (cltra,'("DMP_",4a)')
  89. CASE( jptra_sms ) ; WRITE (cltra,'("SMS_",4a)')
  90. CASE( jptra_atf ) ; WRITE (cltra,'("ATF_",4a)')
  91. CASE( jptra_radb ) ; WRITE (cltra,'("RDB_",4a)')
  92. CASE( jptra_radn ) ; WRITE (cltra,'("RDN_",4a)')
  93. END SELECT
  94. cltra = TRIM(cltra)//TRIM(ctrcnm(kjn))
  95. CALL iom_put( cltra, ptrtrd(:,:,:) )
  96. !
  97. END IF
  98. END SUBROUTINE trd_trc_trp
  99. SUBROUTINE trd_trc_bio( ptrbio, ktrd, kt )
  100. !!----------------------------------------------------------------------
  101. !! *** ROUTINE trd_bio ***
  102. !!----------------------------------------------------------------------
  103. INTEGER, INTENT( in ) :: kt ! time step
  104. INTEGER, INTENT( in ) :: ktrd ! bio trend index
  105. REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrbio ! Bio trend
  106. !!----------------------------------------------------------------------
  107. #if defined key_trdmxl_trc
  108. CALL trd_mxl_bio_zint( ptrbio, ktrd ) ! Verticaly integrated biological trends
  109. #endif
  110. END SUBROUTINE trd_trc_bio
  111. #else
  112. !!----------------------------------------------------------------------
  113. !! Default option : Empty module
  114. !!----------------------------------------------------------------------
  115. INTERFACE trd_trc
  116. MODULE PROCEDURE trd_trc_trp, trd_trc_bio
  117. END INTERFACE
  118. CONTAINS
  119. SUBROUTINE trd_trc_trp( ptrtrd, kjn, ktrd, kt )
  120. INTEGER , INTENT( in ) :: kt ! time step
  121. INTEGER , INTENT( in ) :: kjn ! tracer index
  122. INTEGER , INTENT( in ) :: ktrd ! tracer trend index
  123. REAL, DIMENSION(:,:,:), INTENT( inout ) :: ptrtrd ! Temperature or U trend
  124. WRITE(*,*) 'trd_trc_trp : You should not have seen this print! error?', ptrtrd(1,1,1)
  125. WRITE(*,*) ' " " : You should not have seen this print! error?', kjn
  126. WRITE(*,*) ' " " : You should not have seen this print! error?', ktrd
  127. WRITE(*,*) ' " " : You should not have seen this print! error?', kt
  128. END SUBROUTINE trd_trc_trp
  129. SUBROUTINE trd_trc_bio( ptrbio, ktrd, kt )
  130. INTEGER , INTENT( in ) :: kt ! time step
  131. INTEGER , INTENT( in ) :: ktrd ! tracer trend index
  132. REAL, DIMENSION(:,:,:), INTENT( inout ) :: ptrbio ! Temperature or U trend
  133. WRITE(*,*) 'trd_trc_trp : You should not have seen this print! error?', ptrbio(1,1,1)
  134. WRITE(*,*) ' " " : You should not have seen this print! error?', ktrd
  135. WRITE(*,*) ' " " : You should not have seen this print! error?', kt
  136. END SUBROUTINE trd_trc_bio
  137. #endif
  138. !!======================================================================
  139. END MODULE trdtrc