trcwri.F90 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. MODULE trcwri
  2. !!======================================================================
  3. !! *** MODULE trcwri ***
  4. !! TOP : Output of passive tracers
  5. !!======================================================================
  6. !! History : 1.0 ! 2009-05 (C. Ethe) Original code
  7. !!----------------------------------------------------------------------
  8. #if defined key_top && defined key_iomput
  9. !!----------------------------------------------------------------------
  10. !! 'key_top' TOP models
  11. !!----------------------------------------------------------------------
  12. !! trc_wri_trc : outputs of concentration fields
  13. !!----------------------------------------------------------------------
  14. USE dom_oce ! ocean space and time domain variables
  15. USE oce_trc ! shared variables between ocean and passive tracers
  16. USE trc ! passive tracers common variables
  17. USE iom ! I/O manager
  18. USE dianam ! Output file name
  19. USE trcwri_pisces
  20. USE trcwri_cfc
  21. USE trcwri_c14b
  22. USE trcwri_age
  23. USE trcwri_my_trc
  24. IMPLICIT NONE
  25. PRIVATE
  26. PUBLIC trc_wri
  27. !! * Substitutions
  28. # include "top_substitute.h90"
  29. CONTAINS
  30. SUBROUTINE trc_wri( kt )
  31. !!---------------------------------------------------------------------
  32. !! *** ROUTINE trc_wri ***
  33. !!
  34. !! ** Purpose : output passive tracers fields and dynamical trends
  35. !!---------------------------------------------------------------------
  36. INTEGER, INTENT( in ) :: kt
  37. !
  38. INTEGER :: jn
  39. CHARACTER (len=20) :: cltra
  40. CHARACTER (len=40) :: clhstnam
  41. INTEGER :: inum = 11 ! temporary logical unit
  42. !!---------------------------------------------------------------------
  43. !
  44. IF( nn_timing == 1 ) CALL timing_start('trc_wri')
  45. !
  46. IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN ! WRITE root name in date.file for use by postpro
  47. CALL dia_nam( clhstnam, nn_writetrc,' ' )
  48. CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
  49. WRITE(inum,*) clhstnam
  50. CLOSE(inum)
  51. ENDIF
  52. ! write the tracer concentrations in the file
  53. ! ---------------------------------------
  54. IF( lk_pisces ) CALL trc_wri_pisces ! PISCES
  55. IF( lk_my_trc ) CALL trc_wri_my_trc ! MY_TRC tracers
  56. IF( lk_cfc ) CALL trc_wri_cfc ! surface fluxes of CFC
  57. IF( lk_c14b ) CALL trc_wri_c14b ! surface fluxes of C14
  58. IF( lk_age ) CALL trc_wri_age ! AGE tracer
  59. !
  60. IF( nn_timing == 1 ) CALL timing_stop('trc_wri')
  61. !
  62. END SUBROUTINE trc_wri
  63. #else
  64. !!----------------------------------------------------------------------
  65. !! Dummy module : No passive tracer
  66. !!----------------------------------------------------------------------
  67. PUBLIC trc_wri
  68. CONTAINS
  69. SUBROUTINE trc_wri( kt ) ! Empty routine
  70. INTEGER, INTENT(in) :: kt
  71. END SUBROUTINE trc_wri
  72. #endif
  73. !!----------------------------------------------------------------------
  74. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  75. !! $Id$
  76. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  77. !!======================================================================
  78. END MODULE trcwri