New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sed.F90 in NEMO/trunk/src/TOP/PISCES/SED – NEMO

source: NEMO/trunk/src/TOP/PISCES/SED/sed.F90 @ 10222

Last change on this file since 10222 was 10222, checked in by aumont, 5 years ago

update of the sediment module + enhancement, bug correction in PISCES generating O2 negative values

  • Property svn:keywords set to Id
File size: 10.9 KB
Line 
1MODULE sed
2   !!======================================================================
3   !!                        ***  sed  ***
4   !! Sediment :   set sediment global variables
5   !!======================================================================
6   !! History :
7   !!        !  06-12  (C. Ethe)  Orignal
8   !!----------------------------------------------------------------------
9   USE par_sed
10   USE oce_sed
11   USE in_out_manager
12
13
14   IMPLICIT NONE
15   PUBLIC
16
17   PUBLIC sed_alloc
18
19   !! Namelist
20   REAL(wp), PUBLIC               ::  reac_sil            !: reactivity of silicate in  [l.mol-1.s-1]
21   REAL(wp), PUBLIC               ::  reac_clay           !: reactivity of clay in  [l.mol-1.s-1]
22   REAL(wp), PUBLIC               ::  reac_ligc           !: reactivity of Ligands [l.mol-1.s-1]
23   REAL(wp), PUBLIC               ::  reac_pocl           !: reactivity of pocl in  [s-1]
24   REAL(wp), PUBLIC               ::  reac_pocs           !: reactivity of pocs in  [s-1]
25   REAL(wp), PUBLIC               ::  reac_pocr           !: reactivity of pocr in  [s-1]
26   REAL(wp), PUBLIC               ::  reac_nh4            !: reactivity of NH4 in  [l.mol-1.s-1]
27   REAL(wp), PUBLIC               ::  reac_h2s            !: reactivity of ODU in  [l.mol-1.s-1]
28   REAL(wp), PUBLIC               ::  reac_fe2            !: reactivity of Fe2+ in  [l.mol-1.s-1]
29   REAL(wp), PUBLIC               ::  reac_feh2s          !: reactivity of Fe2+ in  [l.mol-1.s-1]
30   REAL(wp), PUBLIC               ::  reac_fes            !: reactivity of Fe with H2S in  [l.mol-1.s-1]
31   REAL(wp), PUBLIC               ::  reac_feso           !: reactivity of FeS with O2 in  [l.mol-1.s-1]
32   REAL(wp), PUBLIC               ::  reac_cal            !: reactivity of cal in  [l.mol-1.s-1]
33   REAL(wp), PUBLIC               ::  adsnh4              !: adsorption coefficient of NH4
34   REAL(wp), PUBLIC               ::  ratligc             !: C/L ratio in POC
35   REAL(wp), PUBLIC               ::  so2ut 
36   REAL(wp), PUBLIC               ::  srno3 
37   REAL(wp), PUBLIC               ::  spo4r 
38   REAL(wp), PUBLIC               ::  srDnit 
39   REAL(wp), PUBLIC               ::  dtsed               !: sedimentation time step
40   REAL(wp), PUBLIC               ::  dtsed2              !: sedimentation time step
41   INTEGER , PUBLIC               ::  nitsed000
42   INTEGER , PUBLIC               ::  nitsedend
43   INTEGER, PUBLIC                ::  nrseddt
44   REAL    , PUBLIC               ::  sedmask
45   REAL(wp), PUBLIC               ::  denssol                !: density of solid material
46   INTEGER , PUBLIC               ::  numrsr, numrsw   !: logical unit for sed restart (read and write)
47   LOGICAL , PUBLIC               ::  lrst_sed       !: logical to control the trc restart write
48   LOGICAL , PUBLIC               ::  ln_rst_sed  = .TRUE.     !: initialisation from a restart file or not
49   LOGICAL , PUBLIC               ::  ln_btbz     = .FALSE.    !: Depth variation of the bioturbation coefficient
50   LOGICAL , PUBLIC               ::  ln_irrig    = .FALSE.    !: iActivation of the bioirrigation
51   LOGICAL , PUBLIC               ::  ln_sed_2way = .FALSE.    !: 2 way coupling with PISCES
52   LOGICAL , PUBLIC               ::  ln_sediment_offline = .FALSE. !: Offline mode for sediment module
53   INTEGER             , PUBLIC   ::  nn_rstsed      !: control of the time step ( 0 or 1 ) for pass. tr.
54   INTEGER , PUBLIC               ::  nn_dtsed = 1   !: frequency of step on passive tracers
55   CHARACTER(len = 80) , PUBLIC   ::  cn_sedrst_in   !: suffix of pass. tracer restart name (input)
56   CHARACTER(len = 256), PUBLIC   ::  cn_sedrst_indir  !: restart input directory
57   CHARACTER(len = 80) , PUBLIC   ::  cn_sedrst_out  !: suffix of pass. tracer restart name (output)
58   CHARACTER(len = 256), PUBLIC   ::  cn_sedrst_outdir  !: restart output directory
59
60   !
61   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  pwcp       !: pore water sediment data at given time-step
62   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  pwcp0      !: pore water sediment data at initial time
63   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  solcp      !: solid sediment data at given time-step
64   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  solcp0     !: solid sediment data at initial time
65   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  trc_dta
66   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  diff
67
68   !! * Shared module variables
69   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  pwcp_dta   !: pore water data at given time-step
70   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  rainrm_dta !: rain data at at initial time
71   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  rainrm     !: rain data at given time-step
72   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  rainrg     !: rain of each solid component in [g/(cm**2.s)]
73   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  fromsed    !:
74   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  tosed      !:
75   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  rloss      !:
76   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  tokbot       
77   !
78   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  temp       !: temperature
79   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  salt       !: salinity
80   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  press      !: pressure
81   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  raintg     !: total massic flux rained in each cell (sum of sol. comp.)
82   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  fecratio   !: Fe/C ratio in falling particles to the sediments
83   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  dzdep      !: total thickness of solid material rained [cm] in each cell
84   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  zkbot      !: total thickness of solid material rained [cm] in each cell
85   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  wacc       !: total thickness of solid material rained [cm] in each cell
86   !
87   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  hipor      !: [h+] in mol/kg*densSW
88   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  co3por     !: [co3--]solid sediment at initial time
89   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  dz3d       !:  ???
90   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  volw3d     !:  ???
91   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  vols3d     !:  ???
92
93
94   !! Chemistry
95   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  densSW 
96   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  borats 
97   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  calcon2
98   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  akbs 
99   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak1s 
100   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak2s   
101   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  akws 
102   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak12s 
103   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak1ps 
104   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak2ps 
105   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak3ps 
106   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak12ps 
107   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  ak123ps
108   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  aksis 
109   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  aksps 
110   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  sieqs
111   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  aks3s
112   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  akf3s
113   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  sulfats
114   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  fluorids
115
116   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  mol_wgt    !: molecular weight of solid sediment data
117 
118   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::  trc_data    !: tracer data to share with sediment model
119   !! Geometry
120   INTEGER , PUBLIC, SAVE                          ::  jpoce, indoce !: Ocean points ( number/indices )
121   INTEGER , PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  iarroce       !: Computation of 1D array of sediments points
122   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  epkbot        !: ocean bottom layer thickness
123   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  gdepbot       !: Depth of the sediment
124   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  dzkbot        !: ocean bottom layer thickness in meters
125   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  dz            !: sediment layers thickness
126   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  por           !: porosity profile     
127   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  por1          !: 1-por
128   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  volw          !: volume of pore water cell fraction
129   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  vols          !: volume of solid cell fraction
130   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  db            !: bioturbation ceofficient
131   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE ::  irrig        !: bioturbation ceofficient
132   REAL(wp), PUBLIC, DIMENSION(:    ), ALLOCATABLE ::  rdtsed        !:  sediment model time-step
133   REAL(wp), PUBLIC, DIMENSION(:,:  ), ALLOCATABLE :: sedligand
134   REAL(wp)  ::   dens               !: density of solid material
135   !! Inputs / Outputs
136   CHARACTER( len = 80 ), DIMENSION(jptrased  ) ::  sedtrcl
137   CHARACTER( len = 20 ), DIMENSION(jptrased  ) ::  sedtrcd , sedtrcu
138   CHARACTER( len = 80 ), DIMENSION(jpdia3dsed) ::  seddia3l 
139   CHARACTER( len = 20 ), DIMENSION(jpdia3dsed) ::  seddia3d, seddia3u
140   CHARACTER( len = 80 ), DIMENSION(jpdia2dsed) ::  seddia2l 
141   CHARACTER( len = 20 ), DIMENSION(jpdia2dsed) ::  seddia2d, seddia2u
142   !
143   REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE ::  trcsedi
144   REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE ::  flxsedi3d
145   REAL(wp), PUBLIC, DIMENSION(:,:,:  ), ALLOCATABLE ::  flxsedi2d
146
147   INTEGER, PUBLIC ::  numsed = 27    ! units
148
149   !! $Id$
150CONTAINS
151
152   INTEGER FUNCTION sed_alloc()
153      !!-------------------------------------------------------------------
154      !!                    *** ROUTINE sed_alloc ***
155      !!-------------------------------------------------------------------
156      USE lib_mpp, ONLY: ctl_warn
157      !!-------------------------------------------------------------------
158      !
159      ALLOCATE( trc_data(jpi,jpj,jpdta)                                   ,   &
160         &      epkbot(jpi,jpj), gdepbot(jpi,jpj)        ,   &
161         &      dz(jpksed)  , por(jpksed) , por1(jpksed)                  ,   &
162         &      volw(jpksed), vols(jpksed), rdtsed(jpksed)  ,   &
163         &      trcsedi  (jpi,jpj,jpksed,jptrased)                        ,   &
164         &      flxsedi3d(jpi,jpj,jpksed,jpdia3dsed)                      ,   &
165         &      flxsedi2d(jpi,jpj,jpdia2dsed)                             ,   &
166         &      mol_wgt(jpsol),                                           STAT=sed_alloc )
167
168      IF( sed_alloc /= 0 )   CALL ctl_warn('sed_alloc: failed to allocate arrays')
169      !
170   END FUNCTION sed_alloc
171
172END MODULE sed
Note: See TracBrowser for help on using the repository browser.