seddsr.F90 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. MODULE seddsr
  2. #if defined key_sed
  3. !!======================================================================
  4. !! *** MODULE seddsr ***
  5. !! Sediment : dissolution and reaction in pore water
  6. !!=====================================================================
  7. !! * Modules used
  8. USE sed ! sediment global variable
  9. USE sedmat ! linear system of equations
  10. USE sedco3 ! carbonate ion and proton concentration
  11. PUBLIC sed_dsr
  12. !! * Module variables
  13. REAL(wp), DIMENSION(:), ALLOCATABLE, PUBLIC :: cons_o2
  14. REAL(wp), DIMENSION(:), ALLOCATABLE, PUBLIC :: cons_no3
  15. REAL(wp), DIMENSION(:), ALLOCATABLE, PUBLIC :: sour_no3
  16. REAL(wp), DIMENSION(:), ALLOCATABLE, PUBLIC :: sour_c13
  17. REAL(wp), DIMENSION(:), ALLOCATABLE, PUBLIC :: dens_mol_wgt ! molecular density
  18. !! $Id: seddsr.F90 2355 2015-05-20 07:11:50Z ufla $
  19. CONTAINS
  20. SUBROUTINE sed_dsr( kt )
  21. !!----------------------------------------------------------------------
  22. !! *** ROUTINE sed_dsr ***
  23. !!
  24. !! ** Purpose : computes pore water dissolution and reaction
  25. !!
  26. !! ** Methode : implicit simultaneous computation of undersaturation
  27. !! resulting from diffusive pore water transport and chemical
  28. !! pore water reactions. Solid material is consumed according
  29. !! to redissolution and remineralisation
  30. !!
  31. !! ** Remarks :
  32. !! - undersaturation : deviation from saturation concentration
  33. !! - reaction rate : sink of undersaturation from dissolution
  34. !! of solid material
  35. !!
  36. !! History :
  37. !! ! 98-08 (E. Maier-Reimer, Christoph Heinze ) Original code
  38. !! ! 04-10 (N. Emprin, M. Gehlen ) f90
  39. !! ! 06-04 (C. Ethe) Re-organization
  40. !!----------------------------------------------------------------------
  41. !! Arguments
  42. INTEGER, INTENT(in) :: kt ! number of iteration
  43. ! --- local variables
  44. INTEGER :: ji, jk, js, jw ! dummy looop indices
  45. INTEGER :: nv ! number of variables in linear tridiagonal eq
  46. REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zrearat ! reaction rate in pore water
  47. REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zundsat ! undersaturation ; indice jpwatp1 is for calcite
  48. REAL(wp), DIMENSION(: ), ALLOCATABLE :: zmo2_0, zmo2_1 ! temp. array for mass balance calculation
  49. REAL(wp), DIMENSION(: ), ALLOCATABLE :: zmno3_0, zmno3_1, zmno3_2
  50. REAL(wp), DIMENSION(: ), ALLOCATABLE :: zmc13_0, zmc13_1, zmc13_2, zmc13_3
  51. REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zvolc ! temp. variables
  52. REAL(wp) :: zsolid1, zsolid2, zsolid3, zvolw, zreasat
  53. !!
  54. !!----------------------------------------------------------------------
  55. IF( kt == nitsed000 ) THEN
  56. WRITE(numsed,*) ' sed_dsr : Dissolution reaction '
  57. WRITE(numsed,*) ' '
  58. !
  59. ALLOCATE( dens_mol_wgt((jpoce) )
  60. dens_mol_wgt(1:jpsol) = dens / mol_wgt(1:jpsol)
  61. !
  62. ALLOCATE( cons_o2 (jpoce) ) ; ALLOCATE( cons_no3(jpoce) )
  63. ALLOCATE( sour_no3(jpoce) ) ; ALLOCATE( sour_c13(jpoce) )
  64. ENDIF
  65. ! Initialization of data for mass balance calculation
  66. !---------------------------------------------------
  67. tokbot(:,:) = 0.
  68. cons_o2 (:) = 0.
  69. cons_no3(:) = 0.
  70. sour_no3(:) = 0.
  71. sour_c13(:) = 0.
  72. ! Initializations
  73. !----------------------
  74. ALLOCATE( zmo2_0 (jpoce) ) ; ALLOCATE( zmo2_1 (jpoce) )
  75. ALLOCATE( zmno3_0(jpoce) ) ; ALLOCATE( zmno3_1(jpoce) ) ; ALLOCATE( zmno3_2(jpoce) )
  76. ALLOCATE( zmc13_0(jpoce) ) ; ALLOCATE( zmc13_1(jpoce) ) ; ALLOCATE( zmc13_2(jpoce) ) ; ALLOCATE( zmc13_3(jpoce) )
  77. zmo2_0 (:) = 0. ; zmo2_1 (:) = 0.
  78. zmno3_0(:) = 0. ; zmno3_1(:) = 0. ; zmno3_2(:) = 0.
  79. zmc13_0(:) = 0. ; zmc13_1(:) = 0. ; zmc13_2(:) = 0. ; zmc13_3(:) = 0.
  80. ALLOCATE( zrearat(jpoce,jpksed,3) ) ; ALLOCATE( zundsat(jpoce,jpksed,3) )
  81. zrearat(:,:,:) = 0. ; zundsat(:,:,:) = 0.
  82. ALLOCATE( zvolc(jpoce,jpksed,jpsol) )
  83. zvolc(:,:,:) = 0.
  84. !--------------------------------------------------------------------
  85. ! Temporary accomodation to take account of particule rain deposition
  86. !---------------------------------------------------------------------
  87. ! 1. Change of geometry
  88. ! Increase of dz3d(2) thickness : dz3d(2) = dz3d(2)+dzdep
  89. ! Warning : no change for dz(2)
  90. !---------------------------------------------------------
  91. dz3d(1:jpoce,2) = dz3d(1:jpoce,2) + dzdep(1:jpoce)
  92. ! New values for volw3d(:,2) and vols3d(:,2)
  93. ! Warning : no change neither for volw(2) nor vols(2)
  94. !------------------------------------------------------
  95. volw3d(1:jpoce,2) = dz3d(1:jpoce,2) * por(2)
  96. vols3d(1:jpoce,2) = dz3d(1:jpoce,2) * por1(2)
  97. ! Conversion of volume units
  98. !----------------------------
  99. DO js = 1, jpsol
  100. DO jk = 1, jpksed
  101. DO ji = 1, jpoce
  102. zvolc(ji,jk,js) = ( vols3d(ji,jk) * dens_mol_wgt(js) ) / &
  103. & ( volw3d(ji,jk) * 1.e-3 )
  104. ENDDO
  105. ENDDO
  106. ENDDO
  107. ! 2. Change of previous solid fractions (due to volum changes) for k=2
  108. !---------------------------------------------------------------------
  109. DO js = 1, jpsol
  110. DO ji = 1, jpoce
  111. solcp(ji,2,js) = solcp(ji,2,js) * dz(2) / dz3d(ji,2)
  112. ENDDO
  113. END DO
  114. ! 3. New solid fractions (including solid rain fractions) for k=2
  115. !------------------------------------------------------------------
  116. DO js = 1, jpsol
  117. DO ji = 1, jpoce
  118. solcp(ji,2,js) = solcp(ji,2,js) + &
  119. & ( rainrg(ji,js) / raintg(ji) ) * ( dzdep(ji) / dz3d(ji,2) )
  120. ! rainrm are temporary cancel
  121. rainrm(ji,js) = 0.
  122. END DO
  123. ENDDO
  124. ! 4. Adjustment of bottom water concen.(pwcp(1)):
  125. ! We impose that pwcp(2) is constant. Including dzdep in dz3d(:,2) we assume
  126. ! that dzdep has got a porosity of por(2). So pore water volum of jk=2 increase.
  127. ! To keep pwcp(2) cste we must compensate this "increase" by a slight adjusment
  128. ! of bottom water concentration.
  129. ! This adjustment is compensate at the end of routine
  130. !-------------------------------------------------------------
  131. DO jw = 1, jpwat
  132. DO ji = 1, jpoce
  133. pwcp(ji,1,jw) = pwcp(ji,1,jw) - &
  134. & pwcp(ji,2,jw) * dzdep(ji) * por(2) / dzkbot(ji)
  135. END DO
  136. ENDDO
  137. !----------------------------------------------------------
  138. ! 5. Beginning of Pore Water diffusion and solid reaction
  139. !---------------------------------------------------------
  140. !-----------------------------------------------------------------------------
  141. ! For jk=2,jpksed, and for couple
  142. ! 1 : jwsil/jsopal ( SI/Opal )
  143. ! 2 : jsclay/jsclay ( clay/clay )
  144. ! 3 : jwoxy/jspoc ( O2/POC )
  145. ! reaction rate is a function of solid=concentration in solid reactif in [mol/l]
  146. ! and undersaturation in [mol/l].
  147. ! Solid weight fractions should be in ie [mol/l])
  148. ! second member and solution are in zundsat variable
  149. !-------------------------------------------------------------------------
  150. !number of variables
  151. nv = 3
  152. DO jk = 1, jpksed
  153. DO ji = 1, jpoce
  154. ! For Silicic Acid and clay
  155. zundsat(ji,jk,1) = sat_sil - pwcp(ji,jk,jwsil)
  156. zundsat(ji,jk,2) = sat_clay
  157. ! For O2
  158. zundsat(ji,jk,3) = pwcp(ji,jk,jwoxy) / so2ut
  159. ENDDO
  160. ENDDO
  161. ! Definition of reaction rates [rearat]=sans dim
  162. ! For jk=1 no reaction (pure water without solid) for each solid compo
  163. DO ji = 1, jpoce
  164. zrearat(ji,1,:) = 0.
  165. ENDDO
  166. ! left hand side of coefficient matrix
  167. DO jk = 2, jpksed
  168. DO ji = 1, jpoce
  169. zsolid1 = zvolc(ji,jk,jsopal) * solcp(ji,jk,jsopal)
  170. zsolid2 = zvolc(ji,jk,jsclay) * solcp(ji,jk,jsclay)
  171. zsolid3 = zvolc(ji,jk,jspoc) * solcp(ji,jk,jspoc)
  172. zrearat(ji,jk,1) = ( reac_sil * dtsed * zsolid1 ) / &
  173. & ( 1. + reac_sil * dtsed * zundsat(ji,jk,1 ) )
  174. zrearat(ji,jk,2) = ( reac_clay * dtsed * zsolid2 ) / &
  175. & ( 1. + reac_clay * dtsed * zundsat(ji,jk,2 ) )
  176. zrearat(ji,jk,3) = ( reac_poc * dtsed * zsolid3 ) / &
  177. & ( 1. + reac_poc * dtsed * zundsat(ji,jk,3 ) )
  178. ENDDO
  179. ENDDO
  180. CALL sed_mat( nv, jpoce, jpksed, zrearat, zundsat )
  181. ! New solid concentration values (jk=2 to jksed) for each couple
  182. DO js = 1, nv
  183. DO jk = 2, jpksed
  184. DO ji = 1, jpoce
  185. zreasat = zrearat(ji,jk,js) * zundsat(ji,jk,js) / zvolc(ji,jk,js)
  186. solcp(ji,jk,js) = solcp(ji,jk,js) - zreasat
  187. ENDDO
  188. ENDDO
  189. ENDDO
  190. ! mass of O2/NO3 before POC remin. for mass balance check
  191. ! det. of o2 consomation/NO3 production Mc13
  192. DO jk = 1, jpksed
  193. DO ji = 1, jpoce
  194. zvolw = volw3d(ji,jk) * 1.e-3
  195. zmo2_0 (ji) = zmo2_0 (ji) + pwcp(ji,jk,jwoxy) * zvolw
  196. zmno3_0(ji) = zmno3_0(ji) + pwcp(ji,jk,jwno3) * zvolw
  197. zmc13_0(ji) = zmc13_0(ji) + pwcp(ji,jk,jwc13) * zvolw
  198. ENDDO
  199. ENDDO
  200. ! New pore water concentrations
  201. DO jk = 1, jpksed
  202. DO ji = 1, jpoce
  203. ! Acid Silicic
  204. pwcp(ji,jk,jwsil) = sat_sil - zundsat(ji,jk,1)
  205. ! For O2 (in mol/l)
  206. pwcp(ji,jk,jwoxy) = zundsat(ji,jk,3) * so2ut
  207. zreasat = zrearat(ji,jk,3) * zundsat(ji,jk,3) ! oxygen
  208. ! For DIC
  209. pwcp(ji,jk,jwdic) = pwcp(ji,jk,jwdic) + zreasat
  210. ! For nitrates
  211. pwcp(ji,jk,jwno3) = pwcp(ji,jk,jwno3) + zreasat * srno3
  212. ! For Phosphate (in mol/l)
  213. pwcp(ji,jk,jwpo4) = pwcp(ji,jk,jwpo4) + zreasat * spo4r
  214. ! For alkalinity
  215. pwcp(ji,jk,jwalk) = pwcp(ji,jk,jwalk) - zreasat * ( srno3 + 2.* spo4r )
  216. ! For DIC13
  217. pwcp(ji,jk,jwc13) = pwcp(ji,jk,jwc13) + zreasat * rc13P * pdb
  218. ENDDO
  219. ENDDO
  220. ! Mass of O2 for mass balance check and det. of o2 consomation
  221. DO jk = 1, jpksed
  222. DO ji = 1, jpoce
  223. zvolw = volw3d(ji,jk) * 1.e-3
  224. zmo2_1 (ji) = zmo2_1 (ji) + pwcp(ji,jk,jwoxy) * zvolw
  225. zmno3_1(ji) = zmno3_1(ji) + pwcp(ji,jk,jwno3) * zvolw
  226. zmc13_1(ji) = zmc13_1(ji) + pwcp(ji,jk,jwc13) * zvolw
  227. ENDDO
  228. ENDDO
  229. DO ji = 1, jpoce
  230. cons_o2 (ji) = zmo2_0 (ji) - zmo2_1 (ji)
  231. sour_no3(ji) = zmno3_1(ji) - zmno3_0(ji)
  232. sour_c13(ji) = zmc13_1(ji) - zmc13_0(ji)
  233. ENDDO
  234. !--------------------------------------------------------------------
  235. ! Begining POC denitrification and NO3- diffusion
  236. ! (indice n°5 for couple POC/NO3- ie solcp(:,:,jspoc)/pwcp(:,:,jwno3))
  237. !--------------------------------------------------------------------
  238. nv = 1
  239. DO jk = 1, jpksed
  240. DO ji = 1, jpoce
  241. zundsat(ji,jk,1) = pwcp(ji,jk,jwno3) / srDnit
  242. ENDDO
  243. ENDDO
  244. DO jk = 2, jpksed
  245. DO ji = 1, jpoce
  246. IF( pwcp(ji,jk,jwoxy) < sthrO2 ) THEN
  247. zsolid1 = zvolc(ji,jk,jspoc) * solcp(ji,jk,jspoc)
  248. zrearat(ji,jk,1) = ( reac_no3 * dtsed * zsolid1 ) / &
  249. & ( 1. + reac_no3 * dtsed * zundsat(ji,jk,1 ) )
  250. ELSE
  251. zrearat(ji,jk,1) = 0.
  252. ENDIF
  253. END DO
  254. END DO
  255. ! solves tridiagonal system
  256. CALL sed_mat( nv, jpoce, jpksed, zrearat, zundsat )
  257. ! New solid concentration values (jk=2 to jksed) for each couple
  258. DO jk = 2, jpksed
  259. DO ji = 1, jpoce
  260. zreasat = zrearat(ji,jk,1) * zundsat(ji,jk,1) / zvolc(ji,jk,jspoc)
  261. solcp(ji,jk,jspoc) = solcp(ji,jk,jspoc) - zreasat
  262. ENDDO
  263. ENDDO
  264. ! New dissolved concentrations
  265. DO jk = 1, jpksed
  266. DO ji = 1, jpoce
  267. zreasat = zrearat(ji,jk,1) * zundsat(ji,jk,1)
  268. ! For nitrates
  269. pwcp(ji,jk,jwno3) = zundsat(ji,jk,1) * srDnit
  270. ! For DIC
  271. pwcp(ji,jk,jwdic) = pwcp(ji,jk,jwdic) + zreasat
  272. ! For Phosphate (in mol/l)
  273. pwcp(ji,jk,jwpo4) = pwcp(ji,jk,jwpo4) + zreasat * spo4r
  274. ! For alkalinity
  275. pwcp(ji,jk,jwalk) = pwcp(ji,jk,jwalk) + zreasat * ( srDnit - 2.* spo4r )
  276. ! For DIC13
  277. pwcp(ji,jk,jwc13) = pwcp(ji,jk,jwc13) + zreasat * rc13P * pdb
  278. ENDDO
  279. ENDDO
  280. ! Mass of O2 for mass balance check and det. of o2 consomation
  281. DO jk = 1, jpksed
  282. DO ji = 1, jpoce
  283. zvolw = volw3d(ji,jk) * 1.e-3
  284. zmno3_2(ji) = zmno3_2(ji) + pwcp(ji,jk ,jwno3) * zvolw
  285. zmc13_2(ji) = zmc13_2(ji) + pwcp(ji,jk ,jwc13) * zvolw
  286. ENDDO
  287. ENDDO
  288. DO ji = 1, jpoce
  289. cons_no3(ji) = zmno3_1(ji) - zmno3_2(ji)
  290. sour_c13(ji) = sour_c13(ji) + zmc13_2(ji) - zmc13_1(ji)
  291. ENDDO
  292. !---------------------------
  293. ! Solves PO4 diffusion
  294. !----------------------------
  295. nv = 1
  296. DO jk = 1, jpksed
  297. DO ji = 1, jpoce
  298. zundsat(ji,jk,1) = pwcp(ji,jk,jwpo4)
  299. zrearat(ji,jk,1) = 0.
  300. ENDDO
  301. ENDDO
  302. ! solves tridiagonal system
  303. CALL sed_mat( nv, jpoce, jpksed, zrearat, zundsat )
  304. ! New undsaturation values and dissolved concentrations
  305. DO jk = 1, jpksed
  306. DO ji = 1, jpoce
  307. pwcp(ji,jk,jwpo4) = zundsat(ji,jk,1)
  308. ENDDO
  309. ENDDO
  310. !---------------------------------------------------------------
  311. ! Performs CaCO3 particle deposition and redissolution (indice 9)
  312. !--------------------------------------------------------------
  313. ! computes co3por from the updated pwcp concentrations (note [co3por] = mol/l)
  314. CALL sed_co3( kt )
  315. nv = 1
  316. ! *densSW(l)**2 converts aksps [mol2/kg sol2] into [mol2/l2] to get [undsat] in [mol/l]
  317. DO jk = 1, jpksed
  318. DO ji = 1, jpoce
  319. zundsat(ji,jk,1) = aksps(ji) * densSW(ji) * densSW(ji) / calcon2(ji) &
  320. & - co3por(ji,jk)
  321. ! positive values of undersaturation
  322. zundsat(ji,jk,1) = MAX( 0., zundsat(ji,jk,1) )
  323. ENDDO
  324. ENDDO
  325. DO jk = 2, jpksed
  326. DO ji = 1, jpoce
  327. zsolid1 = zvolc(ji,jk,jscal) * solcp(ji,jk,jscal)
  328. zrearat(ji,jk,1) = ( reac_cal * dtsed * zsolid1 ) / &
  329. & ( 1. + reac_cal * dtsed * zundsat(ji,jk,1) )
  330. END DO
  331. END DO
  332. ! solves tridiagonal system
  333. CALL sed_mat( nv, jpoce, jpksed, zrearat, zundsat )
  334. ! New solid concentration values (jk=2 to jksed) for cacO3
  335. DO jk = 2, jpksed
  336. DO ji = 1, jpoce
  337. zreasat = zrearat(ji,jk,1) * zundsat(ji,jk,1) / zvolc(ji,jk,jscal)
  338. solcp(ji,jk,jscal) = solcp(ji,jk,jscal) - zreasat
  339. ENDDO
  340. ENDDO
  341. ! New dissolved concentrations
  342. DO jk = 1, jpksed
  343. DO ji = 1, jpoce
  344. zreasat = zrearat(ji,jk,1) * zundsat(ji,jk,1)
  345. ! For DIC
  346. pwcp(ji,jk,jwdic) = pwcp(ji,jk,jwdic) + zreasat
  347. ! For alkalinity
  348. pwcp(ji,jk,jwalk) = pwcp(ji,jk,jwalk) + 2.* zreasat
  349. ! For DIC13
  350. pwcp(ji,jk,jwc13) = pwcp(ji,jk,jwc13) + zreasat * rc13Ca * pdb
  351. ENDDO
  352. ENDDO
  353. DO jk = 1, jpksed
  354. DO ji = 1, jpoce
  355. zmc13_3(ji) = zmc13_3(ji) + pwcp(ji,jk,jwc13) * volw3d(ji,jk) * 1.e-3
  356. ENDDO
  357. ENDDO
  358. DO ji = 1, jpoce
  359. sour_c13(ji) = sour_c13(ji) + zmc13_3(ji) - zmc13_2(ji)
  360. ENDDO
  361. !-------------------------------------------------
  362. ! Beginning DIC, Alkalinity and DIC13 diffusion
  363. !-------------------------------------------------
  364. nv = 3
  365. DO jk = 1, jpksed
  366. DO ji = 1, jpoce
  367. zundsat(ji,jk,1) = pwcp(ji,jk,jwdic)
  368. zundsat(ji,jk,2) = pwcp(ji,jk,jwalk)
  369. zundsat(ji,jk,3) = pwcp(ji,jk,jwc13)
  370. zrearat(ji,jk,1) = 0.
  371. zrearat(ji,jk,2) = 0.
  372. zrearat(ji,jk,3) = 0.
  373. ENDDO
  374. ENDDO
  375. ! solves tridiagonal system
  376. CALL sed_mat( nv, jpoce, jpksed, zrearat, zundsat )
  377. ! New dissolved concentrations
  378. DO jk = 1, jpksed
  379. DO ji = 1, jpoce
  380. pwcp(ji,jk,jwdic) = zundsat(ji,jk,1)
  381. pwcp(ji,jk,jwalk) = zundsat(ji,jk,2)
  382. pwcp(ji,jk,jwc13) = zundsat(ji,jk,3)
  383. ENDDO
  384. ENDDO
  385. !----------------------------------
  386. ! Back to initial geometry
  387. !-----------------------------
  388. !---------------------------------------------------------------------
  389. ! 1/ Compensation for ajustement of the bottom water concentrations
  390. ! (see note n° 1 about *por(2))
  391. !--------------------------------------------------------------------
  392. DO jw = 1, jpwat
  393. DO ji = 1, jpoce
  394. pwcp(ji,1,jw) = pwcp(ji,1,jw) + &
  395. & pwcp(ji,2,jw) * dzdep(ji) * por(2) / dzkbot(ji)
  396. END DO
  397. ENDDO
  398. !-----------------------------------------------------------------------
  399. ! 2/ Det of new rainrg taking account of the new weight fraction obtained
  400. ! in dz3d(2) after diffusion/reaction (react/diffu are also in dzdep!)
  401. ! This new rain (rgntg rm) will be used in advection/burial routine
  402. !------------------------------------------------------------------------
  403. DO js = 1, jpsol
  404. DO ji = 1, jpoce
  405. rainrg(ji,js) = raintg(ji) * solcp(ji,2,js)
  406. rainrm(ji,js) = rainrg(ji,js) / mol_wgt(js)
  407. END DO
  408. ENDDO
  409. ! New raintg
  410. raintg(:) = 0.
  411. DO js = 1, jpsol
  412. DO ji = 1, jpoce
  413. raintg(ji) = raintg(ji) + rainrg(ji,js)
  414. END DO
  415. ENDDO
  416. !--------------------------------
  417. ! 3/ back to initial geometry
  418. !--------------------------------
  419. DO ji = 1, jpoce
  420. dz3d (ji,2) = dz(2)
  421. volw3d(ji,2) = dz3d(ji,2) * por(2)
  422. vols3d(ji,2) = dz3d(ji,2) * por1(2)
  423. ENDDO
  424. !----------------------------------------------------------------------
  425. ! 4/ Saving new amount of material in dzkbot for mass balance check
  426. ! tokbot in [mol] (implicit *1cm*1cm for spacial dim)
  427. !----------------------------------------------------------------------
  428. DO jw = 1, jpwat
  429. DO ji = 1, jpoce
  430. tokbot(ji,jw) = pwcp(ji,1,jw) * 1.e-3 * dzkbot(ji)
  431. END DO
  432. ENDDO
  433. DEALLOCATE( zmo2_0 ) ; DEALLOCATE( zmno3_1 ) ; DEALLOCATE( zmno3_2 )
  434. DEALLOCATE( zmc13_0 ) ; DEALLOCATE( zmc13_1 ) ; DEALLOCATE( zmc13_2 ) ; DEALLOCATE( zmc13_3 )
  435. DEALLOCATE( zrearat ) ; DEALLOCATE( zundsat ) ; DEALLOCATE( zvolc )
  436. END SUBROUTINE sed_dsr
  437. #else
  438. !!======================================================================
  439. !! MODULE seddsr : Dummy module
  440. !!======================================================================
  441. !! $Id: seddsr.F90 2355 2015-05-20 07:11:50Z ufla $
  442. CONTAINS
  443. SUBROUTINE sed_dsr ( kt )
  444. INTEGER, INTENT(in) :: kt
  445. WRITE(*,*) 'sed_dsr: You should not have seen this print! error?', kt
  446. END SUBROUTINE sed_dsr
  447. #endif
  448. END MODULE seddsr