sed.F90 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. MODULE sed
  2. !!======================================================================
  3. !! *** sed ***
  4. !! Sediment : set sediment global variables
  5. !!======================================================================
  6. #if defined key_sed
  7. !! History :
  8. !! ! 06-12 (C. Ethe) Orignal
  9. !!----------------------------------------------------------------------
  10. USE par_sed
  11. USE in_out_manager
  12. IMPLICIT NONE
  13. PUBLIC
  14. PUBLIC sed_alloc
  15. USE dom_oce , ONLY : nidom => nidom !:
  16. USE dom_oce , ONLY : glamt => glamt !: longitude of t-point (degre)
  17. USE dom_oce , ONLY : gphit => gphit !: latitude of t-point (degre)
  18. USE dom_oce , ONLY : e3t_1d => e3t_1d !: reference depth of t-points (m)
  19. USE dom_oce , ONLY : mbkt => mbkt !: vertical index of the bottom last T- ocean level
  20. USE dom_oce , ONLY : tmask => tmask !: land/ocean mask at t-points
  21. USE dom_oce , ONLY : rdt => rdt !: time step for the dynamics
  22. USE dom_oce , ONLY : nyear => nyear !: Current year
  23. USE dom_oce , ONLY : nmonth => nmonth !: Current month
  24. USE dom_oce , ONLY : nday => nday !: Current day
  25. USE dom_oce , ONLY : ndastp => ndastp !: time step date in year/month/day aammjj
  26. USE dom_oce , ONLY : nday_year => nday_year !: curent day counted from jan 1st of the current year
  27. USE dom_oce , ONLY : adatrj => adatrj !: number of elapsed days since the begining of the run
  28. ! !: it is the accumulated duration of previous runs
  29. ! !: that may have been run with different time steps.
  30. #if ! defined key_sed_off
  31. USE oce , ONLY : tsn => tsn !: pot. temperature (celsius) and salinity (psu)
  32. USE trc , ONLY : trn => trc !: tracer
  33. USE trc , ONLY : nwritetrc => nwritetrc !: outputs frequency of tracer model
  34. USE p4zsink , ONLY : sinking => sinking !: sinking flux for POC
  35. #if ! defined key_kriest
  36. USE p4zsink , ONLY : sinking2 => sinking2 !: sinking flux for GOC
  37. #endif
  38. USE p4zsink , ONLY : sinkcal => sinkcal !: sinking flux for calcite
  39. USE p4zsink , ONLY : sinksil => sinksil !: sinking flux for opal ( dsi )
  40. USE sms_pisces, ONLY : akb3 => akb3 !: Chemical constants
  41. USE sms_pisces, ONLY : ak13 => ak13 !: Chemical constants
  42. USE sms_pisces, ONLY : ak23 => ak23 !: Chemical constants
  43. USE sms_pisces, ONLY : akw3 => akw3 !: Chemical constants
  44. USE sms_pisces, ONLY : aksp => aksp !: Chemical constants
  45. USE sms_pisces, ONLY : borat => borat !: Chemical constants ( borat )
  46. #endif
  47. !! Namelist
  48. REAL(wp), PUBLIC, DIMENSION(5) :: reac !: reactivity rc in [l.mol-1.s-1]
  49. REAL(wp), PUBLIC :: reac_sil !: reactivity of silicate in [l.mol-1.s-1]
  50. REAL(wp), PUBLIC :: reac_clay !: reactivity of clay in [l.mol-1.s-1]
  51. REAL(wp), PUBLIC :: reac_poc !: reactivity of poc in [l.mol-1.s-1]
  52. REAL(wp), PUBLIC :: reac_no3 !: reactivity of no3 in [l.mol-1.s-1]
  53. REAL(wp), PUBLIC :: reac_cal !: reactivity of cal in [l.mol-1.s-1]
  54. REAL(wp), PUBLIC :: sat_sil !: saturation concentration for silicate in [mol.l-1]
  55. REAL(wp), PUBLIC :: sat_clay !: saturation concentration for clay in [mol.l-1]
  56. REAL(wp), PUBLIC :: so2ut
  57. REAL(wp), PUBLIC :: srno3
  58. REAL(wp), PUBLIC :: spo4r
  59. REAL(wp), PUBLIC :: srDnit
  60. REAL(wp), PUBLIC :: sthro2 !: threshold O2 concen. in [mol.l-1]
  61. REAL(wp), PUBLIC :: pdb = 0.0112372 !: 13C/12C in PD Belemnite
  62. REAL(wp), PUBLIC :: rc13P = 0.980 !: 13C/12C in POC = rc13P*PDB
  63. REAL(wp), PUBLIC :: rc13Ca = 1.001 !: 13C/12C in CaCO3 = rc13Ca*PDB
  64. REAL(wp), PUBLIC :: dtsed !: sedimentation time step
  65. REAL(wp), PUBLIC :: db !: bioturb coefficient in [cm2.s-1]
  66. INTEGER , PUBLIC :: nitsed000
  67. INTEGER , PUBLIC :: nitsedend
  68. INTEGER , PUBLIC :: nwrised
  69. INTEGER , PUBLIC :: nfreq
  70. REAL(wp), PUBLIC :: dens !: density of solid material
  71. !
  72. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: pwcp !: pore water sediment data at given time-step
  73. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: pwcp0 !: pore water sediment data at initial time
  74. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: solcp !: solid sediment data at given time-step
  75. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: solcp0 !: solid sediment data at initial time
  76. !! * Shared module variables
  77. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: pwcp_dta !: pore water data at given time-step
  78. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: rainrm_dta !: rain data at at initial time
  79. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: rainrm !: rain data at given time-step
  80. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: rainrg !: rain of each solid component in [g/(cm**2.s)]
  81. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: fromsed !:
  82. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: tosed !:
  83. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: rloss !:
  84. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: tokbot
  85. !
  86. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: temp !: temperature
  87. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: salt !: salinity
  88. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: press !: pressure
  89. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: raintg !: total massic flux rained in each cell (sum of sol. comp.)
  90. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: dzdep !: total thickness of solid material rained [cm] in each cell
  91. !
  92. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: hipor !: [h+] in mol/kg*densSW
  93. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: co3por !: [co3--]solid sediment at initial time
  94. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: dz3d !: ???
  95. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: volw3d !: ???
  96. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: vols3d !: ???
  97. !! Chemistry
  98. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: densSW
  99. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: borats
  100. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: calcon2
  101. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: akbs
  102. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak1s
  103. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak2s
  104. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: akws
  105. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak12s
  106. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak1ps
  107. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak2ps
  108. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak3ps
  109. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak12ps
  110. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: ak123ps
  111. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: aksis
  112. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: aksps
  113. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: mol_wgt !: molecular weight of solid sediment data
  114. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: trc_data !: tracer data to share with sediment model
  115. !! Geometry
  116. INTEGER , PUBLIC, SAVE :: jpoce, indoce !: Ocean points ( number/indices )
  117. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: iarroce !: Computation of 1D array of sediments points
  118. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: epkbot !: ocean bottom layer thickness
  119. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: dzkbot !: ocean bottom layer thickness in meters
  120. REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: tmasksed !: sediment mask
  121. REAL(wp), PUBLIC, DIMENSION(:,: ), ALLOCATABLE :: sbathy !: bathymetry
  122. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: dz !: sediment layers thickness
  123. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: por !: porosity profile
  124. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: por1 !: 1-por
  125. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: profsed !: depth of middle of each layer
  126. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: volw !: volume of pore water cell fraction
  127. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: vols !: volume of solid cell fraction
  128. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: diff !: diffusion ceofficient
  129. REAL(wp), PUBLIC, DIMENSION(: ), ALLOCATABLE :: rdtsed !: sediment model time-step
  130. REAL(wp) :: dens !: density of solid material
  131. !! Inputs / Outputs
  132. CHARACTER( len = 80 ), DIMENSION(jptrased ) :: sedtrcl
  133. CHARACTER( len = 20 ), DIMENSION(jptrased ) :: sedtrcd , sedtrcu
  134. CHARACTER( len = 80 ), DIMENSION(jpdia3dsed) :: seddia3l
  135. CHARACTER( len = 20 ), DIMENSION(jpdia3dsed) :: seddia3d, seddia3u
  136. CHARACTER( len = 80 ), DIMENSION(jpdia2dsed) :: seddia2l
  137. CHARACTER( len = 20 ), DIMENSION(jpdia2dsed) :: seddia2d, seddia2u
  138. !
  139. REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE :: trcsedi
  140. REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE :: flxsedi3d
  141. REAL(wp), PUBLIC, DIMENSION(:,:,: ), ALLOCATABLE :: flxsedi2d
  142. INTEGER, PUBLIC :: numsed = 27 ! units
  143. !! $Id: sed.F90 2355 2015-05-20 07:11:50Z ufla $
  144. CONTAINS
  145. INTEGER FUNCTION sed_alloc()
  146. !!-------------------------------------------------------------------
  147. !! *** ROUTINE sed_alloc ***
  148. !!-------------------------------------------------------------------
  149. USE lib_mpp, ONLY: ctl_warn
  150. !!-------------------------------------------------------------------
  151. !
  152. ALLOCATE( trc_dta(jpi,jpj,jdta) , &
  153. & epkbot(jpi,jpj), sbathy(jpi,jpj) , &
  154. & tmasksed(jpi,jpj,jpksed) , &
  155. & dz(jpksed) , por(jpksed) , por1(jpksed), profsed(jpksed) , &
  156. & volw(jpksed), vols(jpksed), diff(jpksed), rdtsed(jpksed) , &
  157. & trcsedi (jpi,jpj,jpksed,jptrased) , &
  158. & flxsedi3d(jpi,jpj,jpksed,jpdia3dsed) , &
  159. & flxsedi2d(jpi,jpj,jpksed,jpdia2dsed) , &
  160. & mol_wgt(jpsol), STAT=sed_alloc )
  161. IF( sed_alloc /= 0 ) CALL ctl_warn('sed_alloc: failed to allocate arrays')
  162. !
  163. END FUNCTION sed_alloc
  164. #else
  165. !!======================================================================
  166. !! No Sediment model
  167. !!======================================================================
  168. #endif
  169. END MODULE sed