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.
sedsol.F90 in NEMO/branches/2019/dev_r11708_aumont_PISCES_QUOTA/src/TOP/PISCES/SED – NEMO

source: NEMO/branches/2019/dev_r11708_aumont_PISCES_QUOTA/src/TOP/PISCES/SED/sedsol.F90 @ 14323

Last change on this file since 14323 was 14323, checked in by aumont, 3 years ago

major update of the sediment model

File size: 7.9 KB
Line 
1MODULE sedsol
2   !!======================================================================
3   !!              ***  MODULE  sedsol  ***
4   !!    Sediment : dissolution and reaction in pore water related
5   !!    related to organic matter
6   !!    Diffusion of solutes in pore water
7   !!=====================================================================
8   !! * Modules used
9   USE sed     ! sediment global variable
10   USE sed_oce
11   USE sedini
12   USE seddiff
13   USE seddsr
14   USE sedinorg
15   USE lib_mpp         ! distribued memory computing library
16   USE lib_fortran
17
18   IMPLICIT NONE
19   PRIVATE
20
21   PUBLIC sed_sol
22
23   !! * Module variables
24
25   !! $Id: sedsol.F90 5215 2015-04-15 16:11:56Z nicolasmartin $
26CONTAINS
27   
28   SUBROUTINE sed_sol( kt ) 
29      !!----------------------------------------------------------------------
30      !!                   ***  ROUTINE sed_sol  ***
31      !!
32      !!  ** Purpose :  computes pore water diffusion and reactions
33      !!
34      !!  ** Methode :  Computation of the redox and dissolution reactions
35      !!                in the sediment.
36      !!                The main redox reactions are solved in sed_dsr whereas
37      !!                the secondary reactions are solved in sed_dsr_redoxb.
38      !!                Inorganic dissolution is solved in sed_inorg
39      !!                A strand spliting approach is being used here (see
40      !!                sed_dsr_redoxb for more information).
41      !!                Diffusive fluxes are computed in sed_diff
42      !!
43      !!   History :
44      !!        !  98-08 (E. Maier-Reimer, Christoph Heinze )  Original code
45      !!        !  04-10 (N. Emprin, M. Gehlen ) f90
46      !!        !  06-04 (C. Ethe)  Re-organization
47      !!        !  19-08 (O. Aumont) Debugging and improvement of the model.
48      !!                             The original method is replaced by a
49      !!                             Strand splitting method which deals
50      !!                             well with stiff reactions.
51      !!----------------------------------------------------------------------
52      !! Arguments
53      INTEGER, INTENT(in) ::   kt
54      ! --- local variables
55      INTEGER  :: ji, jk, js, jw, jnt   ! dummy looop indices
56      REAL(wp) :: zadsnh4
57      !!
58      !!----------------------------------------------------------------------
59
60      IF( ln_timing )  CALL timing_start('sed_sol')
61!
62      IF( kt == nitsed000 ) THEN
63         IF (lwp) THEN
64            WRITE(numsed,*) ' sed_sol : Organic/inorganic degradation related reactions and diffusion'
65            WRITE(numsed,*) ' '
66         ENDIF
67!         !
68         dens_mol_wgt(1:jpsol) = denssol / mol_wgt(1:jpsol)
69         !
70      ENDIF
71
72      dtsed2 = dtsed / REAL( nrseddt, wp )
73
74      ! 1. Change of geometry
75      !    Increase of dz3d(2) thickness : dz3d(2) = dz3d(2)+dzdep
76      !    Warning : no change for dz(2)
77      !---------------------------------------------------------
78      dz3d(1:jpoce,2) = dz3d(1:jpoce,2) + dzdep(1:jpoce)
79
80      ! New values for volw3d(:,2) and vols3d(:,2)
81      ! Warning : no change neither for volw(2) nor  vols(2)
82      !------------------------------------------------------
83      volw3d(1:jpoce,2) = dz3d(1:jpoce,2) * por(2)
84      vols3d(1:jpoce,2) = dz3d(1:jpoce,2) * por1(2)
85
86      ! 2. Change of previous solid fractions (due to volum changes) for k=2
87      !---------------------------------------------------------------------
88
89      DO js = 1, jpsol
90         DO ji = 1, jpoce
91            solcp(ji,2,js) = solcp(ji,2,js) * dz(2) / dz3d(ji,2)
92         ENDDO
93      END DO
94
95      ! 3. New solid fractions (including solid rain fractions) for k=2
96      !------------------------------------------------------------------
97      DO js = 1, jpsol
98         DO ji = 1, jpoce
99            IF (raintg(ji) .ne. 0) THEN
100               solcp(ji,2,js) = solcp(ji,2,js) + &
101               &           ( rainrg(ji,js) / raintg(ji) ) * ( dzdep(ji) / dz3d(ji,2) )
102               ! rainrm are temporary cancel
103               rainrm(ji,js) = 0.
104            ENDIF
105         END DO
106      ENDDO
107
108      ! 4.  Adjustment of bottom water concen.(pwcp(1)):
109      !     We impose that pwcp(2) is constant. Including dzdep in dz3d(:,2) we assume
110      !     that dzdep has got a porosity of por(2). So pore water volum of jk=2 increase.
111      !     To keep pwcp(2) cste we must compensate this "increase" by a slight adjusment
112      !     of bottom water concentration.
113      !     This adjustment is compensate at the end of routine
114      !-------------------------------------------------------------
115      DO jw = 1, jpwat
116         DO ji = 1, jpoce
117            pwcp(ji,1,jw) = pwcp(ji,1,jw) - &
118               &            pwcp(ji,2,jw) * dzdep(ji) * por(2) / ( dzkbot(ji) + rtrn )
119         END DO
120      ENDDO
121
122      zadsnh4 = 1.0 / ( 1.0 + adsnh4 )
123
124      ! --------------------------------------------------
125      ! Computation of the diffusivities
126      ! --------------------------------------------------
127
128      DO js = 1, jpwat
129         DO jk = 1, jpksed
130            DO ji = 1, jpoce
131               diff(ji,jk,js) = ( diff1(js) + diff2(js) * temp(ji) ) / ( 1.0 - 2.0 * log( por(jk) ) )
132            END DO
133         END DO
134      END DO
135
136      ! Impact of bioirrigation and adsorption on diffusion
137      ! ---------------------------------------------------
138
139      diff(:,:,jwnh4) = diff(:,:,jwnh4) * ( 1.0 + irrig(:,:) ) * zadsnh4
140      diff(:,:,jwsil) = diff(:,:,jwsil) * ( 1.0 + irrig(:,:) )
141      diff(:,:,jwoxy) = diff(:,:,jwoxy) * ( 1.0 + irrig(:,:) )
142      diff(:,:,jwdic) = diff(:,:,jwdic) * ( 1.0 + irrig(:,:) )
143      diff(:,:,jwno3) = diff(:,:,jwno3) * ( 1.0 + irrig(:,:) )
144      diff(:,:,jwpo4) = diff(:,:,jwpo4) * ( 1.0 + irrig(:,:) )
145      diff(:,:,jwalk) = diff(:,:,jwalk) * ( 1.0 + irrig(:,:) )
146      diff(:,:,jwh2s) = diff(:,:,jwh2s) * ( 1.0 + irrig(:,:) )
147      diff(:,:,jwso4) = diff(:,:,jwso4) * ( 1.0 + irrig(:,:) )
148      diff(:,:,jwfe2) = diff(:,:,jwfe2) * ( 1.0 + 0.2 * irrig(:,:) )
149
150      DO jnt = 1, nrseddt
151         CALL sed_diff( kt, jnt )         ! 1st pass in diffusion to get values at t+1/2
152         CALL sed_dsr  ( kt, jnt )        ! Redox reactions
153         CALL sed_inorg( kt, jnt )        ! Inorganic reactions (dissolution)
154         CALL sed_diff ( kt, jnt )        ! 2nd pass in diffusion to get values at t+1
155      END DO
156
157      !----------------------------------
158      !   Back to initial geometry
159      !-----------------------------
160
161      !---------------------------------------------------------------------
162      !   1/ Compensation for ajustement of the bottom water concentrations
163      !      (see note n� 1 about *por(2))
164      !--------------------------------------------------------------------
165      DO jw = 1, jpwat
166         DO ji = 1, jpoce
167            pwcp(ji,1,jw) = pwcp(ji,1,jw) + &
168               &            pwcp(ji,2,jw) * dzdep(ji) * por(2) / dzkbot(ji)
169         END DO
170      ENDDO
171
172      !-----------------------------------------------------------------------
173      !    2/ Det of new rainrg taking account of the new weight fraction
174      !    obtained
175      !      in dz3d(2) after diffusion/reaction (react/diffu are also in
176      !      dzdep!)
177      !      This new rain (rgntg rm) will be used in advection/burial routine
178      !------------------------------------------------------------------------
179      DO js = 1, jpsol
180         DO ji = 1, jpoce
181            rainrg(ji,js) = raintg(ji) * solcp(ji,2,js)
182            rainrm(ji,js) = rainrg(ji,js) / mol_wgt(js)
183         END DO
184      ENDDO
185
186      !  New raintg
187      raintg(:) = 0.
188      DO js = 1, jpsol
189         DO ji = 1, jpoce
190            raintg(ji) = raintg(ji) + rainrg(ji,js)
191         END DO
192      ENDDO
193
194      !--------------------------------
195      !    3/ back to initial geometry
196      !--------------------------------
197      DO ji = 1, jpoce
198         dz3d  (ji,2) = dz(2)
199         volw3d(ji,2) = dz3d(ji,2) * por(2)
200         vols3d(ji,2) = dz3d(ji,2) * por1(2)
201      ENDDO
202
203      IF( ln_timing )  CALL timing_stop('sed_sol')
204!     
205   END SUBROUTINE sed_sol
206
207END MODULE sedsol
Note: See TracBrowser for help on using the repository browser.