sedini.F90 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. MODULE sedini
  2. !!======================================================================
  3. !! *** MODULE sedini ***
  4. !! Sediment : define sediment variables
  5. !!=====================================================================
  6. #if defined key_sed
  7. !!----------------------------------------------------------------------
  8. !! sed_init : initialization, namelist read, and parameters control
  9. !!----------------------------------------------------------------------
  10. !! * Modules used
  11. USE sed ! sediment global variable
  12. USE seddta
  13. USE sedrst
  14. USE sedco3
  15. USE sedchem
  16. USE sedarr
  17. USE iom
  18. IMPLICIT NONE
  19. PRIVATE
  20. !! Module variables
  21. REAL(wp) :: &
  22. sisat = 800. , & !: saturation for si [ mol.l-1]
  23. claysat = 0. , & !: saturation for clay [ mol.l-1]
  24. rcopal = 40. , & !: reactivity for si [l.mol-1.an-1]
  25. rcclay = 0. , & !: reactivity for clay [l.mol-1.an-1]
  26. dcoef = 8.e-6 !: diffusion coefficient (*por) [cm**2/s]
  27. REAL(wp) :: &
  28. redO2 = 172. , & !: Redfield coef for Oxygene
  29. redNo3 = 16. , & !: Redfield coef for Nitrates
  30. redPo4 = 1. , & !: Redfield coef for Phosphates
  31. redC = 122. , & !: Redfield coef for Carbone
  32. redDnit = 97.6 , & !: Redfield coef for denitrification
  33. rcorg = 50. , & !: reactivity for POC/O2 [l.mol-1.an-1]
  34. o2seuil = 1. , & !: threshold O2 concentration for [mol.l-1]
  35. rcorgN = 50. !: reactivity for POC/No3 [l.mol-1.an-1]
  36. REAL(wp) :: &
  37. rccal = 1000. !: reactivity for calcite [l.mol-1.an-1]
  38. REAL(wp) :: &
  39. dbiot = 15. !: coefficient for bioturbation [cm**2.(1000an-1)]
  40. LOGICAL :: &
  41. ln_rst_sed = .TRUE. !: initialisation from a restart file or not
  42. REAL(wp) :: &
  43. ryear = 365. * 24. * 3600. !: 1 year converted in second
  44. !! * Routine accessibility
  45. PUBLIC sed_init ! routine called by opa.F90
  46. !! $Id: sedini.F90 2355 2015-05-20 07:11:50Z ufla $
  47. CONTAINS
  48. SUBROUTINE sed_init
  49. !!----------------------------------------------------------------------
  50. !! *** ROUTINE sed_init ***
  51. !!
  52. !! ** Purpose : Initialization of sediment module
  53. !! - Reading namelist
  54. !! - Read the deepest water layer thickness
  55. !! ( using as mask ) in Netcdf file
  56. !! - Convert unity if necessary
  57. !! - sets initial sediment composition
  58. !! ( only clay or reading restart file )
  59. !! - sets sediment grid, porosity and others constants
  60. !!
  61. !! History :
  62. !! ! 04-10 (N. Emprin, M. Gehlen ) Original code
  63. !! ! 06-07 (C. Ethe) Re-organization
  64. !!----------------------------------------------------------------------
  65. INTEGER :: ji, jj, ikt
  66. #if defined key_sed_off
  67. INTEGER :: numblt
  68. INTEGER :: nummsh
  69. REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zdta
  70. #endif
  71. !!----------------------------------------------------------------------
  72. ! Reading namelist.sed variables
  73. !---------------------------------------
  74. CALL ctl_opn( numsed, 'sediment.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  75. WRITE(numsed,*)
  76. WRITE(numsed,*) ' L S C E - C E A'
  77. WRITE(numsed,*) ' SEDIMENT model'
  78. WRITE(numsed,*) ' version 2.0 (2007) '
  79. WRITE(numsed,*)
  80. WRITE(numsed,*)
  81. WRITE(numsed,*) ' sed_init : Initialization of sediment module '
  82. WRITE(numsed,*) ' '
  83. ! ! Allocate LOBSTER arrays
  84. IF( sed_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sed_ini: unable to allocate sediment model arrays' )
  85. ! Determination of sediments number of points and allocate global variables
  86. #if defined key_sed_off
  87. ! Reading Netcdf Pisces file for deepest water layer thickness [m]
  88. ! This data will be used as mask to merdge space in 1D vector
  89. !----------------------------------------------------------------
  90. CALL iom_open ( 'mesh_mask' , nummsh )
  91. CALL iom_open ( 'e3tbot' , numblt )
  92. ! mask sediment points for outputs
  93. CALL iom_get( nummsh, jpdom_data, 'tmask' , tmask )
  94. CALL iom_get( nummsh, jpdom_data, 'mbathy', sbathy )
  95. ! longitude/latitude values
  96. CALL iom_get ( nummsh, jpdom_data,'nav_lon', glamt(:,:) )
  97. CALL iom_get ( nummsh, jpdom_data,'nav_lat', gphit(:,:) )
  98. ! bottom layer thickness
  99. ALLOCATE( zdta(jpi,jpj) )
  100. CALL iom_get ( numblt, jpdom_data, 'E3TBOT', zdta(:,:) )
  101. epkbot(:,:) = 0.
  102. DO jj = 1, jpj
  103. DO ji = 1, jpi
  104. ikt = MAX( INT( sbathy(ji,jj) ), 1 )
  105. IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = zdta(ji,jj)
  106. ENDDO
  107. ENDDO
  108. CALL iom_close( nummsh )
  109. CALL iom_close( numblt )
  110. DEALLOCATE( zdta )
  111. #else
  112. epkbot(:,:) = 0.
  113. DO jj = 1, jpj
  114. DO ji = 1, jpi
  115. ikt = mbkt(ji,jj)
  116. IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = e3t_1d(ikt)
  117. ENDDO
  118. ENDDO
  119. #endif
  120. ! computation of total number of ocean points
  121. !--------------------------------------------
  122. jpoce = COUNT( epkbot(:,:) > 0. )
  123. ! Allocate memory size of global variables
  124. ALLOCATE( pwcp (jpoce,jpksed,jpwat) ) ; ALLOCATE( pwcp0 (jpoce,jpksed,jpwat) ) ; ALLOCATE( pwcp_dta (jpoce,jpwat) )
  125. ALLOCATE( solcp(jpoce,jpksed,jpsol) ) ; ALLOCATE( solcp0(jpoce,jpksed,jpsol) ) ; ALLOCATE( rainrm_dta(jpoce,jpsol) )
  126. ALLOCATE( rainrm(jpoce,jpsol) ) ; ALLOCATE( rainrg(jpoce,jpsol) ) ; ALLOCATE( raintg(jpoce) )
  127. ALLOCATE( dzdep(jpoce) ) ; ALLOCATE( iarroce(jpoce) ) ; ALLOCATE( dzkbot(jpoce) )
  128. ALLOCATE( temp(jpoce) ) ; ALLOCATE( salt(jpoce) )
  129. ALLOCATE( press(jpoce) ) ; ALLOCATE( densSW(jpoce) )
  130. ALLOCATE( hipor(jpoce,jpksed) ) ; ALLOCATE( co3por(jpoce,jpksed) )
  131. ALLOCATE( dz3d(jpoce,jpksed) ) ; ALLOCATE( volw3d(jpoce,jpksed) ) ; ALLOCATE( vols3d(jpoce,jpksed) )
  132. ! Initialization of global variables
  133. pwcp (:,:,:) = 0. ; pwcp0 (:,:,:) = 0. ; pwcp_dta (:,:) = 0.
  134. solcp (:,:,:) = 0. ; solcp0(:,:,:) = 0. ; rainrm_dta(:,:) = 0.
  135. rainrm(:,: ) = 0. ; rainrg(:,: ) = 0. ; raintg (: ) = 0.
  136. dzdep (: ) = 0. ; iarroce(: ) = 0 ; dzkbot (: ) = 0.
  137. temp (: ) = 0. ; salt (: ) = 0.
  138. press (: ) = 0. ; densSW (: ) = 0.
  139. hipor (:,: ) = 0. ; co3por (:,: ) = 0.
  140. dz3d (:,: ) = 0. ; volw3d (:,: ) = 0. ; vols3d (:,:) = 0.
  141. ! Chemical variables
  142. ALLOCATE( akbs (jpoce) ) ; ALLOCATE( ak1s (jpoce) ) ; ALLOCATE( ak2s (jpoce) ) ; ALLOCATE( akws (jpoce) )
  143. ALLOCATE( ak1ps (jpoce) ) ; ALLOCATE( ak2ps (jpoce) ) ; ALLOCATE( ak3ps (jpoce) ) ; ALLOCATE( aksis (jpoce) )
  144. ALLOCATE( aksps (jpoce) ) ; ALLOCATE( ak12s (jpoce) ) ; ALLOCATE( ak12ps(jpoce) ) ; ALLOCATE( ak123ps(jpoce) )
  145. ALLOCATE( borats(jpoce) ) ; ALLOCATE( calcon2(jpoce) )
  146. akbs (:) = 0. ; ak1s (:) = 0. ; ak2s (:) = 0. ; akws (:) = 0.
  147. ak1ps (:) = 0. ; ak2ps (:) = 0. ; ak3ps (:) = 0. ; aksis (:) = 0.
  148. aksps (:) = 0. ; ak12s (:) = 0. ; ak12ps(:) = 0. ; ak123ps(:) = 0.
  149. borats(:) = 0. ; calcon2(:) = 0.
  150. ! Mass balance calculation
  151. ALLOCATE( fromsed(jpoce, jpsol) ) ; ALLOCATE( tosed(jpoce, jpsol) ) ; ALLOCATE( rloss(jpoce, jpsol) )
  152. ALLOCATE( tokbot (jpoce, jpwat) )
  153. fromsed(:,:) = 0. ; tosed(:,:) = 0. ; rloss(:,:) = 0. ; tokbot(:,:) = 0.
  154. ! Read sediment Namelist
  155. !-------------------------
  156. CALL sed_init_nam
  157. ! Initialization of sediment geometry
  158. !------------------------------------
  159. CALL sed_init_geom
  160. ! sets initial sediment composition
  161. ! ( only clay or reading restart file )
  162. !---------------------------------------
  163. CALL sed_init_data
  164. CALL sed_init_wri
  165. END SUBROUTINE sed_init
  166. SUBROUTINE sed_init_geom
  167. !!----------------------------------------------------------------------
  168. !! *** ROUTINE sed_init_geom ***
  169. !!
  170. !! ** Purpose : Initialization of sediment geometry
  171. !! - Read the deepest water layer thickness
  172. !! ( using as mask ) in Netcdf file
  173. !! - sets sediment grid, porosity and molecular weight
  174. !! and others constants
  175. !!
  176. !! History :
  177. !! ! 06-07 (C. Ethe) Original
  178. !!----------------------------------------------------------------------
  179. !! * Modules used
  180. !! * local declarations
  181. INTEGER :: &
  182. ji, jj, jk
  183. #if defined key_sed_off
  184. REAL(wp) , DIMENSION (jpi,jpj) :: zdta
  185. INTEGER :: numpres
  186. #endif
  187. !----------------------------------------------------------
  188. WRITE(numsed,*) ' sed_init_geom : Initialization of sediment geometry '
  189. WRITE(numsed,*) ' '
  190. ! Computation of 1D array of sediments points
  191. indoce = 0
  192. DO jj = 1, jpj
  193. DO ji = 1, jpi
  194. IF ( epkbot(ji,jj) > 0. ) THEN
  195. indoce = indoce + 1
  196. iarroce(indoce) = (jj - 1) * jpi + ji
  197. ENDIF
  198. END DO
  199. END DO
  200. IF( indoce .NE. jpoce ) THEN
  201. WRITE(numsed,*) ' '
  202. WRITE(numsed,*) 'Warning : number of ocean points indoce = ', indoce, &
  203. & ' doesn''t match number of point where epkbot>0 jpoce = ', jpoce
  204. WRITE(numsed,*) ' '
  205. WRITE(numsed,*) ' '
  206. STOP
  207. ELSE
  208. WRITE(numsed,*) ' '
  209. WRITE(numsed,*) ' total number of ocean points jpoce = ',jpoce
  210. WRITE(numsed,*) ' '
  211. ENDIF
  212. #if defined key_sed_off
  213. ! Reading Netcdf Pisces file for deepest water layer thickness [m]
  214. ! This data will be used as mask to merdge space in 1D vector
  215. !----------------------------------------------------------------
  216. CALL iom_open ( 'pressbot' , numpres )
  217. ! pressure in bars
  218. CALL iom_get ( numpres, jpdom_data,'BATH', zdta(:,:) )
  219. CALL pack_arr ( jpoce, press(1:jpoce), zdta(1:jpi,1:jpj), iarroce(1:jpoce) )
  220. press(1:jpoce) = press(1:jpoce) * 1.025e-1
  221. CALL iom_close ( numpres )
  222. #endif
  223. ! mask sediment points for outputs
  224. DO jk = 1, jpksed
  225. tmasksed(:,:,jk) = tmask(:,:,1)
  226. ENDDO
  227. ! initialization of dzkbot in [cm]
  228. !------------------------------------------------
  229. CALL pack_arr ( jpoce, dzkbot(1:jpoce), epkbot(1:jpi,1:jpj), iarroce(1:jpoce) )
  230. dzkbot(1:jpoce) = dzkbot(1:jpoce) * 1.e+2
  231. ! Geometry and constants
  232. ! sediment layer thickness [cm]
  233. ! (1st layer= diffusive layer = pur water)
  234. !------------------------------------------
  235. dz(1) = 0.1
  236. dz(2) = 0.3
  237. dz(3) = 0.3
  238. dz(4) = 0.5
  239. dz(5) = 0.5
  240. dz(6) = 0.5
  241. dz(7) = 1.
  242. dz(8) = 1.
  243. dz(9) = 1.
  244. dz(10) = 2.45
  245. dz(11) = 2.45
  246. DO jk = 1, jpksed
  247. DO ji = 1, jpoce
  248. dz3d(ji,jk) = dz(jk)
  249. END DO
  250. ENDDO
  251. ! Depth(jk)= depth of middle of each layer
  252. !----------------------------------------
  253. profsed(1) = -dz(1)/ 2.
  254. DO jk = 2, jpksed
  255. profsed(jk) = profsed(jk-1) + dz(jk-1) / 2. + dz(jk) / 2.
  256. ENDDO
  257. ! Porosity profile [0]
  258. !---------------------
  259. por(1) = 1.
  260. por(2) = 0.95
  261. por(3) = 0.9
  262. por(4) = 0.85
  263. por(5) = 0.81
  264. por(6) = 0.75
  265. por(7) = 0.75
  266. por(8) = 0.75
  267. por(9) = 0.75
  268. por(10) = 0.75
  269. por(11) = 0.75
  270. ! inverse of Porosity profile
  271. !-----------------------------
  272. por1(:) = 1. - por(:)
  273. ! Volumes of pore water and solid fractions (vector and array)
  274. ! WARNING : volw(1) and vols(1) are sublayer volums
  275. volw(:) = dz(:) * por(:)
  276. vols(:) = dz(:) * por1(:)
  277. ! temporary new value for dz3d(:,1)
  278. dz3d(1:jpoce,1) = dzkbot(1:jpoce)
  279. ! WARNING : volw3d(:,1) and vols3d(:,1) are deepest water column volums
  280. DO jk = 1, jpksed
  281. volw3d(1:jpoce,jk) = dz3d(1:jpoce,jk) * por (jk)
  282. vols3d(1:jpoce,jk) = dz3d(1:jpoce,jk) * por1(jk)
  283. ENDDO
  284. ! Back to the old sublayer vlaue for dz3d(:,1)
  285. dz3d(1:jpoce,1) = dz(1)
  286. !---------------------------------------------
  287. ! Molecular weight [g/mol] for solid species
  288. !---------------------------------------------
  289. ! opal=sio2*0.4(h20)=28+2*16+0.4*(2+16)
  290. !---------------------------------------
  291. mol_wgt(jsopal) = 28. + 2. * 16. + 0.4 * ( 2. + 16. )
  292. ! clay
  293. ! some kind of Illit (according to Pape)
  294. ! K0.58(Al 1.38 Fe(III)0.37Fe(II)0.04Mg0.34)[(OH)2|(Si3.41Al0.59)O10]
  295. !--------------------------------------------------------------------
  296. mol_wgt(jsclay) = 0.58 * 39. + 1.38 * 27. + ( 0.37 + 0.04 ) * 56.+ &
  297. & 0.34 * 24. + 2. * ( 16. + 1. ) + 3.41 * 38. + &
  298. & 0.59 * 27. + 10. * 16.
  299. ! for chemistry Poc : C(122)H(244)O(86)N(16)P(1)
  300. ! But den sity of Poc is an Hydrated material (= POC + 30H2O)
  301. ! So C(122)H(355)O(120)N(16)P(1)
  302. !------------------------------------------------------------
  303. mol_wgt(jspoc) = ( 122. * 12. + 355. + 120. * 16.+ &
  304. & 16. * 14. + 31. ) / 122.
  305. ! CaCO3
  306. !---------
  307. mol_wgt(jscal) = 40. + 12. + 3. * 16.
  308. ! Density of solid material in sediment [g/cm**3]
  309. !------------------------------------------------
  310. dens = 2.6
  311. ! Initialization of diffusion coefficient as function of porosity [cm**2/s]
  312. !--------------------------------------------------------------------
  313. diff(:) = dcoef * por(:)
  314. ! Initialization of time step as function of porosity [cm**2/s]
  315. !------------------------------------------------------------------
  316. rdtsed(2:jpksed) = dtsed / ( dens * por1(2:jpksed) )
  317. END SUBROUTINE sed_init_geom
  318. SUBROUTINE sed_init_nam
  319. !!----------------------------------------------------------------------
  320. !! *** ROUTINE sed_init_nam ***
  321. !!
  322. !! ** Purpose : Initialization of sediment geometry
  323. !! - Reading namelist and defines constants variables
  324. !!
  325. !! History :
  326. !! ! 06-07 (C. Ethe) Original
  327. !!----------------------------------------------------------------------
  328. INTEGER :: &
  329. numnamsed = 28
  330. TYPE PSED
  331. CHARACTER(len = 20) :: snamesed !: short name
  332. CHARACTER(len = 80 ) :: lnamesed !: long name
  333. CHARACTER(len = 20 ) :: unitsed !: unit
  334. END TYPE PSED
  335. TYPE(PSED) , DIMENSION(jpsol ) :: sedsol
  336. TYPE(PSED) , DIMENSION(jpwat ) :: sedwat
  337. TYPE(PSED) , DIMENSION(jpdia3dsed) :: seddiag3d
  338. TYPE(PSED) , DIMENSION(jpdia2dsed) :: seddiag2d
  339. NAMELIST/nam_time/nfreq
  340. NAMELIST/nam_trased/sedsol, sedwat
  341. NAMELIST/nam_diased/seddiag3d, seddiag2d
  342. NAMELIST/nam_reac/sisat, claysat, rcopal, rcclay, dcoef
  343. NAMELIST/nam_poc/redO2, redNo3, redPo4, redC, redDnit, &
  344. & rcorg, o2seuil, rcorgN
  345. NAMELIST/nam_cal/rccal
  346. NAMELIST/nam_dc13/pdb, rc13P, rc13Ca
  347. NAMELIST/nam_btb/dbiot
  348. NAMELIST/nam_rst/ln_rst_sed
  349. INTEGER :: jn, jn1
  350. !-------------------------------------------------------
  351. WRITE(numsed,*) ' sed_init_nam : Read namelists '
  352. WRITE(numsed,*) ' '
  353. ! ryear = 1 year converted in second
  354. !------------------------------------
  355. WRITE(numsed,*) ' '
  356. WRITE(numsed,*) 'number of seconds in one year : ryear = ', ryear
  357. WRITE(numsed,*) ' '
  358. ! Reading namelist.sed variables
  359. !---------------------------------
  360. CALL ctl_opn( numnamsed, 'namelist.sediment', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  361. dtsed = rdt
  362. nitsed000 = nittrc000
  363. nitsedend = nitend
  364. #if ! defined key_sed_off
  365. nwrised = nwritetrc
  366. #else
  367. nwrised = nwrite
  368. #endif
  369. ! Diffraction/reaction parameters
  370. !----------------------------------
  371. READ( numnamsed, nam_time )
  372. WRITE(numsed,*) ' namelist nam_time'
  373. #if ! defined key_sed_off
  374. nfreq = 1
  375. #endif
  376. WRITE(numsed,*) ' sedimentation time step dtsed = ', dtsed
  377. WRITE(numsed,*) ' 1st time step for sediment. nitsed000 = ', nitsed000
  378. WRITE(numsed,*) ' last time step for sediment. nitsedend = ', nitsedend
  379. WRITE(numsed,*) ' frequency of sediment outputs nwrised = ', nwrised
  380. WRITE(numsed,*) ' frequency of restoring inputs data nfreq = ', nfreq
  381. WRITE(numsed,*) ' '
  382. REWIND( numnamsed ) ! read nattrc
  383. READ ( numnamsed, nam_trased )
  384. DO jn = 1, jpsol
  385. sedtrcd(jn) = sedsol(jn)%snamesed
  386. sedtrcl(jn) = sedsol(jn)%lnamesed
  387. sedtrcu(jn) = sedsol(jn)%unitsed
  388. END DO
  389. DO jn = 1, jpwat
  390. jn1 = jn + jpsol
  391. sedtrcd(jn1) = sedwat(jn)%snamesed
  392. sedtrcl(jn1) = sedwat(jn)%lnamesed
  393. sedtrcu(jn1) = sedwat(jn)%unitsed
  394. END DO
  395. WRITE(numsed,*) ' namelist nam_trased'
  396. WRITE(numsed,*) ' '
  397. DO jn = 1, jptrased
  398. WRITE(numsed,*) 'name of 3d output sediment field number :',jn,' : ',TRIM(sedtrcd(jn))
  399. WRITE(numsed,*) 'long name ', TRIM(sedtrcl(jn))
  400. WRITE(numsed,*) ' in unit = ', TRIM(sedtrcu(jn))
  401. WRITE(numsed,*) ' '
  402. END DO
  403. WRITE(numsed,*) ' '
  404. REWIND( numnamsed )
  405. READ( numnamsed, nam_diased )
  406. DO jn = 1, jpdia3dsed
  407. seddia3d(jn) = seddiag3d(jn)%snamesed
  408. seddia3l(jn) = seddiag3d(jn)%lnamesed
  409. seddia3u(jn) = seddiag3d(jn)%unitsed
  410. END DO
  411. DO jn = 1, jpdia2dsed
  412. seddia2d(jn) = seddiag2d(jn)%snamesed
  413. seddia2l(jn) = seddiag2d(jn)%lnamesed
  414. seddia2u(jn) = seddiag2d(jn)%unitsed
  415. END DO
  416. WRITE(numsed,*) ' namelist nam_diased'
  417. WRITE(numsed,*) ' '
  418. DO jn = 1, jpdia3dsed
  419. WRITE(numsed,*) 'name of 3D output diag number :',jn, ' : ', TRIM(seddia3d(jn))
  420. WRITE(numsed,*) 'long name ', TRIM(seddia3l(jn))
  421. WRITE(numsed,*) ' in unit = ',TRIM(seddia3u(jn))
  422. WRITE(numsed,*) ' '
  423. END DO
  424. DO jn = 1, jpdia2dsed
  425. WRITE(numsed,*) 'name of 2D output diag number :',jn, ' : ', TRIM(seddia2d(jn))
  426. WRITE(numsed,*) 'long name ', TRIM(seddia2l(jn))
  427. WRITE(numsed,*) ' in unit = ',TRIM(seddia2u(jn))
  428. WRITE(numsed,*) ' '
  429. END DO
  430. WRITE(numsed,*) ' '
  431. ! Diffraction/reaction parameters
  432. !----------------------------------
  433. REWIND( numnamsed )
  434. READ( numnamsed, nam_reac )
  435. WRITE(numsed,*) ' namelist nam_reac'
  436. WRITE(numsed,*) ' saturation for si sisat = ', sisat
  437. WRITE(numsed,*) ' saturation for clay claysat = ', claysat
  438. WRITE(numsed,*) ' reactivity for Si rcopal = ', rcopal
  439. WRITE(numsed,*) ' reactivity for clay rcclay = ', rcclay
  440. WRITE(numsed,*) ' diff. coef for por. dcoef = ', dcoef
  441. WRITE(numsed,*) ' '
  442. ! Unity conversion to get saturation conc. psat in [mol.l-1]
  443. ! and reactivity rc in [l.mol-1.s-1]
  444. !----------------------------------------------------------
  445. sat_sil = sisat * 1.e-6
  446. sat_clay = claysat * 1.e-6
  447. reac_sil = rcopal / ryear
  448. reac_clay = rcclay / ryear
  449. ! Additional parameter linked to POC/O2/No3/Po4
  450. !----------------------------------------------
  451. REWIND( numnamsed )
  452. READ( numnamsed, nam_poc )
  453. WRITE(numsed,*) ' namelist nam_poc'
  454. WRITE(numsed,*) ' Redfield coef for oxy redO2 = ', redO2
  455. WRITE(numsed,*) ' Redfield coef for no3 redNo3 = ', redNo3
  456. WRITE(numsed,*) ' Redfield coef for po4 redPo4 = ', redPo4
  457. WRITE(numsed,*) ' Redfield coef for carbone redC = ', redC
  458. WRITE(numsed,*) ' Redfield coef for denitri redDnit = ', redDnit
  459. WRITE(numsed,*) ' reactivity for POC/O2 rcorg = ', rcorg
  460. WRITE(numsed,*) ' threshold O2 concen. o2seuil = ', o2seuil
  461. WRITE(numsed,*) ' reactivity for POC/NO3 rcorgN = ', rcorgN
  462. WRITE(numsed,*) ' '
  463. so2ut = redO2 / redC
  464. srno3 = redNo3 / redC
  465. spo4r = redPo4 / redC
  466. srDnit = redDnit / redC
  467. sthro2 = o2seuil * 1.e-6 ! threshold O2 concen. in [mol.l-1]
  468. ! reactivity rc in [l.mol-1.s-1]
  469. reac_poc = rcorg / ryear
  470. reac_no3 = rcorgN / ryear
  471. ! Carbonate parameters
  472. !---------------------
  473. READ( numnamsed, nam_cal )
  474. WRITE(numsed,*) ' namelist nam_cal'
  475. WRITE(numsed,*) ' reactivity for calcite rccal = ', rccal
  476. WRITE(numsed,*) ' '
  477. ! reactivity rc in [l.mol-1.s-1]
  478. reac_cal = rccal / ryear
  479. ! C13 parameters
  480. !----------------
  481. READ( numnamsed, nam_dc13 )
  482. WRITE(numsed,*) ' namelist nam_dc13 '
  483. WRITE(numsed,*) ' 13C/12C in PD Belemnite PDB = ', pdb
  484. WRITE(numsed,*) ' 13C/12C in POC = rc13P*PDB rc13P = ', rc13P
  485. WRITE(numsed,*) ' 13C/12C in CaCO3 = rc13Ca*PDB rc13Ca = ', rc13Ca
  486. WRITE(numsed,*) ' '
  487. ! Bioturbation parameter
  488. !------------------------
  489. READ( numnamsed, nam_btb )
  490. WRITE(numsed,*) ' namelist nam_btb '
  491. WRITE(numsed,*) ' coefficient for bioturbation dbiot = ', dbiot
  492. WRITE(numsed,*) ' '
  493. ! Unity convertion to get bioturb coefficient in [cm2.s-1]
  494. db = dbiot / ( ryear * 1000. )
  495. ! Initial value (t=0) for sediment pore water and solid components
  496. !----------------------------------------------------------------
  497. READ( numnamsed, nam_rst )
  498. WRITE(numsed,*) ' namelist nam_rst '
  499. WRITE(numsed,*) ' boolean term for restart (T or F) ln_rst_sed = ', ln_rst_sed
  500. WRITE(numsed,*) ' '
  501. CLOSE( numnamsed )
  502. END SUBROUTINE sed_init_nam
  503. SUBROUTINE sed_init_data
  504. !!----------------------------------------------------------------------
  505. !! *** ROUTINE sed_init_data ***
  506. !!
  507. !! ** Purpose : Initialization of sediment module
  508. !! - sets initial sediment composition
  509. !! ( only clay or reading restart file )
  510. !!
  511. !! History :
  512. !! ! 06-07 (C. Ethe) original
  513. !!----------------------------------------------------------------------
  514. ! local variables
  515. INTEGER :: &
  516. ji, jk, zhipor
  517. !--------------------------------------------------------------------
  518. IF( .NOT. ln_rst_sed ) THEN
  519. WRITE(numsed,*) ' Initilization of default values of sediment components'
  520. ! default values for initial pore water concentrations [mol/l]
  521. pwcp(:,:,:) = 0.
  522. ! default value for initial solid component (fraction of dry weight dim=[0])
  523. ! clay
  524. solcp(:,:,:) = 0.
  525. solcp(:,2:jpksed,jsclay) = 1.
  526. ! Initialization of [h+] and [co3--]
  527. zhipor = 8.
  528. ! Initialization of [h+] in mol/kg
  529. DO jk = 1, jpksed
  530. DO ji = 1, jpoce
  531. hipor (ji,jk) = 10.**( -1. * zhipor )
  532. ENDDO
  533. ENDDO
  534. co3por(:,:) = 0.
  535. ELSE
  536. WRITE(numsed,*) ' Initilization of Sediment components from restart'
  537. CALL sed_rst_read
  538. ENDIF
  539. ! Load initial Pisces Data for bot. wat. Chem and fluxes
  540. CALL sed_dta ( nitsed000 )
  541. ! Initialization of chemical constants
  542. CALL sed_chem ( nitsed000 )
  543. ! Stores initial sediment data for mass balance calculation
  544. pwcp0 (1:jpoce,1:jpksed,1:jpwat ) = pwcp (1:jpoce,1:jpksed,1:jpwat )
  545. solcp0(1:jpoce,1:jpksed,1:jpsol ) = solcp(1:jpoce,1:jpksed,1:jpsol)
  546. ! Conversion of [h+] in mol/Kg to get it in mol/l ( multiplication by density)
  547. DO jk = 1, jpksed
  548. hipor(1:jpoce,jk) = hipor(1:jpoce,jk) * densSW(1:jpoce)
  549. ENDDO
  550. ! In default case - no restart - sedco3 is run to initiate [h+] and [co32-]
  551. ! Otherwise initiate values of pH and co3 read in restart
  552. IF( .NOT. ln_rst_sed ) THEN
  553. ! sedco3 is run to initiate[h+] [co32-] in mol/l of solution
  554. CALL sed_co3 ( nitsed000 )
  555. ENDIF
  556. END SUBROUTINE sed_init_data
  557. SUBROUTINE sed_init_wri
  558. INTEGER :: jk
  559. WRITE(numsed,*)' '
  560. WRITE(numsed,*)'======== Write summary of initial state ============'
  561. WRITE(numsed,*)' '
  562. WRITE(numsed,*)' '
  563. WRITE(numsed,*)'-------------------------------------------------------------------'
  564. WRITE(numsed,*)' Initial Conditions '
  565. WRITE(numsed,*)'-------------------------------------------------------------------'
  566. WRITE(numsed,*)'dzm = dzkbot minimum to calculate ', 0.
  567. WRITE(numsed,*)'Local zone : jpi, jpj : ',jpi, jpj
  568. WRITE(numsed,*)'jpoce = ',jpoce,' nbtot pts = ',jpij,' nb earth pts = ',jpij - jpoce
  569. WRITE(numsed,*)'sublayer thickness dz(1) [cm] : ', dz(1)
  570. WRITE(numsed,*)'Coeff diff for k=1 (cm2/s) : ',diff(1)
  571. WRITE(numsed,*)' nb solid comp : ',jpsol
  572. WRITE(numsed,*)'(1=opal,2=clay,3=POC,4=CaCO3)'
  573. WRITE(numsed,*)'weight mol 1,2,3,4'
  574. WRITE(numsed,'(4(F0.2,3X))')mol_wgt(jsopal),mol_wgt(jsclay),mol_wgt(jspoc),mol_wgt(jscal)
  575. WRITE(numsed,*)'nb dissolved comp',jpwat
  576. WRITE(numsed,*)'(1=silicic acid,2="dissolved" clay,3=O2,4=DIC,5=Nitrate,&
  577. &6=Phosphates,7=Alk))'
  578. WRITE(numsed,*)'Psat (umol/l) for silicic Acid and "dissolved" clay'
  579. WRITE(numsed,'(2(F0.2,3X))') sat_sil * 1e+6, sat_clay * 1e+6
  580. WRITE(numsed,*)'reaction rate rc for Op/si,Clay,POC/O2,caco3, POC/No3 (an-1)'
  581. WRITE(numsed,'(5(F0.2,3X))') reac_sil * ryear, reac_clay * ryear, reac_poc * ryear, &
  582. reac_cal * ryear, reac_no3 * ryear
  583. WRITE(numsed,*)'redfield coef C,O,N P Dit '
  584. WRITE(numsed,'(5(F0.2,3X))')1./spo4r,so2ut/spo4r,srno3/spo4r,spo4r/spo4r,srDnit/spo4r
  585. WRITE(numsed,*)'threshold for stating denitrification [mol/l]'
  586. WRITE(numsed,'(1PE8.2)') sthrO2
  587. WRITE(numsed,*)'-------------------------------------------------------------------'
  588. WRITE(numsed,*)'Min-Max-Mean'
  589. WRITE(numsed,*)'For each variable : min, max, moy value observed on selected local zone'
  590. WRITE(numsed,*)'-------------------------------------------------------------------'
  591. WRITE(numsed,*)'thickness of the last wet layer dzkbot [m]'
  592. WRITE(numsed,'(3(F0.2,3X))') MINVAL(dzkbot(1:jpoce))/100.,MAXVAL(dzkbot(1:jpoce))/100.,&
  593. &SUM(dzkbot(1:jpoce))/jpoce/100.
  594. WRITE(numsed,*)'temp [°C]'
  595. WRITE(numsed,'(3(F0.2,3X))') MINVAL(temp(1:jpoce)),MAXVAL(temp(1:jpoce)),&
  596. & SUM(temp(1:jpoce))/jpoce
  597. WRITE(numsed,*)'salt o/oo'
  598. WRITE(numsed,'(3(F0.2,3X))')MINVAL(salt(1:jpoce)),MAXVAL(salt(1:jpoce)),&
  599. & SUM(salt(1:jpoce))/jpoce
  600. #if defined key_sed_off
  601. WRITE(numsed,*)'pressure [bar] (depth in m is about 10*pressure)'
  602. WRITE(numsed,'(3(F0.2,3X))') MINVAL(press(1:jpoce)),MAXVAL(press(1:jpoce)),&
  603. & SUM(press(1:jpoce))/jpoce
  604. #endif
  605. WRITE(numsed,*)'density of Sea Water'
  606. WRITE(numsed,'(3(F0.2,3X))') MINVAL(densSW(1:jpoce)), MAXVAL(densSW(1:jpoce)),&
  607. & SUM(densSW(1:jpoce))/jpoce
  608. WRITE(numsed,*)''
  609. WRITE(numsed,*)' Dissolved Components '
  610. WRITE(numsed,*)' ====================='
  611. WRITE(numsed,*)'[Si(OH)4] dissolved (1)(k=1)(µmol/l)(and min value in mol/kg of solution)'
  612. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwsil))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwsil))*1.e+6,&
  613. & SUM(pwcp(1:jpoce,1,jwsil))*1.e+6/jpoce,&
  614. & MINVAL(pwcp(1:jpoce,1,jwsil)*1.e+6/densSW(1:jpoce))
  615. WRITE(numsed,*)'[O2] dissolved (3) (k=1)(µmol/l)(and min value in mol/kg of solution)'
  616. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwoxy))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwoxy))*1.e+6,&
  617. &SUM(pwcp(1:jpoce,1,jwoxy))*1.e+6/jpoce,&
  618. &MINVAL(pwcp(1:jpoce,1,jwoxy)*1.e+6/densSW(1:jpoce))
  619. WRITE(numsed,*)'[DIC] dissolved (4) (k=1)(µmol/l)(and min value in mol/kg of solution)'
  620. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwdic))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwdic))*1.e+6,&
  621. &SUM(pwcp(1:jpoce,1,jwdic))*1.e+6/jpoce,&
  622. &MINVAL(pwcp(1:jpoce,1,jwdic)*1.e+6/densSW(1:jpoce))
  623. WRITE(numsed,*)'[NO3] dissolved (5) (k=1)(µmol/l)(and min value in mol/kg of solution)'
  624. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwno3))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwno3))*1.e+6,&
  625. &SUM(pwcp(1:jpoce,1,jwno3))*1.e+6/jpoce,&
  626. &MINVAL(pwcp(1:jpoce,1,jwno3)*1.e+6/densSW(1:jpoce))
  627. WRITE(numsed,*)'[PO4] dissolved (6) (k=1)(µmol/l)(and min value in mol/kg of solution)'
  628. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwpo4))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwpo4))*1.e+6,&
  629. &SUM(pwcp(1:jpoce,1,jwpo4))*1.e+6/jpoce,&
  630. &MINVAL(pwcp(1:jpoce,1,jwpo4)*1.e+6/densSW(1:jpoce))
  631. WRITE(numsed,*)'[Alk] dissolved (7) (k=1)(µequi)(and min value in mol/kg of solution)'
  632. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwalk))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwalk))*1.e+6,&
  633. &SUM(pwcp(1:jpoce,1,jwalk))*1.e+6/jpoce,&
  634. &MINVAL(pwcp(1:jpoce,1,jwalk)*1.e+6/densSW(1:jpoce))
  635. WRITE(numsed,*)'[DIC13] dissolved (8) (k=1)(µmol/l)(and min value in mol/kg of solution)'
  636. WRITE(numsed,'(4(F0.3,2X))') MINVAL(pwcp(1:jpoce,1,jwc13))*1.e+6,MAXVAL(pwcp(1:jpoce,1,jwc13))*1.e+6,&
  637. &SUM(pwcp(1:jpoce,1,jwc13))*1.e+6/jpoce,&
  638. &MINVAL(pwcp(1:jpoce,1,jwc13)*1.e+6/densSW(1:jpoce))
  639. WRITE(numsed,*)''
  640. WRITE(numsed,*)' Solid Components '
  641. WRITE(numsed,*)' ====================='
  642. WRITE(numsed,*)'nmole of Opale rained per dt'
  643. WRITE(numsed,'(3(1PE9.3,2X))') MINVAL(rainrm(1:jpoce,jsopal))*dtsed,MAXVAL(rainrm(1:jpoce,jsopal))*dtsed,&
  644. &SUM(rainrm(1:jpoce,1))*dtsed/jpoce
  645. WRITE(numsed,*)'nmole of Clay rained per dt'
  646. WRITE(numsed,'(3(1PE9.3,2X))') MINVAL(rainrm(1:jpoce,jsclay))*dtsed,MAXVAL(rainrm(1:jpoce,jsclay))*dtsed,&
  647. &SUM(rainrm(1:jpoce,jsclay))*dtsed/jpoce
  648. WRITE(numsed,*)'nmole of POC rained per dt'
  649. WRITE(numsed,'(3(1PE9.3,2X))') MINVAL(rainrm(1:jpoce,jspoc))*dtsed,MAXVAL(rainrm(1:jpoce,jspoc))*dtsed,&
  650. &SUM(rainrm(1:jpoce,jspoc))*dtsed/jpoce
  651. WRITE(numsed,*)'nmole of CaCO3 rained per dt'
  652. WRITE(numsed,'(3(1PE9.3,2X))') MINVAL(rainrm(1:jpoce,jscal))*dtsed,MAXVAL(rainrm(1:jpoce,jscal))*dtsed,&
  653. &SUM(rainrm(1:jpoce,jscal))*dtsed/jpoce
  654. WRITE(numsed,*)' '
  655. WRITE(numsed,*)'Weight frac of opal rained (%) '
  656. WRITE(numsed,'(3(F0.3,7X))') MINVAL(rainrg(1:jpoce,jsopal)/raintg(1:jpoce))*100.,&
  657. &MAXVAL(rainrg(1:jpoce,jsopal)/raintg(1:jpoce))*100.,&
  658. & SUM(rainrg(1:jpoce,jsopal)/raintg(1:jpoce))*100./jpoce
  659. WRITE(numsed,*)'Weight frac of clay rained (%) '
  660. WRITE(numsed,'(3(F0.3,7X))') MINVAL(rainrg(1:jpoce,jsclay)/raintg(1:jpoce))*100.,&
  661. &MAXVAL(rainrg(1:jpoce,jsclay)/raintg(1:jpoce))*100.,&
  662. &SUM(rainrg(1:jpoce,jsclay)/raintg(1:jpoce))*100./jpoce
  663. WRITE(numsed,*)'Weight frac of POC rained (%)'
  664. WRITE(numsed,'(3(F0.3,7X))') MINVAL(rainrg(1:jpoce,jspoc)/raintg(1:jpoce))*100.,&
  665. &MAXVAL(rainrg(1:jpoce,jspoc)/raintg(1:jpoce))*100.,&
  666. &SUM(rainrg(1:jpoce,jspoc)/raintg(1:jpoce))*100./jpoce
  667. WRITE(numsed,*)'Weight frac of CaCO3 rained (%)'
  668. WRITE(numsed,'(3(F0.3,7X))') MINVAL(rainrg(1:jpoce,jscal)/raintg(1:jpoce))*100.,&
  669. &MAXVAL(rainrg(1:jpoce,jscal)/raintg(1:jpoce))*100.,&
  670. &SUM(rainrg(1:jpoce,jscal)/raintg(1:jpoce))*100./jpoce
  671. WRITE(numsed,*)''
  672. WRITE(numsed,*)' Thickness of sediment layer added by particule rain, dzdep cm '
  673. WRITE(numsed,*)' =============================================================='
  674. WRITE(numsed,'(3(F0.5,2X))') MINVAL(dzdep(1:jpoce)),MAXVAL(dzdep(1:jpoce)),SUM(dzdep(1:jpoce))/jpoce
  675. WRITE(numsed,*)''
  676. WRITE(numsed,*)' chemical constants K1,pK1,K2,pK2,Kw,pKw and Kb pKb (min max) [mol/kgsol] or [mol/kgsol]2 '
  677. WRITE(numsed,*)' ========================================================================================='
  678. WRITE(numsed,'(4(1PE10.3,2X))')MINVAL(ak1s(1:jpoce)),MAXVAL(ak1s(1:jpoce)),-LOG10(MINVAL(ak1s(1:jpoce))),&
  679. &-LOG10(MAXVAL(ak1s(1:jpoce)))
  680. WRITE(numsed,'(4(1PE10.3,2X))')MINVAL(ak2s(1:jpoce)),MAXVAL(ak2s(1:jpoce)),-LOG10(MINVAL(ak2s(1:jpoce))),&
  681. &-LOG10(MAXVAL(ak2s(1:jpoce)))
  682. WRITE(numsed,'(4(1PE10.3,2X))')MINVAL(akws(1:jpoce)),MAXVAL(akws(1:jpoce)),-LOG10(MINVAL(akws(1:jpoce))),&
  683. &-LOG10(MAXVAL(akws(1:jpoce)))
  684. WRITE(numsed,'(4(1PE10.3,2X))')MINVAL(akbs(1:jpoce)),MAXVAL(akbs(1:jpoce)),-LOG10(MINVAL(akbs(1:jpoce))),&
  685. &-LOG10(MAXVAL(akbs(1:jpoce)))
  686. WRITE(numsed,*)'and boron'
  687. WRITE(numsed,'(2(1PE10.3,2X))')MINVAL(borats(1:jpoce)),MAXVAL(borats(1:jpoce))
  688. WRITE(numsed,*)''
  689. WRITE(numsed,*)' Compo of initial sediment for point jpoce'
  690. WRITE(numsed,*)' ========================================='
  691. WRITE(numsed,*)'solcp(1), solcp(2), solcp(3), solcp(4), hipor, pH, co3por'
  692. DO jk = 1,jpksed
  693. WRITE(numsed,'(7(1PE10.3,2X))')solcp(jpoce,jk,jsopal),solcp(jpoce,jk,jsclay),solcp(jpoce,jk,jspoc),solcp(jpoce,jk,jscal),&
  694. & hipor(jpoce,jk),-LOG10(hipor(jpoce,jk)/densSW(jpoce)),co3por(jpoce,jk)
  695. ENDDO
  696. WRITE(numsed,'(A82)')'pwcp(1), pwcp(2), pwcp(3), pwcp(4), pwcp(5), pwcp(6), pwcp(7)'
  697. DO jk = 1, jpksed
  698. WRITE(numsed,'(7(1PE10.3,2X))')pwcp(jpoce,jk,jwsil),pwcp(jpoce,jk,jwoxy),pwcp(jpoce,jk,jwdic),&
  699. & pwcp(jpoce,jk,jwno3),pwcp(jpoce,jk,jwpo4),pwcp(jpoce,jk,jwalk),pwcp(jpoce,jk,jwc13)
  700. ENDDO
  701. WRITE(numsed,*) ' '
  702. WRITE(numsed,*) ' End Of Initialization '
  703. WRITE(numsed,*) ' '
  704. !
  705. END SUBROUTINE sed_init_wri
  706. #else
  707. !!----------------------------------------------------------------------
  708. !! Dummy module : NO Sediment model
  709. !!----------------------------------------------------------------------
  710. !! $Id: sedini.F90 2355 2015-05-20 07:11:50Z ufla $
  711. CONTAINS
  712. SUBROUTINE sed_ini ! Empty routine
  713. END SUBROUTINE sed_ini
  714. #endif
  715. END MODULE sedini