trcsms_my_trc.F90 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. MODULE trcsms_my_trc
  2. !!======================================================================
  3. !! *** MODULE trcsms_my_trc ***
  4. !! TOP : Main module of the MY_TRC tracers
  5. !!======================================================================
  6. !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) Original code
  7. !!----------------------------------------------------------------------
  8. #if defined key_my_trc
  9. !!----------------------------------------------------------------------
  10. !! 'key_my_trc' CFC tracers
  11. !!----------------------------------------------------------------------
  12. !! trc_sms_my_trc : MY_TRC model main routine
  13. !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms
  14. !!----------------------------------------------------------------------
  15. USE par_trc ! TOP parameters
  16. USE oce_trc ! Ocean variables
  17. USE trc ! TOP variables
  18. USE trd_oce
  19. USE trdtrc
  20. IMPLICIT NONE
  21. PRIVATE
  22. PUBLIC trc_sms_my_trc ! called by trcsms.F90 module
  23. PUBLIC trc_sms_my_trc_alloc ! called by trcini_my_trc.F90 module
  24. ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc
  25. !!----------------------------------------------------------------------
  26. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  27. !! $Id: trcsms_my_trc.F90 4990 2014-12-15 16:42:49Z timgraham $
  28. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  29. !!----------------------------------------------------------------------
  30. CONTAINS
  31. SUBROUTINE trc_sms_my_trc( kt )
  32. !!----------------------------------------------------------------------
  33. !! *** trc_sms_my_trc ***
  34. !!
  35. !! ** Purpose : main routine of MY_TRC model
  36. !!
  37. !! ** Method : -
  38. !!----------------------------------------------------------------------
  39. !
  40. INTEGER, INTENT(in) :: kt ! ocean time-step index
  41. INTEGER :: jn ! dummy loop index
  42. REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmyt
  43. !!----------------------------------------------------------------------
  44. !
  45. IF( nn_timing == 1 ) CALL timing_start('trc_sms_my_trc')
  46. !
  47. IF(lwp) WRITE(numout,*)
  48. IF(lwp) WRITE(numout,*) ' trc_sms_my_trc: MY_TRC model'
  49. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  50. IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrmyt )
  51. IF( l_trdtrc ) THEN ! Save the trends in the ixed layer
  52. DO jn = jp_myt0, jp_myt1
  53. ztrmyt(:,:,:) = tra(:,:,:,jn)
  54. CALL trd_trc( ztrmyt, jn, jptra_sms, kt ) ! save trends
  55. END DO
  56. CALL wrk_dealloc( jpi, jpj, jpk, ztrmyt )
  57. END IF
  58. !
  59. IF( nn_timing == 1 ) CALL timing_stop('trc_sms_my_trc')
  60. !
  61. END SUBROUTINE trc_sms_my_trc
  62. INTEGER FUNCTION trc_sms_my_trc_alloc()
  63. !!----------------------------------------------------------------------
  64. !! *** ROUTINE trc_sms_my_trc_alloc ***
  65. !!----------------------------------------------------------------------
  66. !
  67. ! ALLOCATE here the arrays specific to MY_TRC
  68. ! ALLOCATE( tab(...) , STAT=trc_sms_my_trc_alloc )
  69. trc_sms_my_trc_alloc = 0 ! set to zero if no array to be allocated
  70. !
  71. IF( trc_sms_my_trc_alloc /= 0 ) CALL ctl_warn('trc_sms_my_trc_alloc : failed to allocate arrays')
  72. !
  73. END FUNCTION trc_sms_my_trc_alloc
  74. #else
  75. !!----------------------------------------------------------------------
  76. !! Dummy module No MY_TRC model
  77. !!----------------------------------------------------------------------
  78. CONTAINS
  79. SUBROUTINE trc_sms_my_trc( kt ) ! Empty routine
  80. INTEGER, INTENT( in ) :: kt
  81. WRITE(*,*) 'trc_sms_my_trc: You should not have seen this print! error?', kt
  82. END SUBROUTINE trc_sms_my_trc
  83. #endif
  84. !!======================================================================
  85. END MODULE trcsms_my_trc