-
Notifications
You must be signed in to change notification settings - Fork 1
/
p4zbio.F90
147 lines (131 loc) · 5.94 KB
/
p4zbio.F90
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
MODULE p4zbio
!!======================================================================
!! *** MODULE p4zbio ***
!! TOP : PISCES bio-model
!!======================================================================
!! History : 1.0 ! 2004 (O. Aumont) Original code
!! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90
!!----------------------------------------------------------------------
#if defined key_pisces
!!----------------------------------------------------------------------
!! 'key_pisces' PISCES bio-model
!!----------------------------------------------------------------------
!! p4z_bio : computes the interactions between the different
!! compartments of PISCES
!!----------------------------------------------------------------------
USE oce_trc ! shared variables between ocean and passive tracers
USE trc ! passive tracers common variables
USE sms_pisces ! PISCES Source Minus Sink variables
USE p4zsink ! vertical flux of particulate matter due to sinking
USE p4zopt ! optical model
USE p4zlim ! Co-limitations of differents nutrients
USE p4zprod ! Growth rate of the 2 phyto groups
USE p4zmort ! Mortality terms for phytoplankton
USE p4zmicro ! Sources and sinks of microzooplankton
USE p4zmeso ! Sources and sinks of mesozooplankton
USE p4zrem ! Remineralisation of organic matter
USE prtctl_trc ! print control for debugging
USE iom ! I/O manager
IMPLICIT NONE
PRIVATE
PUBLIC p4z_bio
!!* Substitution
# include "top_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/TOP 3.3 , NEMO Consortium (2010)
!! $Id: p4zbio.F90 3160 2011-11-20 14:27:18Z cetlod $
!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE p4z_bio ( kt, jnt )
!!---------------------------------------------------------------------
!! *** ROUTINE p4z_bio ***
!!
!! ** Purpose : Ecosystem model in the whole ocean: computes the
!! different interactions between the different compartments
!! of PISCES
!!
!! ** Method : - ???
!!---------------------------------------------------------------------
INTEGER, INTENT(in) :: kt, jnt
INTEGER :: ji, jj, jk, jn
REAL(wp) :: ztra
#if defined key_kriest
REAL(wp) :: zcoef1, zcoef2
#endif
CHARACTER (len=25) :: charout
!!---------------------------------------------------------------------
!
IF( nn_timing == 1 ) CALL timing_start('p4z_bio')
!
! ASSIGN THE SHEAR RATE THAT IS USED FOR AGGREGATION
! OF PHYTOPLANKTON AND DETRITUS
xdiss(:,:,:) = 1.
!!gm the use of nmld should be better here?
DO jk = 2, jpkm1
DO jj = 1, jpj
DO ji = 1, jpi
IF( fsdepw(ji,jj,jk+1) > hmld(ji,jj) ) xdiss(ji,jj,jk) = 0.01
END DO
END DO
END DO
CALL p4z_sink ( kt, jnt ) ! vertical flux of particulate organic matter
CALL p4z_opt ( kt, jnt ) ! Optic: PAR in the water column
CALL p4z_lim ( kt ) ! co-limitations by the various nutrients
CALL p4z_prod ( kt, jnt ) ! phytoplankton growth rate over the global ocean.
! ! (for each element : C, Si, Fe, Chl )
CALL p4z_rem ( kt, jnt ) ! remineralization terms of organic matter+scavenging of Fe
CALL p4z_mort ( kt, jnt ) ! phytoplankton mortality
! ! zooplankton sources/sinks routines
CALL p4z_micro( kt, jnt ) ! microzooplankton
CALL p4z_meso ( kt, jnt ) ! mesozooplankton
! ! test if tracers concentrations fall below 0.
xnegtr(:,:,:) = 1.e0
DO jn = jp_pcs0, jp_pcs1
DO jk = 1, jpk
DO jj = 1, jpj
DO ji = 1, jpi
IF( ( trn(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) < 0.e0 ) THEN
ztra = ABS( ( trn(ji,jj,jk,jn) - rtrn ) &
/ ( tra(ji,jj,jk,jn) + rtrn ) )
xnegtr(ji,jj,jk) = MIN( xnegtr(ji,jj,jk), ztra )
ENDIF
END DO
END DO
END DO
END DO
! ! where at least 1 tracer concentration becomes negative
! !
DO jn = jp_pcs0, jp_pcs1
trn(:,:,:,jn) = trn(:,:,:,jn) + xnegtr(:,:,:) * tra(:,:,:,jn)
END DO
tra(:,:,:,:) = 0.e0
#if defined key_kriest
!
zcoef1 = 1.e0 / xkr_massp
zcoef2 = 1.e0 / xkr_massp / 1.1
DO jk = 1,jpkm1
trn(:,:,jk,jpnum) = MAX( trn(:,:,jk,jpnum), trn(:,:,jk,jppoc) * zcoef1 / xnumm(jk) )
trn(:,:,jk,jpnum) = MIN( trn(:,:,jk,jpnum), trn(:,:,jk,jppoc) * zcoef2 )
END DO
#endif
!
IF(ln_ctl) THEN ! print mean trends (used for debugging)
WRITE(charout, FMT="('bio ')")
CALL prt_ctl_trc_info(charout)
CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm)
ENDIF
!
IF( nn_timing == 1 ) CALL timing_stop('p4z_bio')
!
END SUBROUTINE p4z_bio
#else
!!======================================================================
!! Dummy module : No PISCES bio-model
!!======================================================================
CONTAINS
SUBROUTINE p4z_bio ! Empty routine
END SUBROUTINE p4z_bio
#endif
!!======================================================================
END MODULE p4zbio