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.
p4zrem.F90 in branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z – NEMO

source: branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90 @ 7041

Last change on this file since 7041 was 7041, checked in by cetlod, 8 years ago

ROBUST5_CNRS : implementation of part I of new TOP interface - 1st step -, see ticket #1782

File size: 16.9 KB
Line 
1MODULE p4zrem
2   !!======================================================================
3   !!                         ***  MODULE p4zrem  ***
4   !! TOP :   PISCES Compute remineralization/dissolution of organic compounds
5   !!=========================================================================
6   !! History :   1.0  !  2004     (O. Aumont) Original code
7   !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
8   !!             3.4  !  2011-06  (O. Aumont, C. Ethe) Quota model for iron
9   !!----------------------------------------------------------------------
10#if defined key_pisces
11   !!----------------------------------------------------------------------
12   !!   'key_top'       and                                      TOP models
13   !!   'key_pisces'                                       PISCES bio-model
14   !!----------------------------------------------------------------------
15   !!   p4z_rem       :  Compute remineralization/dissolution of organic compounds
16   !!   p4z_rem_init  :  Initialisation of parameters for remineralisation
17   !!   p4z_rem_alloc :  Allocate remineralisation variables
18   !!----------------------------------------------------------------------
19   USE oce_trc         !  shared variables between ocean and passive tracers
20   USE trc             !  passive tracers common variables
21   USE sms_pisces      !  PISCES Source Minus Sink variables
22   USE p4zopt          !  optical model
23   USE p4zche          !  chemical model
24   USE p4zprod         !  Growth rate of the 2 phyto groups
25   USE p4zmeso         !  Sources and sinks of mesozooplankton
26   USE p4zint          !  interpolation and computation of various fields
27   USE p4zlim
28   USE prtctl_trc      !  print control for debugging
29   USE iom             !  I/O manager
30
31
32   IMPLICIT NONE
33   PRIVATE
34
35   PUBLIC   p4z_rem         ! called in p4zbio.F90
36   PUBLIC   p4z_rem_init    ! called in trcsms_pisces.F90
37   PUBLIC   p4z_rem_alloc
38
39   !! * Shared module variables
40   REAL(wp), PUBLIC ::  xremik     !: remineralisation rate of POC
41   REAL(wp), PUBLIC ::  xremip     !: remineralisation rate of DOC
42   REAL(wp), PUBLIC ::  nitrif     !: NH4 nitrification rate
43   REAL(wp), PUBLIC ::  xsirem     !: remineralisation rate of POC
44   REAL(wp), PUBLIC ::  xsiremlab  !: fast remineralisation rate of POC
45   REAL(wp), PUBLIC ::  xsilab     !: fraction of labile biogenic silica
46
47
48   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitr     !: denitrification array
49   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitnh4   !: -    -    -    -   -
50
51   !!----------------------------------------------------------------------
52   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
53   !! $Id: p4zrem.F90 3160 2011-11-20 14:27:18Z cetlod $
54   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
55   !!----------------------------------------------------------------------
56CONTAINS
57
58   SUBROUTINE p4z_rem( kt, knt )
59      !!---------------------------------------------------------------------
60      !!                     ***  ROUTINE p4z_rem  ***
61      !!
62      !! ** Purpose :   Compute remineralization/scavenging of organic compounds
63      !!
64      !! ** Method  : - ???
65      !!---------------------------------------------------------------------
66      !
67      INTEGER, INTENT(in) ::   kt, knt ! ocean time step
68      !
69      INTEGER  ::   ji, jj, jk
70      REAL(wp) ::   zremip, zremik, zsiremin 
71      REAL(wp) ::   zsatur, zsatur2, znusil, znusil2, zdep, zdepmin, zfactdep
72      REAL(wp) ::   zbactfer, zorem, zorem2, zofer, zolimit
73      REAL(wp) ::   zosil, ztem
74      REAL(wp) ::   zofer2
75      REAL(wp) ::   zonitr, zfact
76      CHARACTER (len=25) :: charout
77      REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac
78      REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod, zw3d
79      !!---------------------------------------------------------------------
80      !
81      IF( nn_timing == 1 )  CALL timing_start('p4z_rem')
82      !
83      ! Allocate temporary workspace
84      CALL wrk_alloc( jpi, jpj,      ztempbac                  )
85      CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
86
87      ! Initialisation of temprary arrys
88      zdepprod(:,:,:) = 1._wp
89      ztempbac(:,:)   = 0._wp
90
91      ! Computation of the mean phytoplankton concentration as
92      ! a crude estimate of the bacterial biomass
93      ! this parameterization has been deduced from a model version
94      ! that was modeling explicitely bacteria
95      ! -------------------------------------------------------
96      DO jk = 1, jpkm1
97         DO jj = 1, jpj
98            DO ji = 1, jpi
99               zdep = MAX( hmld(ji,jj), heup(ji,jj) )
100               IF( gdept_n(ji,jj,jk) < zdep ) THEN
101                  zdepbac(ji,jj,jk) = MIN( 0.7 * ( trb(ji,jj,jk,jpzoo) + 2.* trb(ji,jj,jk,jpmes) ), 4.e-6 )
102                  ztempbac(ji,jj)   = zdepbac(ji,jj,jk)
103               ELSE
104                  zdepmin = MIN( 1., zdep / gdept_n(ji,jj,jk) )
105                  zdepbac (ji,jj,jk) = zdepmin**0.683 * ztempbac(ji,jj)
106                  zdepprod(ji,jj,jk) = zdepmin**0.273
107               ENDIF
108            END DO
109         END DO
110      END DO
111
112      DO jk = 1, jpkm1
113         DO jj = 1, jpj
114            DO ji = 1, jpi
115               ! DOC ammonification. Depends on depth, phytoplankton biomass
116               ! and a limitation term which is supposed to be a parameterization
117               !     of the bacterial activity.
118               zremik = xremik * xstep / 1.e-6 * xlimbac(ji,jj,jk) * zdepbac(ji,jj,jk) 
119               zremik = MAX( zremik, 2.74e-4 * xstep )
120               ! Ammonification in oxic waters with oxygen consumption
121               ! -----------------------------------------------------
122               zolimit = zremik * ( 1.- nitrfac(ji,jj,jk) ) * trb(ji,jj,jk,jpdoc) 
123               zolimi(ji,jj,jk) = MIN( ( trb(ji,jj,jk,jpoxy) - rtrn ) / o2ut, zolimit ) 
124               ! Ammonification in suboxic waters with denitrification
125               ! -------------------------------------------------------
126               denitr(ji,jj,jk)  = MIN(  ( trb(ji,jj,jk,jpno3) - rtrn ) / rdenit,   &
127                  &                     zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)  )
128               !
129               zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) )
130               denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) )
131               !
132            END DO
133         END DO
134      END DO
135
136
137      DO jk = 1, jpkm1
138         DO jj = 1, jpj
139            DO ji = 1, jpi
140               ! NH4 nitrification to NO3. Ceased for oxygen concentrations
141               ! below 2 umol/L. Inhibited at strong light
142               ! ----------------------------------------------------------
143               zonitr  =nitrif * xstep * trb(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 
144               denitnh4(ji,jj,jk) = nitrif * xstep * trb(ji,jj,jk,jpnh4) * nitrfac(ji,jj,jk) 
145               ! Update of the tracers trends
146               ! ----------------------------
147               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr - denitnh4(ji,jj,jk)
148               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk)
149               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr
150               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk)
151            END DO
152         END DO
153      END DO
154
155       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
156         WRITE(charout, FMT="('rem1')")
157         CALL prt_ctl_trc_info(charout)
158         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
159       ENDIF
160
161      DO jk = 1, jpkm1
162         DO jj = 1, jpj
163            DO ji = 1, jpi
164
165               ! Bacterial uptake of iron. No iron is available in DOC. So
166               ! Bacteries are obliged to take up iron from the water. Some
167               ! studies (especially at Papa) have shown this uptake to be significant
168               ! ----------------------------------------------------------
169               zbactfer = 10.e-6 *  rfact2 * prmax(ji,jj,jk) * xlimbacl(ji,jj,jk)             &
170                  &              * trb(ji,jj,jk,jpfer) / ( 2.5E-10 + trb(ji,jj,jk,jpfer) )    &
171                  &              * zdepprod(ji,jj,jk) * zdepbac(ji,jj,jk)
172               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zbactfer*0.16
173               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zbactfer*0.12
174               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zbactfer*0.04
175            END DO
176         END DO
177      END DO
178
179       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
180         WRITE(charout, FMT="('rem2')")
181         CALL prt_ctl_trc_info(charout)
182         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
183       ENDIF
184
185      DO jk = 1, jpkm1
186         DO jj = 1, jpj
187            DO ji = 1, jpi
188               ! POC disaggregation by turbulence and bacterial activity.
189               ! --------------------------------------------------------
190               zremip = xremip * xstep * tgfunc(ji,jj,jk) * ( 1.- 0.55 * nitrfac(ji,jj,jk) ) 
191
192               ! POC disaggregation rate is reduced in anoxic zone as shown by
193               ! sediment traps data. In oxic area, the exponent of the martin s
194               ! law is around -0.87. In anoxic zone, it is around -0.35. This
195               ! means a disaggregation constant about 0.5 the value in oxic zones
196               ! -----------------------------------------------------------------
197               zorem  = zremip * trb(ji,jj,jk,jppoc)
198               zofer  = zremip * trb(ji,jj,jk,jpsfe)
199               zorem2 = zremip * trb(ji,jj,jk,jpgoc)
200               zofer2 = zremip * trb(ji,jj,jk,jpbfe)
201
202               ! Update the appropriate tracers trends
203               ! -------------------------------------
204
205               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zorem
206               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zofer
207               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zorem2 - zorem
208               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) - zorem2
209               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zofer2 - zofer
210               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) - zofer2
211
212            END DO
213         END DO
214      END DO
215
216       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
217         WRITE(charout, FMT="('rem3')")
218         CALL prt_ctl_trc_info(charout)
219         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
220       ENDIF
221
222      DO jk = 1, jpkm1
223         DO jj = 1, jpj
224            DO ji = 1, jpi
225               ! Remineralization rate of BSi depedant on T and saturation
226               ! ---------------------------------------------------------
227               zsatur   = ( sio3eq(ji,jj,jk) - trb(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn )
228               zsatur   = MAX( rtrn, zsatur )
229               zsatur2  = ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**37
230               znusil   = 0.225  * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2 * zsatur**9.25
231               znusil2  = 0.225  * ( 1. + tsn(ji,jj,1,jp_tem) / 15.) + 0.775 * zsatur2
232
233               ! Two classes of BSi are considered : a labile fraction and
234               ! a more refractory one. The ratio between both fractions is
235               ! constant and specified in the namelist.
236               ! ----------------------------------------------------------
237               zdep     = MAX( hmld(ji,jj), heup(ji,jj) ) 
238               zdep     = MAX( 0., gdept_n(ji,jj,jk) - zdep )
239               ztem     = MAX( tsn(ji,jj,1,jp_tem), 0. )
240               zfactdep = xsilab * EXP(-( xsiremlab - xsirem ) * znusil2 * zdep / wsbio2 ) * ztem / ( ztem + 10. )
241               zsiremin = ( xsiremlab * zfactdep + xsirem * ( 1. - zfactdep ) ) * xstep * znusil
242               zosil    = zsiremin * trb(ji,jj,jk,jpgsi)
243               !
244               tra(ji,jj,jk,jpgsi) = tra(ji,jj,jk,jpgsi) - zosil
245               tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) + zosil
246               !
247            END DO
248         END DO
249      END DO
250
251      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
252         WRITE(charout, FMT="('rem4')")
253         CALL prt_ctl_trc_info(charout)
254         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
255       ENDIF
256
257      ! Update the arrays TRA which contain the biological sources and sinks
258      ! --------------------------------------------------------------------
259
260      DO jk = 1, jpkm1
261         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk)
262         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk)
263         tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit
264         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk)
265         tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi (:,:,jk) * o2ut
266         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk)
267         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) )
268      END DO
269
270      IF( knt == nrdttrc ) THEN
271          CALL wrk_alloc( jpi, jpj, jpk, zw3d )
272          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
273          !
274          IF( iom_use( "REMIN" ) )  THEN
275              zw3d(:,:,:) = zolimi(:,:,:) * tmask(:,:,:) * zfact !  Remineralisation rate
276              CALL iom_put( "REMIN"  , zw3d )
277          ENDIF
278          IF( iom_use( "DENIT" ) )  THEN
279              zw3d(:,:,:) = denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zfact ! Denitrification
280              CALL iom_put( "DENIT"  , zw3d )
281          ENDIF
282          !
283          CALL wrk_dealloc( jpi, jpj, jpk, zw3d )
284       ENDIF
285
286      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
287         WRITE(charout, FMT="('rem6')")
288         CALL prt_ctl_trc_info(charout)
289         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
290      ENDIF
291      !
292      CALL wrk_dealloc( jpi, jpj,      ztempbac                  )
293      CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
294      !
295      IF( nn_timing == 1 )  CALL timing_stop('p4z_rem')
296      !
297   END SUBROUTINE p4z_rem
298
299
300   SUBROUTINE p4z_rem_init
301      !!----------------------------------------------------------------------
302      !!                  ***  ROUTINE p4z_rem_init  ***
303      !!
304      !! ** Purpose :   Initialization of remineralization parameters
305      !!
306      !! ** Method  :   Read the nampisrem namelist and check the parameters
307      !!      called at the first timestep
308      !!
309      !! ** input   :   Namelist nampisrem
310      !!
311      !!----------------------------------------------------------------------
312      NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xsiremlab, xsilab
313      INTEGER :: ios                 ! Local integer output status for namelist read
314
315      REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization
316      READ  ( numnatp_ref, nampisrem, IOSTAT = ios, ERR = 901)
317901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisrem in reference namelist', lwp )
318
319      REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization
320      READ  ( numnatp_cfg, nampisrem, IOSTAT = ios, ERR = 902 )
321902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisrem in configuration namelist', lwp )
322      IF(lwm) WRITE ( numonp, nampisrem )
323
324      IF(lwp) THEN                         ! control print
325         WRITE(numout,*) ' '
326         WRITE(numout,*) ' Namelist parameters for remineralization, nampisrem'
327         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
328         WRITE(numout,*) '    remineralisation rate of POC              xremip    =', xremip
329         WRITE(numout,*) '    remineralization rate of DOC              xremik    =', xremik
330         WRITE(numout,*) '    remineralization rate of Si               xsirem    =', xsirem
331         WRITE(numout,*) '    fast remineralization rate of Si          xsiremlab =', xsiremlab
332         WRITE(numout,*) '    fraction of labile biogenic silica        xsilab    =', xsilab
333         WRITE(numout,*) '    NH4 nitrification rate                    nitrif    =', nitrif
334      ENDIF
335      !
336      denitr  (:,:,:) = 0._wp
337      denitnh4(:,:,:) = 0._wp
338      !
339   END SUBROUTINE p4z_rem_init
340
341
342   INTEGER FUNCTION p4z_rem_alloc()
343      !!----------------------------------------------------------------------
344      !!                     ***  ROUTINE p4z_rem_alloc  ***
345      !!----------------------------------------------------------------------
346      ALLOCATE( denitr(jpi,jpj,jpk), denitnh4(jpi,jpj,jpk), STAT=p4z_rem_alloc )
347      !
348      IF( p4z_rem_alloc /= 0 )   CALL ctl_warn('p4z_rem_alloc: failed to allocate arrays')
349      !
350   END FUNCTION p4z_rem_alloc
351
352#else
353   !!======================================================================
354   !!  Dummy module :                                   No PISCES bio-model
355   !!======================================================================
356CONTAINS
357   SUBROUTINE p4z_rem                    ! Empty routine
358   END SUBROUTINE p4z_rem
359#endif 
360
361   !!======================================================================
362END MODULE p4zrem
Note: See TracBrowser for help on using the repository browser.