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/branches/UKMO/dev_r9922_GC3_cpl_pkg/src/TOP/PISCES/SED – NEMO

source: NEMO/branches/UKMO/dev_r9922_GC3_cpl_pkg/src/TOP/PISCES/SED/sed.F90 @ 9947

Last change on this file since 9947 was 9947, checked in by timgraham, 6 years ago

Clear svn keywords

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