trcnam_cfc.F90 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. MODULE trcnam_cfc
  2. !!======================================================================
  3. !! *** MODULE trcnam_cfc ***
  4. !! TOP : initialisation of some run parameters for CFC chemical model
  5. !!======================================================================
  6. !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcnam.cfc.h90
  7. !!----------------------------------------------------------------------
  8. #if defined key_cfc
  9. !!----------------------------------------------------------------------
  10. !! 'key_cfc' CFC tracers
  11. !!----------------------------------------------------------------------
  12. !! trc_nam_cfc : CFC model initialisation
  13. !!----------------------------------------------------------------------
  14. USE oce_trc ! Ocean variables
  15. USE par_trc ! TOP parameters
  16. USE trc ! TOP variables
  17. USE trcsms_cfc ! CFC specific variable
  18. USE iom ! I/O manager
  19. IMPLICIT NONE
  20. PRIVATE
  21. PUBLIC trc_nam_cfc ! called by trcnam.F90 module
  22. !!----------------------------------------------------------------------
  23. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  24. !! $Id: trcnam_cfc.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_cfc
  29. !!-------------------------------------------------------------------
  30. !! *** ROUTINE trc_nam_cfc ***
  31. !!
  32. !! ** Purpose : Definition some run parameter for CFC model
  33. !!
  34. !! ** Method : Read the namcfc namelist and check the parameter
  35. !! values called at the first timestep (nittrc000)
  36. !!
  37. !! ** input : Namelist namcfc
  38. !!----------------------------------------------------------------------
  39. INTEGER :: numnatc_ref = -1 ! Logical unit for reference CFC namelist
  40. INTEGER :: numnatc_cfg = -1 ! Logical unit for configuration CFC namelist
  41. INTEGER :: numonc = -1 ! Logical unit for output namelist
  42. INTEGER :: ios ! Local integer output status for namelist read
  43. INTEGER :: jl, jn, cnt
  44. TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d
  45. !!
  46. NAMELIST/namcfcdate/ ndate_beg, nyear_res, clnamecfc
  47. NAMELIST/namcfcdia/ cfcdia2d ! additional diagnostics
  48. !!----------------------------------------------------------------------
  49. ! ! Open namelist files
  50. CALL ctl_opn( numnatc_ref, 'namelist_cfc_ref' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  51. CALL ctl_opn( numnatc_cfg, 'namelist_cfc_cfg' , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  52. IF(lwm) CALL ctl_opn( numonc, 'output.namelist.cfc', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  53. REWIND( numnatc_ref ) ! Namelist namcfcdate in reference namelist : CFC parameters
  54. READ ( numnatc_ref, namcfcdate, IOSTAT = ios, ERR = 901)
  55. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfcdate in reference namelist', lwp )
  56. REWIND( numnatc_cfg ) ! Namelist namcfcdate in configuration namelist : CFC parameters
  57. READ ( numnatc_cfg, namcfcdate, IOSTAT = ios, ERR = 902 )
  58. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfcdate in configuration namelist', lwp )
  59. IF(lwm) WRITE ( numonc, namcfcdate )
  60. jn = jp_cfc0 - 1
  61. ! Variables setting
  62. IF( lp_cfc11 ) THEN
  63. jn = jn + 1
  64. ctrcnm (jn) = 'CFC11'
  65. ctrcln (jn) = 'Chlorofluoro carbon 11 Concentration'
  66. ctrcun (jn) = 'umolC/L'
  67. ln_trc_ini(jn) = .false.
  68. ln_trc_wri(jn) = .true.
  69. ENDIF
  70. !
  71. IF( lp_cfc12 ) THEN
  72. jn = jn + 1
  73. ctrcnm (jn) = 'CFC12'
  74. ctrcln (jn) = 'Chlorofluoro carbon 12 Concentration'
  75. ctrcun (jn) = 'umolC/L'
  76. ln_trc_ini(jn) = .false.
  77. ln_trc_wri(jn) = .true.
  78. ENDIF
  79. !
  80. IF( lp_sf6 ) THEN
  81. jn = jn + 1
  82. ctrcnm (jn) = 'SF6'
  83. ctrcln (jn) = 'Sulfur hexafluoride Concentration'
  84. ctrcun (jn) = 'umol/L'
  85. ln_trc_ini(jn) = .false.
  86. ln_trc_wri(jn) = .true.
  87. ENDIF
  88. IF(lwp) THEN ! control print
  89. WRITE(numout,*) ' '
  90. WRITE(numout,*) ' CFCs'
  91. WRITE(numout,*) ' '
  92. WRITE(numout,*) ' trc_nam: Read namdates, namelist for CFC chemical model'
  93. WRITE(numout,*) ' ~~~~~~~'
  94. WRITE(numout,*) ' initial calendar date (aammjj) for CFC ndate_beg = ', ndate_beg
  95. WRITE(numout,*) ' restoring time constant (year) nyear_res = ', nyear_res
  96. WRITE(numout,*) ' Atmospheric CFC concentrations file clnamecfc = ', TRIM(clnamecfc)
  97. WRITE(numout,*) ' Compute dynamics for CFC-11 lp_cfc11 = ', lp_cfc11
  98. WRITE(numout,*) ' Compute dynamics for CFC-12 lp_cfc12 = ', lp_cfc12
  99. WRITE(numout,*) ' Compute dynamics for SF6 lp_sf6 = ', lp_sf6
  100. ENDIF
  101. nyear_beg = ndate_beg / 10000
  102. IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg = ', nyear_beg
  103. !
  104. ! check consistency between CFC namelist and par_cfc setting
  105. if ( jn - jp_cfc0 + 1 .ne. jp_cfc ) &
  106. CALL ctl_stop( 'trc_nam_cfc: Number of selected CFCs is different from total CFC number (jp_cfc) specified in par_cfc.F90' )
  107. !
  108. IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN
  109. !
  110. ! Namelist namcfcdia
  111. ! -------------------
  112. REWIND( numnatc_ref ) ! Namelist namcfcdia in reference namelist : CFC diagnostics
  113. READ ( numnatc_ref, namcfcdia, IOSTAT = ios, ERR = 903)
  114. 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfcdia in reference namelist', lwp )
  115. REWIND( numnatc_cfg ) ! Namelist namcfcdia in configuration namelist : CFC diagnostics
  116. READ ( numnatc_cfg, namcfcdia, IOSTAT = ios, ERR = 904 )
  117. 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfcdia in configuration namelist', lwp )
  118. IF(lwm) WRITE ( numonc, namcfcdia )
  119. DO jl = 1, jp_cfc_2d
  120. jn = jp_cfc0_2d + jl - 1
  121. ctrc2d(jn) = TRIM( cfcdia2d(jl)%sname )
  122. ctrc2l(jn) = TRIM( cfcdia2d(jl)%lname )
  123. ctrc2u(jn) = TRIM( cfcdia2d(jl)%units )
  124. END DO
  125. IF(lwp) THEN ! control print
  126. WRITE(numout,*)
  127. WRITE(numout,*) ' Namelist : natadd'
  128. DO jl = 1, jp_cfc_2d
  129. jn = jp_cfc0_2d + jl - 1
  130. WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), &
  131. & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn)
  132. END DO
  133. WRITE(numout,*) ' '
  134. ENDIF
  135. !
  136. ENDIF
  137. IF(lwm) CALL FLUSH ( numonc ) ! flush output namelist CFC
  138. END SUBROUTINE trc_nam_cfc
  139. #else
  140. !!----------------------------------------------------------------------
  141. !! Dummy module : No CFC
  142. !!----------------------------------------------------------------------
  143. CONTAINS
  144. SUBROUTINE trc_nam_cfc ! Empty routine
  145. END SUBROUTINE trc_nam_cfc
  146. #endif
  147. !!======================================================================
  148. END MODULE trcnam_cfc