trcsms_c14b.F90 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. MODULE trcsms_c14b
  2. !!======================================================================
  3. !! *** MODULE trcsms_c14b ***
  4. !! TOP : Bomb C14 main module
  5. !!======================================================================
  6. !! History - ! 1994-05 ( J. Orr ) original code
  7. !! 1.0 ! 2006-02 ( J.M. Molines ) Free form + modularity
  8. !! 2.0 ! 2008-12 ( C. Ethe ) reorganisation
  9. !! 4.0 ! 2011-02 ( A.R. Porter, STFC Daresbury ) Dynamic memory
  10. !!----------------------------------------------------------------------
  11. #if defined key_c14b
  12. !!----------------------------------------------------------------------
  13. !! 'key_c14b' Bomb C14 tracer
  14. !!----------------------------------------------------------------------
  15. !! trc_sms_c14b : compute and add C14 suface forcing to C14 trends
  16. !!----------------------------------------------------------------------
  17. USE oce_trc ! Ocean variables
  18. USE par_trc ! TOP parameters
  19. USE trc ! TOP variables
  20. USE trd_oce
  21. USE trdtrc
  22. USE iom ! I/O library
  23. IMPLICIT NONE
  24. PRIVATE
  25. PUBLIC trc_sms_c14b ! called in trcsms.F90
  26. PUBLIC trc_sms_c14b_alloc ! called in trcini_c14b.F90
  27. INTEGER , PUBLIC, PARAMETER :: jpmaxrec = 240 ! temporal parameter
  28. INTEGER , PUBLIC, PARAMETER :: jpmaxrec2 = 2 * jpmaxrec !
  29. INTEGER , PUBLIC, PARAMETER :: jpzon = 3 ! number of zones
  30. INTEGER , PUBLIC :: ndate_beg_b ! initial calendar date (aammjj) for C14
  31. INTEGER , PUBLIC :: nyear_beg_b ! initial year for C14
  32. INTEGER , PUBLIC :: nyear_res_b ! restoring time constant (year)
  33. INTEGER , PUBLIC :: nyear_beg ! initial year (aa)
  34. REAL(wp), PUBLIC, DIMENSION(jpmaxrec,jpzon) :: bomb !: C14 atm data (3 zones)
  35. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: fareaz !: Spatial Interpolation Factors
  36. REAL(wp), PUBLIC, DIMENSION(jpmaxrec2) :: spco2 !: Atmospheric CO2
  37. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qtr_c14 !: flux at surface
  38. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qint_c14 !: cumulative flux
  39. REAL(wp) :: xlambda, xdecay, xaccum ! C14 decay coef.
  40. REAL(wp) :: xconv1 = 1._wp ! conversion from to
  41. REAL(wp) :: xconv2 = 0.01_wp / 3600._wp ! conversion from cm/h to m/s:
  42. REAL(wp) :: xconv3 = 1.e+3_wp ! conversion from mol/l/atm to mol/m3/atm
  43. !! * Substitutions
  44. # include "top_substitute.h90"
  45. !!----------------------------------------------------------------------
  46. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  47. !! $Id$
  48. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  49. !!----------------------------------------------------------------------
  50. CONTAINS
  51. SUBROUTINE trc_sms_c14b( kt )
  52. !!----------------------------------------------------------------------
  53. !! *** ROUTINE trc_sms_c14b ***
  54. !!
  55. !! ** Purpose : Compute the surface boundary contition on C14bomb
  56. !! passive tracer associated with air-mer fluxes and add it to
  57. !! the general trend of tracers equations.
  58. !!
  59. !! ** Original comments from J. Orr :
  60. !!
  61. !! Calculates the input of Bomb C-14 to the surface layer of OPA
  62. !!
  63. !! James Orr, LMCE, 28 October 1992
  64. !!
  65. !! Initial approach mimics that of Toggweiler, Dixon, & Bryan (1989)
  66. !! (hereafter referred to as TDB) with constant gas exchange,
  67. !! although in this case, a perturbation approach is used for
  68. !! bomb-C14 so that both the ocean and atmosphere begin at zero.
  69. !! This saves tremendous amounts of computer time since no
  70. !! equilibrum run is first required (i.e., for natural C-14).
  71. !! Note: Many sensitivity tests can be run with this approach and
  72. !! one never has to make a run for natural C-14; otherwise,
  73. !! a run for natural C-14 must be run each time that one
  74. !! changes a model parameter!
  75. !!
  76. !!
  77. !! 19 August 1993: Modified to consider Atmospheric C-14 fom IPCC.
  78. !! That is, the IPCC has provided a C-14 atmospheric record (courtesy
  79. !! of Martin Heimann) for model calibration. This model spans from
  80. !! preindustrial times to present, in a format different than that
  81. !! given by TDB. It must be converted to the ORR C-14 units used
  82. !! here, although in this case, the perturbation includes not only
  83. !! bomb C-14 but changes due to the Suess effect.
  84. !!
  85. !!----------------------------------------------------------------------
  86. !
  87. INTEGER, INTENT(in) :: kt ! ocean time-step index
  88. !
  89. INTEGER :: ji, jj, jk, jz ! dummy loop indices
  90. INTEGER :: iyear_beg , iyear_beg1, iyear_end1
  91. INTEGER :: iyear_beg2, iyear_end2
  92. INTEGER :: imonth1, im1, in1
  93. INTEGER :: imonth2, im2, in2
  94. REAL(wp), DIMENSION(jpzon) :: zonbc14 !: time interp atm C14
  95. REAL(wp) :: zpco2at !: time interp atm C02
  96. REAL(wp) :: zt, ztp, zsk ! dummy variables
  97. REAL(wp) :: zsol ! solubility
  98. REAL(wp) :: zsch ! schmidt number
  99. REAL(wp) :: zv2 ! wind speed ( square)
  100. REAL(wp) :: zpv ! piston velocity
  101. REAL(wp) :: zdemi, ztra
  102. REAL(wp), POINTER, DIMENSION(:,: ) :: zatmbc14
  103. REAL(wp), POINTER, DIMENSION(:,:,:) :: zdecay
  104. !!---------------------------------------------------------------------
  105. !
  106. IF( nn_timing == 1 ) CALL timing_start('trc_sms_c14b')
  107. !
  108. ! Allocate temporary workspace
  109. CALL wrk_alloc( jpi, jpj, zatmbc14 )
  110. CALL wrk_alloc( jpi, jpj, jpk, zdecay )
  111. IF( kt == nittrc000 ) THEN ! Computation of decay coeffcient
  112. zdemi = 5730._wp
  113. xlambda = LOG(2.) / zdemi / ( nyear_len(1) * rday )
  114. xdecay = EXP( - xlambda * rdt )
  115. xaccum = 1._wp - xdecay
  116. !
  117. IF( ln_rsttr ) THEN
  118. IF(lwp) WRITE(numout,*)
  119. IF(lwp) WRITE(numout,*) ' Read specific variables from C14b model '
  120. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  121. CALL iom_get( numrtr, jpdom_autoglo, 'qint_c14', qint_c14 )
  122. ENDIF
  123. !
  124. IF(lwp) WRITE(numout,*)
  125. !
  126. ENDIF
  127. ! Temporal interpolation
  128. ! ----------------------
  129. iyear_beg = nyear - 1954 + ( nyear_res_b - 1700 - nyear_beg_b ) ! JMM Very dangerous
  130. ! nyear=0001 for 1955
  131. ! For Atmospheric C14 concentrations:
  132. iyear_beg1 = iyear_beg
  133. imonth1 = nmonth
  134. IF ( imonth1 <= 6 ) THEN
  135. iyear_beg1 = iyear_beg1 - 1
  136. im1 = 6 - imonth1 + 1
  137. im2 = 6 + imonth1 - 1
  138. ELSE
  139. im1 = 12 - imonth1 + 7
  140. im2 = imonth1 - 7
  141. ENDIF
  142. iyear_end1 = iyear_beg1 + 1
  143. iyear_beg1 = MAX( iyear_beg1, 1 )
  144. iyear_end1 = MIN( iyear_end1, 241 )
  145. ! For Atmospheric CO2 concentrations:
  146. iyear_beg2 = 2 * iyear_beg - 1
  147. imonth2 = INT( nmonth / 2. )
  148. IF ( imonth2 <= 3 ) THEN
  149. iyear_beg2 = iyear_beg2 - 1
  150. in1 = 3 - imonth2 + 1
  151. in2 = 3 + imonth2 - 1
  152. ELSE
  153. in1 = 6 - imonth2 + 4
  154. in2 = imonth2 - 4
  155. ENDIF
  156. iyear_end2 = iyear_beg2 + 1
  157. iyear_beg2 = MAX( iyear_beg2, 1 )
  158. iyear_end2 = MIN( iyear_end2, 482 )
  159. ! ----------------------------------------------------------------
  160. ! As explained by the TDB 89 papers, C-14/C-12 is the same
  161. ! as C-14 concentration in this special case (no fractionation
  162. ! effects in this model, which thus allow direct comparison
  163. ! to del-C-14, after unit change from above).
  164. ! -----------------------------------------------------------------------
  165. ! Calc C-14 in atmosphere based on interp of IPCC (M. Heimann) data
  166. ! - Compare input to calculated C-14 for each time in record
  167. !-------------------------------------------------------------------------
  168. ! Temporal and spatial interpolation at time k
  169. ! --------------------------------------------------
  170. ! Compute atmospheric C-14 for each zone (90-20S, 20S-20N, 20-90N)
  171. DO jz = 1, jpzon
  172. zonbc14(jz) = ( bomb(iyear_beg1,jz) * FLOAT( im1 ) &
  173. & + bomb(iyear_end1,jz) * FLOAT( im2 ) ) / 12.
  174. ! C-14 exactly starts at zero :
  175. ! JMM +Zouhair : Slightly negative values are set to 0 (when perturbation approaches)
  176. zonbc14(jz) = MAX( zonbc14(jz), 0. )
  177. END DO
  178. ! For each (i,j)-box, with information from the fractional area
  179. ! (zonmean), computes area-weighted mean to give the atmospheric C-14
  180. ! ----------------------------------------------------------------
  181. zatmbc14(:,:) = zonbc14(1) * fareaz(:,:,1) &
  182. & + zonbc14(2) * fareaz(:,:,2) &
  183. & + zonbc14(3) * fareaz(:,:,3)
  184. ! time interpolation of CO2 concentrations to it time step
  185. zpco2at = ( spco2(iyear_beg2) * FLOAT( in1 ) &
  186. & + spco2(iyear_end2) * FLOAT( in2 ) ) / 6.
  187. IF(lwp) THEN
  188. WRITE(numout, *) 'time : ', kt, ' CO2 year begin/end :',iyear_beg2,'/',iyear_end2, &
  189. & ' CO2 concen : ',zpco2at
  190. WRITE(numout, *) 'time : ', kt, ' C14 year begin/end :',iyear_beg1,'/',iyear_end1, &
  191. & ' C14B concen (Z1/Z2/Z3) : ',zonbc14(1),'/',zonbc14(2),'/',zonbc14(3)
  192. ENDIF
  193. ! Determine seasonally variable gas exchange coefficient
  194. !----------------------------------------------------------
  195. ! Computes the Schmidt number of CO2 in seawater using the formulation
  196. ! presented by Wanninkhof (1992, J. Geophys. Res., 97,7373-7382).
  197. ! -------------------------------------------------------------------
  198. DO jj = 1, jpj
  199. DO ji = 1, jpi
  200. ! Computation of solubility
  201. IF (tmask(ji,jj,1) > 0.) THEN
  202. ztp = ( tsn(ji,jj,1,jp_tem) + 273.16 ) * 0.01
  203. zsk = 0.023517 + ztp * ( -0.023656 + 0.0047036 * ztp )
  204. zsol = EXP( -60.2409 + 93.4517 / ztp + 23.3585 * LOG( ztp ) + zsk * tsn(ji,jj,1,jp_sal) )
  205. ! convert solubilities [mol/(l * atm)] -> [mol/(m^3 * ppm)]
  206. zsol = zsol * 1.e-03
  207. ELSE
  208. zsol = 0._wp
  209. ENDIF
  210. ! speed transfert : Formulation of Wanninkhof (1992, JGR, 97,7373-7382)
  211. ! JMM/Zouhair : coef of 0.25 rather than 0.3332 for CORe wind speed
  212. ! Computes the Schmidt number of CO2 in seawater
  213. zt = tsn(ji,jj,1,jp_tem)
  214. zsch = 2073.1 + zt * ( -125.62 + zt * (3.6276 - 0.043219 * zt ) )
  215. ! Wanninkhof Piston velocity and convert from units [cm/hr] -> [m/s]
  216. zv2 = wndm(ji,jj) * wndm(ji,jj)
  217. zsch = zsch / 660.
  218. zpv = ( 0.25 * zv2 / SQRT(zsch) ) * xconv2 * tmask(ji,jj,1)
  219. ! Flux of Bomb C-14 from air-sea : speed*(conc. at equil-conc. at surf)
  220. ! in C-14 (orr-model-units) / m**2 * s
  221. qtr_c14(ji,jj) = -zpv * zsol * zpco2at &
  222. & * ( trb(ji,jj,1,jpc14) - zatmbc14(ji,jj) ) &
  223. #if defined key_degrad
  224. & * facvol(ji,jj,1) &
  225. #endif
  226. & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) ) / 2.
  227. ! Add the surface flux to the trend
  228. tra(ji,jj,1,jpc14) = tra(ji,jj,1,jpc14) + qtr_c14(ji,jj) / fse3t(ji,jj,1)
  229. ! cumulation of surface flux at each time step
  230. qint_c14(ji,jj) = qint_c14(ji,jj) + qtr_c14(ji,jj) * rdt
  231. !
  232. END DO
  233. END DO
  234. ! Computation of decay effects on tracer concentration
  235. DO jk = 1, jpk
  236. DO jj = 1, jpj
  237. DO ji = 1, jpi
  238. #if defined key_degrad
  239. zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) )
  240. #else
  241. zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * xaccum
  242. #endif
  243. tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - zdecay(ji,jj,jk) / rdt
  244. !
  245. END DO
  246. END DO
  247. END DO
  248. !
  249. IF( lrst_trc ) THEN
  250. IF(lwp) WRITE(numout,*)
  251. IF(lwp) WRITE(numout,*) 'trc_sms_c14b : cumulated input function fields written in ocean restart file ', &
  252. & 'at it= ', kt,' date= ', ndastp
  253. IF(lwp) WRITE(numout,*) '~~~~'
  254. CALL iom_rstput( kt, nitrst, numrtw, 'qint_c14', qint_c14 )
  255. ENDIF
  256. !
  257. IF( lk_iomput ) THEN
  258. CALL iom_put( "qtr_C14b" , qtr_c14 )
  259. CALL iom_put( "qint_C14b" , qint_c14 )
  260. CALL iom_put( "fdecay" , zdecay )
  261. ELSE
  262. IF( ln_diatrc ) THEN
  263. trc2d(:,: ,jp_c14b0_2d ) = qtr_c14 (:,:)
  264. trc2d(:,: ,jp_c14b0_2d + 1 ) = qint_c14(:,:)
  265. trc3d(:,:,:,jp_c14b0_3d ) = zdecay (:,:,:)
  266. ENDIF
  267. ENDIF
  268. IF( l_trdtrc ) CALL trd_trc( tra(:,:,:,jpc14), jpc14, jptra_sms, kt ) ! save trends
  269. CALL wrk_dealloc( jpi, jpj, zatmbc14 )
  270. CALL wrk_dealloc( jpi, jpj, jpk, zdecay )
  271. !
  272. IF( nn_timing == 1 ) CALL timing_stop('trc_sms_c14b')
  273. !
  274. END SUBROUTINE trc_sms_c14b
  275. INTEGER FUNCTION trc_sms_c14b_alloc()
  276. !!----------------------------------------------------------------------
  277. !! *** ROUTINE trc_sms_c14b_alloc ***
  278. !!----------------------------------------------------------------------
  279. ALLOCATE( fareaz (jpi,jpj ,jpzon) , &
  280. & qtr_c14 (jpi,jpj) , &
  281. & qint_c14(jpi,jpj) , STAT=trc_sms_c14b_alloc )
  282. !
  283. IF( trc_sms_c14b_alloc /= 0 ) CALL ctl_warn('trc_sms_c14b_alloc: failed to allocate arrays')
  284. !
  285. END FUNCTION trc_sms_c14b_alloc
  286. #else
  287. !!----------------------------------------------------------------------
  288. !! Default option Dummy module
  289. !!----------------------------------------------------------------------
  290. CONTAINS
  291. SUBROUTINE trc_sms_c14b( kt ) ! Empty routine
  292. WRITE(*,*) 'trc_freons: You should not have seen this print! error?', kt
  293. END SUBROUTINE trc_sms_c14b
  294. #endif
  295. !!======================================================================
  296. END MODULE trcsms_c14b