trcsms_age.F90 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. MODULE trcsms_age
  2. !!======================================================================
  3. !! *** MODULE trcsms_age ***
  4. !! TOP : Main module of the AGE tracers
  5. !!======================================================================
  6. !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) Original code
  7. !!----------------------------------------------------------------------
  8. #if defined key_age
  9. !!----------------------------------------------------------------------
  10. !! 'key_age' AGE tracer
  11. !!----------------------------------------------------------------------
  12. !! trc_sms_age : AGE model main routine
  13. !!----------------------------------------------------------------------
  14. USE oce_trc ! Ocean variables
  15. USE trc ! TOP variables
  16. USE trd_oce
  17. USE trdtrc
  18. IMPLICIT NONE
  19. PRIVATE
  20. PUBLIC trc_sms_age ! called by trcsms.F90 module
  21. INTEGER , PUBLIC :: nl_age ! T level surrounding age_depth
  22. INTEGER , PUBLIC :: nla_age ! T level wholly above age_depth
  23. INTEGER , PUBLIC :: nlb_age ! T level wholly below age_depth
  24. REAL(wp), PUBLIC :: rn_age_depth ! = 10 depth over which age tracer reset to zero
  25. REAL(wp), PUBLIC :: rn_age_kill_rate ! = -1./7200 recip of relaxation timescale (s) for age tracer shallower than age_depth
  26. REAL(wp), PUBLIC :: rryear !: recip number of seconds in one year
  27. REAL(wp), PUBLIC :: frac_kill_age !: fraction of level nl_age above age_depth where it is relaxed towards zero
  28. REAL(wp), PUBLIC :: frac_add_age !: fraction of level nl_age below age_depth where it is incremented
  29. !!----------------------------------------------------------------------
  30. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  31. !! $Id: trcsms_age.F90 3829 2017-01-13 07:27:36Z ufla $
  32. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  33. !!----------------------------------------------------------------------
  34. CONTAINS
  35. SUBROUTINE trc_sms_age( kt )
  36. !!----------------------------------------------------------------------
  37. !! *** trc_sms_age ***
  38. !!
  39. !! ** Purpose : main routine of AGE model
  40. !!
  41. !! ** Method : -
  42. !!----------------------------------------------------------------------
  43. !
  44. INTEGER, INTENT(in) :: kt ! ocean time-step index
  45. INTEGER :: jn, jk ! dummy loop index
  46. REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrage
  47. !!----------------------------------------------------------------------
  48. !
  49. IF( nn_timing == 1 ) CALL timing_start('trc_sms_age')
  50. !
  51. IF(lwp) WRITE(numout,*)
  52. IF(lwp) WRITE(numout,*) ' trc_sms_age: AGE model'
  53. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  54. IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrage )
  55. DO jk = 1, nla_age
  56. tra(:,:,jk,jpage1) = rn_age_kill_rate * trb(:,:,jk,jpage1)
  57. ENDDO
  58. !
  59. tra(:,:,nl_age,jpage1) = frac_kill_age * rn_age_kill_rate * trb(:,:,nl_age,jpage1) &
  60. & + frac_add_age * rryear * tmask(:,:,nl_age)
  61. !
  62. DO jk = nlb_age, jpk
  63. tra(:,:,jk,jpage1) = tmask(:,:,jk) * rryear
  64. ENDDO
  65. !
  66. IF( l_trdtrc ) THEN ! Save the trends in the ixed layer
  67. DO jn = jp_age0, jp_age1
  68. ztrage(:,:,:) = tra(:,:,:,jn)
  69. CALL trd_trc( ztrage, jn, jptra_sms, kt ) ! save trends
  70. END DO
  71. CALL wrk_dealloc( jpi, jpj, jpk, ztrage )
  72. END IF
  73. !
  74. IF( nn_timing == 1 ) CALL timing_stop('trc_sms_age')
  75. !
  76. END SUBROUTINE trc_sms_age
  77. #else
  78. !!----------------------------------------------------------------------
  79. !! Dummy module No AGE model
  80. !!----------------------------------------------------------------------
  81. CONTAINS
  82. SUBROUTINE trc_sms_age( kt ) ! Empty routine
  83. INTEGER, INTENT( in ) :: kt
  84. WRITE(*,*) 'trc_sms_age: You should not have seen this print! error?', kt
  85. END SUBROUTINE trc_sms_age
  86. #endif
  87. !!======================================================================
  88. END MODULE trcsms_age