sedchem.F90 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. MODULE sedchem
  2. #if defined key_sed
  3. !!======================================================================
  4. !! *** Module sedchem ***
  5. !! sediment : Variable for chemistry of the CO2 cycle
  6. !!======================================================================
  7. !! modules used
  8. USE sed ! sediment global variable
  9. USE sedarr
  10. !! * Accessibility
  11. PUBLIC sed_chem
  12. !! * Module variables
  13. REAL(wp) :: &
  14. salchl = 1./1.80655 , & ! conversion factor for salinity --> chlorinity (Wooster et al. 1969)
  15. calcon = 1.03E-2 ! mean calcite concentration [Ca2+] in sea water [mole/kg solution]
  16. REAL(wp) :: & ! coeff. for 1. dissoc. of carbonic acid (Millero, 1995)
  17. c10 = 3670.7 , &
  18. c11 = 62.008 , &
  19. c12 = 9.7944 , &
  20. c13 = 0.0118 , &
  21. c14 = 0.000116
  22. REAL(wp) :: & ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995)
  23. c20 = 1394.7 , &
  24. c21 = 4.777 , &
  25. c22 = 0. , &
  26. c23 = 0.0184 , &
  27. c24 = 0.000118
  28. REAL(wp) :: & ! coeff. for 1. dissoc. of boric acid (Dickson and Goyet, 1994)
  29. cb0 = -8966.90, &
  30. cb1 = -2890.53, &
  31. cb2 = -77.942 , &
  32. cb3 = 1.728 , &
  33. cb4 = -0.0996 , &
  34. cb5 = 148.0248, &
  35. cb6 = 137.1942, &
  36. cb7 = 1.62142 , &
  37. cb8 = -24.4344, &
  38. cb9 = -25.085 , &
  39. cb10 = -0.2474 , &
  40. cb11 = 0.053105
  41. REAL(wp) :: & ! borat constants
  42. bor1 = 0.000232, &
  43. bor2 = 1./10.811
  44. REAL(wp) :: & ! constants for calculate concentrations
  45. st1 = 0.14 , & ! for sulfate (Morris & Riley 1966)
  46. st2 = 1./96.062, &
  47. ks0 = 141.328 , &
  48. ks1 = -4276.1 , &
  49. ks2 = -23.093 , &
  50. ks3 = -13856. , &
  51. ks4 = 324.57 , &
  52. ks5 = -47.986 , &
  53. ks6 = 35474. , &
  54. ks7 = -771.54 , &
  55. ks8 = 114.723 , &
  56. ks9 = -2698. , &
  57. ks10 = 1776. , &
  58. ks11 = 1. , &
  59. ks12 = -0.001005
  60. REAL(wp) :: & ! constants for calculate concentrations
  61. ft1 = 0.000067 , & ! fluorides (Dickson & Riley 1979 )
  62. ft2 = 1./18.9984 , &
  63. kf0 = -12.641 , &
  64. kf1 = 1590.2 , &
  65. kf2 = 1.525 , &
  66. kf3 = 1.0 , &
  67. kf4 =-0.001005
  68. REAL(wp) :: & ! coeff. for dissoc. of water (Dickson and Riley, 1979 )
  69. cw0 = -13847.26 , &
  70. cw1 = 148.9802 , &
  71. cw2 = -23.6521 , &
  72. cw3 = 118.67 , &
  73. cw4 = -5.977 , &
  74. cw5 = 1.0495 , &
  75. cw6 = -0.01615
  76. REAL(wp) :: & ! coeff. for dissoc. of phosphate (Millero (1974)
  77. cp10 = 115.54 , &
  78. cp11 = -4576.752 , &
  79. cp12 = -18.453 , &
  80. cp13 = -106.736 , &
  81. cp14 = 0.69171 , &
  82. cp15 = -0.65643 , &
  83. cp16 = -0.01844 , &
  84. cp20 = 172.1033 , &
  85. cp21 = -8814.715 , &
  86. cp22 = -27.927 , &
  87. cp23 = -160.340 , &
  88. cp24 = 1.3566 , &
  89. cp25 = 0.37335 , &
  90. cp26 = -0.05778 , &
  91. cp30 = -18.126 , &
  92. cp31 = -3070.75 , &
  93. cp32 = 17.27039 , &
  94. cp33 = 2.81197 , &
  95. cp34 = -44.99486 , &
  96. cp35 = -0.09984
  97. REAL(wp) :: & ! coeff. for dissoc. of silicates (Millero (1974)
  98. cs10 = 117.40 , &
  99. cs11 = -8904.2 , &
  100. cs12 = -19.334 , &
  101. cs13 = -458.79 , &
  102. cs14 = 3.5913 , &
  103. cs15 = 188.74 , &
  104. cs16 = -1.5998 , &
  105. cs17 = -12.1652 , &
  106. cs18 = 0.07871 , &
  107. cs19 = 0. , &
  108. cs20 = 1. , &
  109. cs21 = -0.001005
  110. REAL(wp) :: & ! coeff. for apparent solubility equilibrium
  111. ! akcc1 = -34.452 , & ! of calcite (Ingle,1975, 1800, eq. 6)
  112. ! akcc2 = -39.866 , &
  113. ! akcc3 = 110.21 , &
  114. ! akcc4 = -7.5752E-6
  115. akcc1 = -171.9065 , & ! Millero et al. 1995 from Mucci 1983
  116. akcc2 = -0.077993 , &
  117. akcc3 = 2839.319 , &
  118. akcc4 = 71.595 , &
  119. akcc5 = -0.77712 , &
  120. akcc6 = 0.0028426 , &
  121. akcc7 = 178.34 , &
  122. akcc8 = -0.07711 , &
  123. akcc9 = 0.0041249
  124. REAL(wp) :: & ! universal gas constant
  125. rgas = 83.145 ! bar.cm3/(mol.K) or R=8.31451 J/(g.mol.K)
  126. ! coeff. for seawater pressure correction (millero 95)
  127. REAL(wp), DIMENSION(8) :: &
  128. devk1, devk2, devk3, devk4, devk5
  129. DATA devk1/ -25.5 , -15.82 , -29.48 , -25.60 , -48.76 , -14.51 , -23.12 , -26.57 /
  130. DATA devk2/ 0.1271 , -0.0219 , 0.1622 , 0.2324 , -0.5304 , 0.1211 , 0.1758 , 0.2020 /
  131. DATA devk3/ 0. , 0. , 2.608E-3, -3.6246E-3, 0. , -0.321E-3, -2.647E-3, -3.042E-3/
  132. DATA devk4/-3.08E-3 , 1.13E-3 , -2.84E-3, -5.13E-3 , -11.76E-3 , -2.67E-3 , -5.15E-3 , -4.08E-3 /
  133. DATA devk5/0.0877E-3, -0.1475E-3, 0. , 0.0794E-3 , -0.3692E-3, 0.0427E-3, 0.09E-3 , 0.0714E-3/
  134. ! coeff. for density of sea water (Millero & Poisson 1981)
  135. REAL(wp), DIMENSION(5) :: Adsw
  136. DATA Adsw/8.24493E-1, -4.0899E-3, 7.6438E-5 , -8.246E-7, 5.3875E-9 /
  137. REAL(wp), DIMENSION(3) :: Bdsw
  138. DATA Bdsw / -5.72466E-3, 1.0227E-4, -1.6546E-6 /
  139. REAL(wp) :: Cdsw = 4.8314E-4
  140. REAL(wp), DIMENSION(6) :: Ddsw
  141. DATA Ddsw / 999.842594 , 6.793952E-2 , -9.095290E-3, 1.001685E-4, -1.120083E-6, 6.536332E-9/
  142. !! $Id: sedchem.F90 2355 2015-05-20 07:11:50Z ufla $
  143. CONTAINS
  144. SUBROUTINE sed_chem( kt )
  145. !!----------------------------------------------------------------------
  146. !! *** ROUTINE sed_chem ***
  147. !!
  148. !! ** Purpose : set chemical constants
  149. !!
  150. !! History :
  151. !! ! 04-10 (N. Emprin, M. Gehlen ) Original code
  152. !! ! 06-04 (C. Ethe) Re-organization
  153. !!----------------------------------------------------------------------
  154. !!* Arguments
  155. INTEGER, INTENT(in) :: kt ! time step
  156. #if ! defined key_sed_off
  157. INTEGER :: ji, jj, ikt
  158. REAL(wp) :: ztkel, ztc, ztc2, zpres, ztr
  159. REAL(wp) :: zsal, zsal2, zsqrt, zsal15
  160. REAL(wp) :: zis, zis2, zisqrt
  161. REAL(wp) :: zdens0, zaw, zbw, zcw
  162. REAL(wp) :: zbuf1, zbuf2
  163. REAL(wp) :: zcpexp, zcpexp2
  164. REAL(wp) :: zck1p, zck2p, zck3p, zcksi
  165. REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zchem_data
  166. #endif
  167. !!----------------------------------------------------------------------
  168. IF( MOD( kt - 1, nfreq ) /= 0 ) RETURN
  169. WRITE(numsed,*) ' Getting Chemical constants from tracer model at time kt = ', kt
  170. WRITE(numsed,*) ' '
  171. #if defined key_sed_off
  172. CALL sed_chem_off
  173. #else
  174. ! reading variables
  175. ALLOCATE( zchem_data(jpi,jpj,6) ) ; zchem_data(:,:,:) = 0.
  176. DO jj = 1,jpj
  177. DO ji = 1, jpi
  178. ikt = mbkt(ji,jj)
  179. IF ( tmask(ji,jj,ikt) == 1 ) THEN
  180. zchem_data(ji,jj,1) = ak13 (ji,jj,ikt)
  181. zchem_data(ji,jj,2) = ak23 (ji,jj,ikt)
  182. zchem_data(ji,jj,3) = akb3 (ji,jj,ikt)
  183. zchem_data(ji,jj,4) = akw3 (ji,jj,ikt)
  184. zchem_data(ji,jj,5) = aksp (ji,jj,ikt)
  185. zchem_data(ji,jj,6) = borat(ji,jj,ikt)
  186. ENDIF
  187. ENDDO
  188. ENDDO
  189. CALL pack_arr ( jpoce, ak1s (1:jpoce), zchem_data(1:jpi,1:jpj,1), iarroce(1:jpoce) )
  190. CALL pack_arr ( jpoce, ak2s (1:jpoce), zchem_data(1:jpi,1:jpj,2), iarroce(1:jpoce) )
  191. CALL pack_arr ( jpoce, akbs (1:jpoce), zchem_data(1:jpi,1:jpj,3), iarroce(1:jpoce) )
  192. CALL pack_arr ( jpoce, akws (1:jpoce), zchem_data(1:jpi,1:jpj,4), iarroce(1:jpoce) )
  193. CALL pack_arr ( jpoce, aksps (1:jpoce), zchem_data(1:jpi,1:jpj,5), iarroce(1:jpoce) )
  194. CALL pack_arr ( jpoce, borats(1:jpoce), zchem_data(1:jpi,1:jpj,6), iarroce(1:jpoce) )
  195. DEALLOCATE( zchem_data )
  196. DO ji = 1, jpoce
  197. ztkel = temp(ji) + 273.16
  198. ztc = temp(ji)
  199. ztc2 = ztc * ztc
  200. zpres = press(ji)
  201. ! zqtt = ztkel * 0.01
  202. zsal = salt(ji)
  203. zsal2 = zsal * zsal
  204. zsqrt = SQRT( zsal )
  205. zsal15 = zsqrt * zsal
  206. zlogt = LOG( ztkel )
  207. ztr = 1./ ztkel
  208. ! zis=ionic strength (ORNL/CDIAC-74, DOE 94,Dickson and Goyet)
  209. zis = 19.924 * zsal / ( 1000. - 1.005 * zsal )
  210. zis2 = zis * zis
  211. zisqrt = SQRT( zis )
  212. ! Density of Sea Water - F(temp,sal) [kg/m3]
  213. zdens0 = Ddsw(1) + Ddsw(2) * ztc + Ddsw(3) * ztc2 &
  214. + Ddsw(4) * ztc * ztc2 + Ddsw(5) * ztc2 * ztc2 &
  215. + Ddsw(6) * ztc * ztc2 * ztc2
  216. zaw = Adsw(1) + Adsw(2) * ztc + Adsw(3)* ztc2 + Adsw(4) * ztc * ztc2 &
  217. + Adsw(5) * ztc2 * ztc2
  218. zbw = Bdsw(1) + Bdsw(2) * ztc + Bdsw(3) * ztc2
  219. zcw = Cdsw
  220. densSW(ji) = zdens0 + zaw * zsal + zbw * zsal15 + zcw * zsal * zsal
  221. densSW(ji) = densSW(ji) * 1E-3 ! to get dens in [kg/l]
  222. ! FORMULA FOR CPEXP AFTER EDMOND AND GIESKES (1970)
  223. ! (REFERENCE TO CULBERSON AND PYTKOQICZ (1968) AS MADE IN BROECKER ET AL. (1982)
  224. ! IS INCORRECT; HERE RGAS IS TAKEN TENFOLD TO CORRECT FOR THE NOTATION OF pres IN
  225. ! DBAR INSTEAD OF BAR AND THE EXPRESSION FOR CPEXP IS MULTIPLIED BY LN(10.)
  226. ! TO ALLOW USE OF EXP-FUNCTION WITH BASIS E IN THE FORMULA FOR AKSPP
  227. ! (CF. EDMOND AND GIESKES (1970), P. 1285 AND P. 1286 (THE SMALL FORMULA ON P. 1286
  228. ! IS RIGHT AND CONSISTENT WITH THE SIGN IN PARTIAL MOLAR VOLUME CHANGE AS SHOWN ON P. 1285)
  229. !-----------------------------------------------------------------------------------------
  230. zcpexp = zpres / ( rgas*ztkel )
  231. zcpexp2 = zpres * zcpexp
  232. ! For Phodphates (phosphoric acid) (DOE 1994)
  233. !----------------------------------------------
  234. zck1p = cp10 + cp11*ztr + cp12*zlogt + ( cp13*ztr + cp14 ) * zsqrt &
  235. & + ( cp15*ztr + cp16 ) * zsal
  236. zck2p = cp20 + cp21*ztr + cp22*zlogt + ( cp23*ztr + cp24 ) * zsqrt &
  237. & + ( cp25*ztr + cp26 ) * zsal
  238. zck3p = cp30 + cp31*ztr + ( cp32*ztr + cp33 ) * zsqrt &
  239. & + ( cp34*ztr + cp35 ) * zsal
  240. ! For silicates (DOE 1994) change to mol/kg soln) (OCMIP)
  241. !--------------------------------------------------------
  242. zcksi = cs10 + cs11*ztr + cs12*zlogt + ( cs13*ztr + cs14) * zisqrt &
  243. & + ( cs15*ztr + cs16 ) * zis &
  244. & + ( cs17*ztr + cs18 ) * zis2 &
  245. & + LOG( 1. + cs19*zsal ) + LOG( cs20 + cs21*zsal )
  246. !K1, K2 of carbonic acid, KB of boric acid, KW (H2O)
  247. !---------------------------------------------------
  248. zak1p = EXP ( zck1p )
  249. zak2p = EXP ( zck2p )
  250. zak3p = EXP ( zck3p )
  251. zaksil = EXP ( zcksi )
  252. zbuf1 = - ( devk1(3) + devk2(3)*ztc + devk3(3)*ztc2 )
  253. zbuf2 = 0.5 * ( devk4(3) + devk5(3)*ztc )
  254. aksis(ji) = zaksil * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  255. zbuf1 = - ( devk1(6) + devk2(6)*ztc + devk3(6)*ztc2 )
  256. zbuf2 = 0.5 * ( devk4(6) + devk5(6)*ztc )
  257. ak1ps(ji) = zak1p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  258. zbuf1 = - ( devk1(7) + devk2(7)*ztc + devk3(7)*ztc2 )
  259. zbuf2 = 0.5 * ( devk4(7) + devk5(7)*ztc )
  260. ak2ps(ji) = zak2p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  261. zbuf1 = - ( devk1(8) + devk2(8)*ztc + devk3(8)*ztc2 )
  262. zbuf2 = 0.5 * ( devk4(8) + devk5(8)*ztc )
  263. ak3ps(ji) = zak3p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  264. ak12s (ji) = ak1s (ji) * ak2s (ji)
  265. ak12ps (ji) = ak1ps(ji) * ak2ps(ji)
  266. ak123ps(ji) = ak1ps(ji) * ak2ps(ji) * ak3ps(ji)
  267. calcon2(ji) = 0.01028 * ( salt(ji) / 35. ) * densSW(ji)
  268. ENDDO
  269. #endif
  270. END SUBROUTINE sed_chem
  271. #if defined key_sed_off
  272. SUBROUTINE sed_chem_off
  273. !!----------------------------------------------------------------------
  274. !! *** ROUTINE sed_chem_off ***
  275. !!
  276. !! ** Purpose : compute chemical constants
  277. !!
  278. !! History :
  279. !! ! 04-10 (N. Emprin, M. Gehlen ) Original code
  280. !! ! 06-04 (C. Ethe) Re-organization
  281. !!----------------------------------------------------------------------
  282. !! * Local declarations
  283. INTEGER :: ji
  284. REAL(wp) :: ztkel, ztc, ztc2, zpres, ztr
  285. REAL(wp) :: zsal, zsal2, zsqrt, zsal15
  286. REAL(wp) :: zis, zis2, zisqrt
  287. REAL(wp) :: zdens0, zaw, zbw, zcw
  288. REAL(wp) :: zchl, zst, zft, zbuf1, zbuf2
  289. REAL(wp) :: zcpexp, zcpexp2
  290. REAL(wp) :: zckb, zck1, zck2, zckw
  291. REAL(wp) :: zck1p, zck2p, zck3p, zcksi
  292. REAL(wp) :: zak1, zak2, zakb, zakw
  293. REAL(wp) :: zaksp0, zksp, zks, zkf
  294. ! CHEMICAL CONSTANTS - DEEP OCEAN
  295. !-------------------------------------
  296. ! [chem constants]=mol/kg solution (or (mol/kg sol)2 for akws and aksp)
  297. DO ji = 1, jpoce
  298. ztkel = temp(ji) + 273.16
  299. ztc = temp(ji)
  300. ztc2 = ztc * ztc
  301. zpres = press(ji)
  302. ! zqtt = ztkel * 0.01
  303. zsal = salt(ji)
  304. zsal2 = zsal * zsal
  305. zsqrt = SQRT( zsal )
  306. zsal15 = zsqrt * zsal
  307. zlogt = LOG( ztkel )
  308. ztr = 1./ ztkel
  309. ! zis=ionic strength (ORNL/CDIAC-74, DOE 94,Dickson and Goyet)
  310. zis = 19.924 * zsal / ( 1000. - 1.005 * zsal )
  311. zis2 = zis * zis
  312. zisqrt = SQRT( zis )
  313. ! Density of Sea Water - F(temp,sal) [kg/m3]
  314. zdens0 = Ddsw(1) + Ddsw(2) * ztc + Ddsw(3) * ztc2 &
  315. + Ddsw(4) * ztc * ztc2 + Ddsw(5) * ztc2 * ztc2 &
  316. + Ddsw(6) * ztc * ztc2 * ztc2
  317. zaw = Adsw(1) + Adsw(2) * ztc + Adsw(3)* ztc2 + Adsw(4) * ztc * ztc2 &
  318. + Adsw(5) * ztc2 * ztc2
  319. zbw = Bdsw(1) + Bdsw(2) * ztc + Bdsw(3) * ztc2
  320. zcw = Cdsw
  321. densSW(ji) = zdens0 + zaw * zsal + zbw * zsal15 + zcw * zsal * zsal
  322. densSW(ji) = densSW(ji) * 1E-3 ! to get dens in [kg/l]
  323. ! FORMULA FOR CPEXP AFTER EDMOND AND GIESKES (1970)
  324. ! (REFERENCE TO CULBERSON AND PYTKOQICZ (1968) AS MADE IN BROECKER ET AL. (1982)
  325. ! IS INCORRECT; HERE RGAS IS TAKEN TENFOLD TO CORRECT FOR THE NOTATION OF pres IN
  326. ! DBAR INSTEAD OF BAR AND THE EXPRESSION FOR CPEXP IS MULTIPLIED BY LN(10.)
  327. ! TO ALLOW USE OF EXP-FUNCTION WITH BASIS E IN THE FORMULA FOR AKSPP
  328. ! (CF. EDMOND AND GIESKES (1970), P. 1285 AND P. 1286 (THE SMALL FORMULA ON P. 1286
  329. ! IS RIGHT AND CONSISTENT WITH THE SIGN IN PARTIAL MOLAR VOLUME CHANGE AS SHOWN ON P. 1285)
  330. !-----------------------------------------------------------------------------------------
  331. zcpexp = zpres / ( rgas*ztkel )
  332. zcpexp2 = zpres * zcpexp
  333. ! chlorinity (WOOSTER ET AL., 1969)
  334. !---------------------------------------
  335. zchl = zsal * salchl
  336. ! total sulfate concentration [mol/kg soln]
  337. ! --------------------------------------
  338. zst = st1 * zchl * st2
  339. ! total fluoride concentration [mol/kg soln]
  340. ! --------------------------------------
  341. zft = ft1 * zchl * ft2
  342. ! dissociation constant for carbonate (Mehrback 74 - Dickson & Millero 87)
  343. !---------------------------------------------------------------------------
  344. zck1 = c10*ztr - c11 + c12*zlogt - c13*zsal + c14*zsal2
  345. zck2 = c20*ztr + c21 - c22*zlogt - c23*zsal + c24*zsal2
  346. ! dissociation constant for sulfates (Dickson 1990)
  347. !--------------------------------------------------
  348. zks = EXP( ks0 + ks1*ztr + ks2*zlogt &
  349. & + ( ks3*ztr + ks4 + ks5*zlogt ) * zisqrt &
  350. & + ( ks6*ztr + ks7 + ks8*zlogt ) * zis &
  351. & + ks9*ztr*zis*zisqrt + ks10*ztr*zis2 &
  352. & + LOG( ks11 + ks12*zsal ) )
  353. ! dissociation constant for fluorides (Dickson and Riley 79)
  354. !--------------------------------------------------
  355. zkf = EXP( kf0 + kf1*ztr + kf2*zisqrt + LOG( kf3 + kf4*zsal ) )
  356. ! dissociation constant for borates (Doe 94)
  357. !--------------------------------------------------
  358. zckb = ( cb0 + cb1*zsqrt + cb2*zsal + cb3*zsal15 + cb4*zsal2) * ztr &
  359. & + ( cb5 + cb6*zsqrt + cb7*zsal) &
  360. & + ( cb8 + cb9*zsqrt + cb10*zsal) * zlogt &
  361. & + cb11*zsqrt*ztkel + LOG( ( 1. + zst/zks + zft/zkf ) / ( 1. + zst/zks ) )
  362. ! PKW (H2O) (DICKSON AND RILEY, 1979)
  363. !--------------------------------------
  364. zckw = cw0*ztr + cw1 + cw2*zlogt &
  365. & +( cw3*ztr + cw4 + cw5*zlogt )* zsqrt + cw6*zsal
  366. ! For Phodphates (phosphoric acid) (DOE 1994)
  367. !----------------------------------------------
  368. zck1p = cp10 + cp11*ztr + cp12*zlogt + ( cp13*ztr + cp14 ) * zsqrt &
  369. & + ( cp15*ztr + cp16 ) * zsal
  370. zck2p = cp20 + cp21*ztr + cp22*zlogt + ( cp23*ztr + cp24 ) * zsqrt &
  371. & + ( cp25*ztr + cp26 ) * zsal
  372. zck3p = cp30 + cp31*ztr + ( cp32*ztr + cp33 ) * zsqrt &
  373. & + ( cp34*ztr + cp35 ) * zsal
  374. ! For silicates (DOE 1994) change to mol/kg soln) (OCMIP)
  375. !--------------------------------------------------------
  376. zcksi = cs10 + cs11*ztr + cs12*zlogt + ( cs13*ztr + cs14) * zisqrt &
  377. & + ( cs15*ztr + cs16 ) * zis &
  378. & + ( cs17*ztr + cs18 ) * zis2 &
  379. & + LOG( 1. + cs19*zsal ) + LOG( cs20 + cs21*zsal )
  380. ! apparent solublity product K'SP of calcite in seawater
  381. ! (S=27-43, T=2-25 DEG C) AT pres =0 (INGLE, 1975, EQ. 6)
  382. ! prob: olivier a log = ln et C. Heize a LOG10(sal)
  383. ! aksp0 = 1.E-7*(akcc1+akcc2*sal**(1./3.)+akcc3*log(sal)+akcc4*tkel*tkel)
  384. ! aksp0 = 1.E-7*(akcc1+akcc2*sal**(1./3.)+akcc3*log10(sal)+akcc4*tkel*tkel)
  385. !--------------------------------------------------------------------
  386. zaksp0 = akcc1 + akcc2*ztkel + akcc3*ztr + akcc4 * LOG10(ztkel) &
  387. & + ( akcc5 + akcc6*ztkel+ akcc7*ztr ) * zsqrt &
  388. & + akcc8*zsal + akcc9*zsal15
  389. !K1, K2 of carbonic acid, KB of boric acid, KW (H2O)
  390. !---------------------------------------------------
  391. zak1 = 10**( -zck1 )
  392. zak2 = 10**( -zck2 )
  393. zakb = EXP ( zckb )
  394. zakw = EXP ( zckw )
  395. zksp = 10**( zaksp0 )
  396. ! KB of boric acid, K1,K2 of carbonic acid pressure correction
  397. ! after Culberson and AND Pytkowicz (1968) (CF. BROECKER ET AL., 1982) Millero 95
  398. !--------------------------------------------------------------------------------
  399. zbuf1 = - ( devk1(1) + devk2(1)*ztc + devk3(1)*ztc2 )
  400. zbuf2 = 0.5 * ( devk4(1) + devk5(1)*ztc )
  401. ak1s(ji) = zak1 * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  402. zbuf1 = -( devk1(2) + devk2(2)*ztc + devk3(2)*ztc2 )
  403. zbuf2 = 0.5 * ( devk4(2) + devk5(2)*ztc )
  404. ak2s(ji) = zak2 * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  405. zbuf1 = - ( devk1(3) + devk2(3)*ztc + devk3(3)*ztc2 )
  406. zbuf2 = 0.5 * ( devk4(3) + devk5(3) * ztc )
  407. akbs(ji) = zakb * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  408. zbuf1 = - ( devk1(4) + devk2(4)*ztc + devk3(4)*ztc2 )
  409. zbuf2 = 0.5 * ( devk4(4) + devk5(4)*ztc )
  410. akws(ji) = zakw * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  411. ! APPARENT SOLUBILITY PRODUCT K''SP OF CALCITE (OR ARAGONITE)
  412. ! AS FUNCTION OF PRESSURE FOLLWING EDMOND AND GIESKES (1970)
  413. ! (P. 1285) AND BERNER (1976)
  414. !-----------------------------------------------------------------
  415. ! aksp(ji) = aksp0*exp(zcpexp*(devks-devkst*tc))
  416. ! or following Mucci
  417. zbuf1 = - ( devk1(5) + devk2(5)*ztc + devk3(5)*ztc2 )
  418. zbuf2 = 0.5 *( devk4(5) + devk5(5)*ztc )
  419. aksps(ji) = zksp * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  420. ! For Phodphates (phosphoric acid) (DOE 1994)
  421. !----------------------------------------------
  422. zck1p = cp10 + cp11*ztr + cp12*zlogt + ( cp13*ztr + cp14 ) * zsqrt &
  423. & + ( cp15*ztr + cp16 ) * zsal
  424. zck2p = cp20 + cp21*ztr + cp22*zlogt + ( cp23*ztr + cp24 ) * zsqrt &
  425. & + ( cp25*ztr + cp26 ) * zsal
  426. zck3p = cp30 + cp31*ztr + ( cp32*ztr + cp33 ) * zsqrt &
  427. & + ( cp34*ztr + cp35 ) * zsal
  428. ! For silicates (DOE 1994) change to mol/kg soln) (OCMIP)
  429. !--------------------------------------------------------
  430. zcksi = cs10 + cs11*ztr + cs12*zlogt + ( cs13*ztr + cs14) * zisqrt &
  431. & + ( cs15*ztr + cs16 ) * zis &
  432. & + ( cs17*ztr + cs18 ) * zis2 &
  433. & + LOG( 1. + cs19*zsal ) + LOG( cs20 + cs21*zsal )
  434. !K1, K2 of carbonic acid, KB of boric acid, KW (H2O)
  435. !---------------------------------------------------
  436. zak1p = EXP ( zck1p )
  437. zak2p = EXP ( zck2p )
  438. zak3p = EXP ( zck3p )
  439. zaksil = EXP ( zcksi )
  440. zbuf1 = - ( devk1(3) + devk2(3)*ztc + devk3(3)*ztc2 )
  441. zbuf2 = 0.5 * ( devk4(3) + devk5(3)*ztc )
  442. aksis(ji) = zaksil * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  443. zbuf1 = - ( devk1(6) + devk2(6)*ztc + devk3(6)*ztc2 )
  444. zbuf2 = 0.5 * ( devk4(6) + devk5(6)*ztc )
  445. ak1ps(ji) = zak1p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  446. zbuf1 = - ( devk1(7) + devk2(7)*ztc + devk3(7)*ztc2 )
  447. zbuf2 = 0.5 * ( devk4(7) + devk5(7)*ztc )
  448. ak2ps(ji) = zak2p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  449. zbuf1 = - ( devk1(8) + devk2(8)*ztc + devk3(8)*ztc2 )
  450. zbuf2 = 0.5 * ( devk4(8) + devk5(8)*ztc )
  451. ak3ps(ji) = zak3p * EXP( zbuf1*zcpexp + zbuf2*zcpexp2 )
  452. ! total borat concentration. [mol/l]
  453. ! or from Millero 1995 [mol/l] : borat(l) = 0.000416_8*(sal/35._8)*densSW(l)
  454. ! --------------------------------------------------------------------------
  455. borats(ji) = bor1 * zchl * bor2 * densSW(ji)
  456. ak12s (ji) = ak1s (ji) * ak2s (ji)
  457. ak12ps (ji) = ak1ps(ji) * ak2ps(ji)
  458. ak123ps(ji) = ak1ps(ji) * ak2ps(ji) * ak3ps(ji)
  459. calcon2(ji) = 0.01028 * ( zsal / 35. ) * densSW(ji)
  460. ENDDO
  461. END SUBROUTINE sed_chem_off
  462. #endif
  463. #else
  464. !!======================================================================
  465. !! MODULE sedchem : Dummy module
  466. !!======================================================================
  467. !! $Id: sedchem.F90 2355 2015-05-20 07:11:50Z ufla $
  468. CONTAINS
  469. SUBROUTINE sed_chem( kt ) ! Empty routine
  470. INTEGER, INTENT(in) :: kt
  471. WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt
  472. END SUBROUTINE sed_chem
  473. !!======================================================================
  474. #endif
  475. END MODULE sedchem