trcsms_cfc.F90 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. MODULE trcsms_cfc
  2. !!======================================================================
  3. !! *** MODULE trcsms_cfc ***
  4. !! TOP : CFC main model
  5. !!======================================================================
  6. !! History : OPA ! 1999-10 (JC. Dutay) original code
  7. !! NEMO 1.0 ! 2004-03 (C. Ethe) free form + modularity
  8. !! 2.0 ! 2007-12 (C. Ethe, G. Madec) reorganisation
  9. !!----------------------------------------------------------------------
  10. #if defined key_cfc
  11. !!----------------------------------------------------------------------
  12. !! 'key_cfc' CFC tracers
  13. !!----------------------------------------------------------------------
  14. !! trc_sms_cfc : compute and add CFC suface forcing to CFC trends
  15. !! cfc_init : sets constants for CFC surface forcing computation
  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_cfc ! called in ???
  26. PUBLIC trc_sms_cfc_alloc ! called in trcini_cfc.F90
  27. INTEGER , PUBLIC, PARAMETER :: jphem = 2 ! parameter for the 2 hemispheres
  28. INTEGER , PUBLIC :: jpyear ! Number of years read in input data file (in trcini_cfc)
  29. INTEGER , PUBLIC :: ndate_beg ! initial calendar date (aammjj) for CFC
  30. INTEGER , PUBLIC :: nyear_res ! restoring time constant (year)
  31. INTEGER , PUBLIC :: nyear_beg ! initial year (aa)
  32. CHARACTER(len=200), PUBLIC :: clnamecfc ! Input filename of CFCs atm. concentrations
  33. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: p_cfc ! partial hemispheric pressure for CFC
  34. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: xphem ! spatial interpolation factor for patm
  35. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qtr_cfc ! flux at surface
  36. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qint_cfc ! cumulative flux
  37. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: atm_cfc ! partial hemispheric pressure for used CFC
  38. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: patm ! atmospheric function
  39. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: soa ! coefficient for solubility of CFC [mol/l/atm]
  40. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sob ! " "
  41. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sca ! coefficients for schmidt number in degrees Celsius
  42. ! ! coefficients for conversion
  43. REAL(wp) :: xconv1 = 1.0 ! conversion from to
  44. REAL(wp) :: xconv2 = 0.01/3600. ! conversion from cm/h to m/s:
  45. REAL(wp) :: xconv3 = 1.0e+3 ! conversion from mol/l/atm to mol/m3/atm
  46. REAL(wp) :: xconv4 = 1.0e-12 ! conversion from mol/m3/atm to mol/m3/pptv
  47. !! * Substitutions
  48. # include "top_substitute.h90"
  49. !!----------------------------------------------------------------------
  50. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  51. !! $Id: trcsms_cfc.F90 4990 2014-12-15 16:42:49Z timgraham $
  52. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  53. !!----------------------------------------------------------------------
  54. CONTAINS
  55. SUBROUTINE trc_sms_cfc( kt )
  56. !!----------------------------------------------------------------------
  57. !! *** ROUTINE trc_sms_cfc ***
  58. !!
  59. !! ** Purpose : Compute the surface boundary contition on CFC 11
  60. !! passive tracer associated with air-mer fluxes and add it
  61. !! to the general trend of tracers equations.
  62. !!
  63. !! ** Method : - get the atmospheric partial pressure - given in pico -
  64. !! - computation of solubility ( in 1.e-12 mol/l then in 1.e-9 mol/m3)
  65. !! - computation of transfert speed ( given in cm/hour ----> cm/s )
  66. !! - the input function is given by :
  67. !! speed * ( concentration at equilibrium - concentration at surface )
  68. !! - the input function is in pico-mol/m3/s and the
  69. !! CFC concentration in pico-mol/m3
  70. !!----------------------------------------------------------------------
  71. !
  72. INTEGER, INTENT(in) :: kt ! ocean time-step index
  73. !
  74. INTEGER :: ji, jj, jn, jl, jm, js
  75. INTEGER :: iyear_beg, iyear_end
  76. INTEGER :: im1, im2, ierr
  77. REAL(wp) :: ztap, zdtap
  78. REAL(wp) :: zt1, zt2, zt3, zt4, zv2
  79. REAL(wp) :: zsol ! solubility
  80. REAL(wp) :: zsch ! schmidt number
  81. REAL(wp) :: zpp_cfc ! atmospheric partial pressure of CFC
  82. REAL(wp) :: zca_cfc ! concentration at equilibrium
  83. REAL(wp) :: zak_cfc ! transfert coefficients
  84. REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zpatm ! atmospheric function
  85. !!----------------------------------------------------------------------
  86. !
  87. !
  88. IF( nn_timing == 1 ) CALL timing_start('trc_sms_cfc')
  89. IF(lwp) WRITE(numout,*)
  90. IF(lwp) WRITE(numout,*) ' trc_sms_cfc: CFC model'
  91. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  92. !
  93. ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr )
  94. IF( ierr > 0 ) THEN
  95. CALL ctl_stop( 'trc_sms_cfc: unable to allocate zpatm array' ) ; RETURN
  96. ENDIF
  97. IF( kt == nittrc000 ) CALL cfc_init
  98. ! Temporal interpolation
  99. ! ----------------------
  100. iyear_beg = nyear - 1900
  101. IF ( nmonth <= 6 ) THEN
  102. iyear_beg = iyear_beg - 1
  103. im1 = 6 - nmonth + 1
  104. im2 = 6 + nmonth - 1
  105. ELSE
  106. im1 = 12 - nmonth + 7
  107. im2 = nmonth - 7
  108. ENDIF
  109. ! Avoid bad interpolation if starting date is =< 1900
  110. if( iyear_beg .LE. 0 ) iyear_beg = 1
  111. !
  112. iyear_end = iyear_beg + 1
  113. ! !------------!
  114. DO jl = 1, jp_cfc ! CFC loop !
  115. ! !------------!
  116. jn = jp_cfc0 + jl - 1
  117. ! time interpolation at time kt
  118. DO jm = 1, jphem
  119. zpatm(jm,jl) = ( atm_cfc(iyear_beg, jm, jl) * REAL(im1, wp) &
  120. & + atm_cfc(iyear_end, jm, jl) * REAL(im2, wp) ) / 12.
  121. END DO
  122. ! !------------!
  123. DO jj = 1, jpj ! i-j loop !
  124. DO ji = 1, jpi !------------!
  125. ! space interpolation
  126. zpp_cfc = xphem(ji,jj) * zpatm(1,jl) &
  127. & + ( 1.- xphem(ji,jj) ) * zpatm(2,jl)
  128. ! Computation of concentration at equilibrium : in picomol/l
  129. ! coefficient for solubility for CFC-11/12 in mol/l/atm
  130. IF( tmask(ji,jj,1) .GE. 0.5 ) THEN
  131. ztap = ( tsn(ji,jj,1,jp_tem) + 273.16 ) * 0.01
  132. zdtap = sob(1,jl) + ztap * ( sob(2,jl) + ztap * sob(3,jl) )
  133. zsol = EXP( soa(1,jl) + soa(2,jl) / ztap + soa(3,jl) * LOG( ztap ) &
  134. & + soa(4,jl) * ztap * ztap + tsn(ji,jj,1,jp_sal) * zdtap )
  135. ELSE
  136. zsol = 0.e0
  137. ENDIF
  138. ! conversion from mol/l/atm to mol/m3/atm and from mol/m3/atm to mol/m3/pptv
  139. zsol = xconv4 * xconv3 * zsol * tmask(ji,jj,1)
  140. ! concentration at equilibrium
  141. zca_cfc = xconv1 * zpp_cfc * zsol * tmask(ji,jj,1)
  142. ! Computation of speed transfert
  143. ! Schmidt number revised in Wanninkhof (2014)
  144. zt1 = tsn(ji,jj,1,jp_tem)
  145. zt2 = zt1 * zt1
  146. zt3 = zt1 * zt2
  147. zt4 = zt2 * zt2
  148. zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3 + sca(5,jl) * zt4
  149. ! speed transfert : formulae revised in Wanninkhof (2014)
  150. zv2 = wndm(ji,jj) * wndm(ji,jj)
  151. zsch = zsch / 660.
  152. zak_cfc = ( 0.251 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1)
  153. ! Input function : speed *( conc. at equil - concen at surface )
  154. ! trn in pico-mol/l idem qtr; ak in en m/a
  155. qtr_cfc(ji,jj,jl) = -zak_cfc * ( trb(ji,jj,1,jn) - zca_cfc ) &
  156. #if defined key_degrad
  157. & * facvol(ji,jj,1) &
  158. #endif
  159. & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) )
  160. ! Add the surface flux to the trend
  161. tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + qtr_cfc(ji,jj,jl) / fse3t(ji,jj,1)
  162. ! cumulation of surface flux at each time step
  163. qint_cfc(ji,jj,jl) = qint_cfc(ji,jj,jl) + qtr_cfc(ji,jj,jl) * rdt
  164. ! !----------------!
  165. END DO ! end i-j loop !
  166. END DO !----------------!
  167. ! !----------------!
  168. END DO ! end CFC loop !
  169. !
  170. IF( lrst_trc ) THEN
  171. IF(lwp) WRITE(numout,*)
  172. IF(lwp) WRITE(numout,*) 'trc_sms_cfc : cumulated input function fields written in ocean restart file ', &
  173. & 'at it= ', kt,' date= ', ndastp
  174. IF(lwp) WRITE(numout,*) '~~~~'
  175. jl = 0
  176. DO jn = jp_cfc0, jp_cfc1
  177. jl = jl + 1
  178. CALL iom_rstput( kt, nitrst, numrtw, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jl) )
  179. END DO
  180. ENDIF
  181. !
  182. IF( lk_iomput ) THEN
  183. jl = 0
  184. DO jn = jp_cfc0, jp_cfc1
  185. jl = jl + 1
  186. CALL iom_put( 'qtr_'//TRIM(ctrcnm(jn)) , qtr_cfc (:,:,jl) )
  187. CALL iom_put( 'qint_'//TRIM(ctrcnm(jn)), qint_cfc(:,:,jl) )
  188. ENDDO
  189. ELSE
  190. IF( ln_diatrc ) THEN
  191. jl = 0
  192. DO jn = jp_cfc0_2d, jp_cfc1_2d, 2
  193. jl = jl + 1
  194. trc2d(:,:,jn ) = qtr_cfc (:,:,jl)
  195. trc2d(:,:,jn + 1) = qint_cfc(:,:,jl)
  196. ENDDO
  197. END IF
  198. END IF
  199. !
  200. IF( l_trdtrc ) THEN
  201. DO jn = jp_cfc0, jp_cfc1
  202. CALL trd_trc( tra(:,:,:,jn), jn, jptra_sms, kt ) ! save trends
  203. END DO
  204. END IF
  205. !
  206. IF( nn_timing == 1 ) CALL timing_stop('trc_sms_cfc')
  207. !
  208. END SUBROUTINE trc_sms_cfc
  209. SUBROUTINE cfc_init
  210. !!---------------------------------------------------------------------
  211. !! *** cfc_init ***
  212. !!
  213. !! ** Purpose : sets constants for CFC model
  214. !!---------------------------------------------------------------------
  215. INTEGER :: jn, jl
  216. !!----------------------------------------------------------------------
  217. !
  218. jn = 0
  219. ! coefficient for CFC11
  220. !----------------------
  221. if ( lp_cfc11 ) then
  222. jn = jn + 1
  223. ! Solubility
  224. soa(1,jn) = -229.9261
  225. soa(2,jn) = 319.6552
  226. soa(3,jn) = 119.4471
  227. soa(4,jn) = -1.39165
  228. sob(1,jn) = -0.142382
  229. sob(2,jn) = 0.091459
  230. sob(3,jn) = -0.0157274
  231. ! Schmidt number
  232. sca(1,jn) = 3579.2
  233. sca(2,jn) = -222.63
  234. sca(3,jn) = 7.5749
  235. sca(4,jn) = -0.14595
  236. sca(5,jn) = 0.0011874
  237. ! atm. concentration
  238. atm_cfc(:,:,jn) = p_cfc(:,:,1)
  239. endif
  240. ! coefficient for CFC12
  241. !----------------------
  242. if ( lp_cfc12 ) then
  243. jn = jn + 1
  244. ! Solubility
  245. soa(1,jn) = -218.0971
  246. soa(2,jn) = 298.9702
  247. soa(3,jn) = 113.8049
  248. soa(4,jn) = -1.39165
  249. sob(1,jn) = -0.143566
  250. sob(2,jn) = 0.091015
  251. sob(3,jn) = -0.0153924
  252. ! schmidt number
  253. sca(1,jn) = 3828.1
  254. sca(2,jn) = -249.86
  255. sca(3,jn) = 8.7603
  256. sca(4,jn) = -0.1716
  257. sca(5,jn) = 0.001408
  258. ! atm. concentration
  259. atm_cfc(:,:,jn) = p_cfc(:,:,2)
  260. endif
  261. ! coefficient for SF6
  262. !----------------------
  263. if ( lp_sf6 ) then
  264. jn = jn + 1
  265. ! Solubility
  266. soa(1,jn) = -80.0343
  267. soa(2,jn) = 117.232
  268. soa(3,jn) = 29.5817
  269. soa(4,jn) = 0.0
  270. sob(1,jn) = 0.0335183
  271. sob(2,jn) = -0.0373942
  272. sob(3,jn) = 0.00774862
  273. ! schmidt number
  274. sca(1,jn) = 3177.5
  275. sca(2,jn) = -200.57
  276. sca(3,jn) = 6.8865
  277. sca(4,jn) = -0.13335
  278. sca(5,jn) = 0.0010877
  279. ! atm. concentration
  280. atm_cfc(:,:,jn) = p_cfc(:,:,3)
  281. endif
  282. IF( ln_rsttr ) THEN
  283. IF(lwp) WRITE(numout,*)
  284. IF(lwp) WRITE(numout,*) ' Read specific variables from CFC model '
  285. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  286. !
  287. jl = 0
  288. DO jn = jp_cfc0, jp_cfc1
  289. jl = jl + 1
  290. CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jl) )
  291. END DO
  292. ENDIF
  293. IF(lwp) WRITE(numout,*)
  294. !
  295. END SUBROUTINE cfc_init
  296. INTEGER FUNCTION trc_sms_cfc_alloc()
  297. !!----------------------------------------------------------------------
  298. !! *** ROUTINE trc_sms_cfc_alloc ***
  299. !!----------------------------------------------------------------------
  300. ALLOCATE( xphem (jpi,jpj) , atm_cfc(jpyear,jphem,jp_cfc) , &
  301. & qtr_cfc (jpi,jpj,jp_cfc) , qint_cfc(jpi,jpj,jp_cfc) , &
  302. & soa(4,jp_cfc) , sob(3,jp_cfc) , sca(5,jp_cfc) , &
  303. & STAT=trc_sms_cfc_alloc )
  304. !
  305. IF( trc_sms_cfc_alloc /= 0 ) CALL ctl_warn('trc_sms_cfc_alloc : failed to allocate arrays.')
  306. !
  307. END FUNCTION trc_sms_cfc_alloc
  308. #else
  309. !!----------------------------------------------------------------------
  310. !! Dummy module No CFC tracers
  311. !!----------------------------------------------------------------------
  312. CONTAINS
  313. SUBROUTINE trc_sms_cfc( kt ) ! Empty routine
  314. WRITE(*,*) 'trc_sms_cfc: You should not have seen this print! error?', kt
  315. END SUBROUTINE trc_sms_cfc
  316. #endif
  317. !!======================================================================
  318. END MODULE trcsms_cfc