trcnam_c14b.F90 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. MODULE trcnam_c14b
  2. !!======================================================================
  3. !! *** MODULE trcnam_c14b ***
  4. !! TOP : initialisation of some run parameters for C14 chemical model
  5. !!======================================================================
  6. !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcnam.cfc.h90
  7. !!----------------------------------------------------------------------
  8. #if defined key_c14b
  9. !!----------------------------------------------------------------------
  10. !! 'key_c14b' C14 bomb tracer
  11. !!----------------------------------------------------------------------
  12. !! trc_nam_c14b : C14 model initialisation
  13. !!----------------------------------------------------------------------
  14. USE oce_trc ! Ocean variables
  15. USE par_trc ! TOP parameters
  16. USE trc ! TOP variables
  17. USE trcsms_c14b ! C14b specific variable
  18. USE iom ! I/O manager
  19. IMPLICIT NONE
  20. PRIVATE
  21. PUBLIC trc_nam_c14b ! called by trcnam.F90 module
  22. !!----------------------------------------------------------------------
  23. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  24. !! $Id: trcnam_c14b.F90 4624 2014-04-28 12:09:03Z acc $
  25. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  26. !!----------------------------------------------------------------------
  27. CONTAINS
  28. SUBROUTINE trc_nam_c14b
  29. !!-------------------------------------------------------------------
  30. !! *** ROUTINE trc_nam_c14b ***
  31. !!
  32. !! ** Purpose : Definition some run parameter for C14 model
  33. !!
  34. !! ** Method : Read the namc14 namelist and check the parameter
  35. !! values called at the first timestep (nittrc000)
  36. !!
  37. !! ** input : Namelist namelist_c14b
  38. !!----------------------------------------------------------------------
  39. INTEGER :: numnatb_ref = -1 ! Logical unit for reference c14b namelist
  40. INTEGER :: numnatb_cfg = -1 ! Logical unit for configuration c14b namelist
  41. INTEGER :: numonb = -1 ! Logical unit for output namelist
  42. INTEGER :: ios ! Local integer output status for namelist read
  43. ! definition of additional diagnostic as a structure
  44. INTEGER :: jl, jn
  45. TYPE(DIAG), DIMENSION(jp_c14b_2d) :: c14dia2d
  46. TYPE(DIAG), DIMENSION(jp_c14b_3d) :: c14dia3d
  47. !!
  48. NAMELIST/namc14date/ ndate_beg_b, nyear_res_b
  49. NAMELIST/namc14dia/ c14dia2d, c14dia3d ! additional diagnostics
  50. !!-------------------------------------------------------------------
  51. ctrcnm (jp_c14b0) = 'C14B'
  52. ctrcln (jp_c14b0) = 'Bomb C14 Concentration'
  53. ctrcun (jp_c14b0) = 'ration'
  54. ln_trc_ini(jp_c14b0) = .false.
  55. ln_trc_wri(jp_c14b0) = .true.
  56. ! ! Open namelist file
  57. CALL ctl_opn( numnatb_ref, 'namelist_c14b_ref' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  58. CALL ctl_opn( numnatb_cfg, 'namelist_c14b_cfg' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  59. IF(lwm) CALL ctl_opn( numonb, 'output.namelist.c14', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  60. REWIND( numnatb_ref ) ! Namelist namc14date in reference namelist : c14b parameters
  61. READ ( numnatb_ref, namc14date, IOSTAT = ios, ERR = 901)
  62. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc14date in reference namelist', lwp )
  63. REWIND( numnatb_cfg ) ! Namelist namc14date in configuration namelist : c14b parameters
  64. READ ( numnatb_cfg, namc14date, IOSTAT = ios, ERR = 902 )
  65. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc14date in configuration namelist', lwp )
  66. IF(lwm) WRITE ( numonb, namc14date )
  67. IF(lwp) THEN ! control print
  68. WRITE(numout,*)
  69. WRITE(numout,*) ' trc_nam: Read namdates, namelist for C14 chemical model'
  70. WRITE(numout,*) ' ~~~~~~~'
  71. WRITE(numout,*) ' initial calendar date (aammjj) for C14 ndate_beg_b = ', ndate_beg_b
  72. WRITE(numout,*) ' restoring time constant (year) nyear_res_b = ', nyear_res_b
  73. ENDIF
  74. nyear_beg_b = ndate_beg_b / 10000
  75. IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg_b = ', nyear_beg_b
  76. !
  77. IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN
  78. !
  79. ! Namelist namc14dia
  80. ! -------------------
  81. REWIND( numnatb_ref ) ! Namelist namc14dia in reference namelist : c14b diagnostics
  82. READ ( numnatb_ref, namc14dia, IOSTAT = ios, ERR = 903)
  83. 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc14dia in reference namelist', lwp )
  84. REWIND( numnatb_cfg ) ! Namelist namc14dia in configuration namelist : c14b diagnostics
  85. READ ( numnatb_cfg, namc14dia, IOSTAT = ios, ERR = 904 )
  86. 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namc14dia in configuration namelist', lwp )
  87. IF(lwm) WRITE ( numonb, namc14dia )
  88. DO jl = 1, jp_c14b_2d
  89. jn = jp_c14b0_2d + jl - 1
  90. ctrc2d(jn) = c14dia2d(jl)%sname
  91. ctrc2l(jn) = c14dia2d(jl)%lname
  92. ctrc2u(jn) = c14dia2d(jl)%units
  93. END DO
  94. DO jl = 1, jp_c14b_3d
  95. jn = jp_c14b0_3d + jl - 1
  96. ctrc3d(jn) = c14dia3d(jl)%sname
  97. ctrc3l(jn) = c14dia3d(jl)%lname
  98. ctrc3u(jn) = c14dia3d(jl)%units
  99. END DO
  100. IF(lwp) THEN ! control print
  101. WRITE(numout,*)
  102. WRITE(numout,*) ' Namelist : natadd'
  103. DO jl = 1, jp_c14b_3d
  104. jn = jp_c14b0_3d + jl - 1
  105. WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), &
  106. & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn)
  107. END DO
  108. WRITE(numout,*) ' '
  109. DO jl = 1, jp_c14b_2d
  110. jn = jp_c14b0_2d + jl - 1
  111. WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), &
  112. & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn)
  113. END DO
  114. WRITE(numout,*) ' '
  115. ENDIF
  116. !
  117. ENDIF
  118. IF(lwm) CALL FLUSH ( numonb ) ! flush output namelist C14b
  119. END SUBROUTINE trc_nam_c14b
  120. #else
  121. !!----------------------------------------------------------------------
  122. !! Dummy module : No 14C
  123. !!----------------------------------------------------------------------
  124. CONTAINS
  125. SUBROUTINE trc_nam_c14b ! Empty routine
  126. END SUBROUTINE trc_nam_c14b
  127. #endif
  128. !!======================================================================
  129. END MODULE trcnam_c14b