Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
MODULE sedfunc
!!======================================================================
!! *** MODULE sedsol ***
!! Sediment : dissolution and reaction in pore water related
!! related to organic matter
!! Diffusion of solutes in pore water
!!=====================================================================
!! * Modules used
USE sed ! sediment global variable
USE sed_oce
USE sedini
USE seddsr
USE sedmat
USE lib_mpp ! distribued memory computing library
USE lib_fortran
IMPLICIT NONE
PRIVATE
PUBLIC sed_func
!! * Module variables
!! $Id: sedsol.F90 5215 2015-04-15 16:11:56Z nicolasmartin $
CONTAINS
SUBROUTINE sed_func( NEQ, X, fval0, accmask )
!!----------------------------------------------------------------------
!! *** ROUTINE sed_sol ***
!!
!! ** Purpose : computes pore water diffusion and reactions
!!
!! ** Methode : Computation of the redox and dissolution reactions
!! in the sediment.
!! The main redox reactions are solved in sed_dsr whereas
!! the secondary reactions are solved in sed_dsr_redoxb.
!! Inorganic dissolution is solved in sed_inorg
!! A strand spliting approach is being used here (see
!! sed_dsr_redoxb for more information).
!! Diffusive fluxes are computed in sed_diff
!!
!! History :
!! ! 98-08 (E. Maier-Reimer, Christoph Heinze ) Original code
!! ! 04-10 (N. Emprin, M. Gehlen ) f90
!! ! 06-04 (C. Ethe) Re-organization
!! ! 19-08 (O. Aumont) Debugging and improvement of the model.
!! The original method is replaced by a
!! Strand splitting method which deals
!! well with stiff reactions.
!!----------------------------------------------------------------------
!! Arguments
INTEGER, INTENT(in) :: NEQ
INTEGER, DIMENSION(jpoce), INTENT(in) :: accmask
REAL, DIMENSION(jpoce,NEQ), INTENT(in) :: X
REAL, DIMENSION(jpoce,NEQ), INTENT(out) :: fval0
! --- local variables
INTEGER :: ji, jk, js, jn ! dummy looop indices
!!
!!----------------------------------------------------------------------
IF( ln_timing ) CALL timing_start('sed_func')
!
pwcpa(:,:,:) = 0.
solcpa(:,:,:) = 0.
do jn = 1, NEQ
jk = jarr(jn,1)
js = jarr(jn,2)
IF (js <= jpwat) THEN
pwcp(:,jk,js) = X(:,jn) * 1E-6
ELSE
solcp(:,jk,js-jpwat) = X(:,jn) * 1E-6
ENDIF
END DO
CALL sed_dsr( accmask ) ! Redox reactions
! Computes diffusive fluxes
DO jn = 1, jpvode
js = jsvode(jn)
IF (js <= jpwat) CALL sed_mat_dsr( jpksed, js, accmask )
END DO
call sed_mat_btb( jpksed, jwnh4, accmask )
call sed_mat_btb( jpksed, jwfe2, accmask )
do jn = 1, NEQ
jk = jarr(jn,1)
js = jarr(jn,2)
IF (js <= jpwat) THEN
fval0(:,jn) = pwcpa(:,jk,js) * 1E6
ELSE
fval0(:,jn) = solcpa(:,jk,js-jpwat) * 1E6
ENDIF
END DO
IF( ln_timing ) CALL timing_stop('sed_func')
!
END SUBROUTINE sed_func
END MODULE sedfunc