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 trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z – NEMO

source: trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90 @ 6945

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

trunk: bugfixes on PISCES carbon chemistry, see ticket #1774

File size: 17.9 KB
RevLine 
[3443]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
[4147]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
[3443]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
[5385]58   SUBROUTINE p4z_rem( kt, knt )
[3443]59      !!---------------------------------------------------------------------
60      !!                     ***  ROUTINE p4z_rem  ***
61      !!
62      !! ** Purpose :   Compute remineralization/scavenging of organic compounds
63      !!
64      !! ** Method  : - ???
65      !!---------------------------------------------------------------------
66      !
[5385]67      INTEGER, INTENT(in) ::   kt, knt ! ocean time step
[3443]68      !
69      INTEGER  ::   ji, jj, jk
70      REAL(wp) ::   zremip, zremik, zsiremin 
[3446]71      REAL(wp) ::   zsatur, zsatur2, znusil, znusil2, zdep, zdepmin, zfactdep
[3443]72      REAL(wp) ::   zbactfer, zorem, zorem2, zofer, zolimit
[3446]73      REAL(wp) ::   zosil, ztem
[3443]74#if ! defined key_kriest
75      REAL(wp) ::   zofer2
76#endif
[4996]77      REAL(wp) ::   zonitr, zstep, zfact
[3443]78      CHARACTER (len=25) :: charout
[4996]79      REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac
80      REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod, zw3d
[3443]81      !!---------------------------------------------------------------------
82      !
83      IF( nn_timing == 1 )  CALL timing_start('p4z_rem')
84      !
85      ! Allocate temporary workspace
[3446]86      CALL wrk_alloc( jpi, jpj,      ztempbac                  )
87      CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
[3443]88
89      ! Initialisation of temprary arrys
[3446]90      zdepprod(:,:,:) = 1._wp
[3443]91      ztempbac(:,:)   = 0._wp
92
93      ! Computation of the mean phytoplankton concentration as
94      ! a crude estimate of the bacterial biomass
95      ! this parameterization has been deduced from a model version
96      ! that was modeling explicitely bacteria
97      ! -------------------------------------------------------
98      DO jk = 1, jpkm1
99         DO jj = 1, jpj
100            DO ji = 1, jpi
101               zdep = MAX( hmld(ji,jj), heup(ji,jj) )
[6140]102               IF( gdept_n(ji,jj,jk) < zdep ) THEN
[5385]103                  zdepbac(ji,jj,jk) = MIN( 0.7 * ( trb(ji,jj,jk,jpzoo) + 2.* trb(ji,jj,jk,jpmes) ), 4.e-6 )
[3443]104                  ztempbac(ji,jj)   = zdepbac(ji,jj,jk)
105               ELSE
[6140]106                  zdepmin = MIN( 1., zdep / gdept_n(ji,jj,jk) )
[3446]107                  zdepbac (ji,jj,jk) = zdepmin**0.683 * ztempbac(ji,jj)
108                  zdepprod(ji,jj,jk) = zdepmin**0.273
[3443]109               ENDIF
110            END DO
111         END DO
112      END DO
113
114      DO jk = 1, jpkm1
115         DO jj = 1, jpj
116            DO ji = 1, jpi
117               zstep   = xstep
118# if defined key_degrad
119               zstep = zstep * facvol(ji,jj,jk)
120# endif
121               ! DOC ammonification. Depends on depth, phytoplankton biomass
122               ! and a limitation term which is supposed to be a parameterization
123               !     of the bacterial activity.
124               zremik = xremik * zstep / 1.e-6 * xlimbac(ji,jj,jk) * zdepbac(ji,jj,jk) 
125               zremik = MAX( zremik, 2.74e-4 * xstep )
126               ! Ammonification in oxic waters with oxygen consumption
127               ! -----------------------------------------------------
[5385]128               zolimit = zremik * ( 1.- nitrfac(ji,jj,jk) ) * trb(ji,jj,jk,jpdoc) 
129               zolimi(ji,jj,jk) = MIN( ( trb(ji,jj,jk,jpoxy) - rtrn ) / o2ut, zolimit ) 
[3443]130               ! Ammonification in suboxic waters with denitrification
131               ! -------------------------------------------------------
[5385]132               denitr(ji,jj,jk)  = MIN(  ( trb(ji,jj,jk,jpno3) - rtrn ) / rdenit,   &
133                  &                     zremik * nitrfac(ji,jj,jk) * trb(ji,jj,jk,jpdoc)  )
[3443]134               !
135               zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) )
136               denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) )
137               !
138            END DO
139         END DO
140      END DO
141
142
143      DO jk = 1, jpkm1
144         DO jj = 1, jpj
145            DO ji = 1, jpi
146               zstep   = xstep
147# if defined key_degrad
148               zstep = zstep * facvol(ji,jj,jk)
149# endif
150               ! NH4 nitrification to NO3. Ceased for oxygen concentrations
151               ! below 2 umol/L. Inhibited at strong light
152               ! ----------------------------------------------------------
[5385]153               zonitr  =nitrif * zstep * trb(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 
154               denitnh4(ji,jj,jk) = nitrif * zstep * trb(ji,jj,jk,jpnh4) * nitrfac(ji,jj,jk) 
[3443]155               ! Update of the tracers trends
156               ! ----------------------------
157               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr - denitnh4(ji,jj,jk)
158               tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk)
159               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr
160               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk)
161            END DO
162         END DO
163      END DO
164
165       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
166         WRITE(charout, FMT="('rem1')")
167         CALL prt_ctl_trc_info(charout)
168         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
169       ENDIF
170
171      DO jk = 1, jpkm1
172         DO jj = 1, jpj
173            DO ji = 1, jpi
174
175               ! Bacterial uptake of iron. No iron is available in DOC. So
176               ! Bacteries are obliged to take up iron from the water. Some
177               ! studies (especially at Papa) have shown this uptake to be significant
178               ! ----------------------------------------------------------
[3446]179               zbactfer = 10.e-6 *  rfact2 * prmax(ji,jj,jk) * xlimbacl(ji,jj,jk)             &
[5385]180                  &              * trb(ji,jj,jk,jpfer) / ( 2.5E-10 + trb(ji,jj,jk,jpfer) )    &
[3446]181                  &              * zdepprod(ji,jj,jk) * zdepbac(ji,jj,jk)
[3443]182#if defined key_kriest
183               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zbactfer*0.05
184               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zbactfer*0.05
185#else
186               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zbactfer*0.16
187               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zbactfer*0.12
188               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zbactfer*0.04
189#endif
190            END DO
191         END DO
192      END DO
193
194       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
195         WRITE(charout, FMT="('rem2')")
196         CALL prt_ctl_trc_info(charout)
197         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
198       ENDIF
199
200      DO jk = 1, jpkm1
201         DO jj = 1, jpj
202            DO ji = 1, jpi
203               zstep   = xstep
204# if defined key_degrad
205               zstep = zstep * facvol(ji,jj,jk)
206# endif
207               ! POC disaggregation by turbulence and bacterial activity.
208               ! --------------------------------------------------------
[3475]209               zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0.55 * nitrfac(ji,jj,jk) ) 
[3443]210
211               ! POC disaggregation rate is reduced in anoxic zone as shown by
212               ! sediment traps data. In oxic area, the exponent of the martin s
213               ! law is around -0.87. In anoxic zone, it is around -0.35. This
214               ! means a disaggregation constant about 0.5 the value in oxic zones
215               ! -----------------------------------------------------------------
[5385]216               zorem  = zremip * trb(ji,jj,jk,jppoc)
217               zofer  = zremip * trb(ji,jj,jk,jpsfe)
[3443]218#if ! defined key_kriest
[5385]219               zorem2 = zremip * trb(ji,jj,jk,jpgoc)
220               zofer2 = zremip * trb(ji,jj,jk,jpbfe)
[3443]221#else
[5385]222               zorem2 = zremip * trb(ji,jj,jk,jpnum)
[3443]223#endif
224
225               ! Update the appropriate tracers trends
226               ! -------------------------------------
227
228               tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zorem
229               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zofer
230#if defined key_kriest
231               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zorem
232               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zorem2
233               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zofer
234#else
235               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zorem2 - zorem
236               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) - zorem2
237               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zofer2 - zofer
238               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) - zofer2
239#endif
240
241            END DO
242         END DO
243      END DO
244
245       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
246         WRITE(charout, FMT="('rem3')")
247         CALL prt_ctl_trc_info(charout)
248         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
249       ENDIF
250
251      DO jk = 1, jpkm1
252         DO jj = 1, jpj
253            DO ji = 1, jpi
254               zstep   = xstep
255# if defined key_degrad
256               zstep = zstep * facvol(ji,jj,jk)
257# endif
258               ! Remineralization rate of BSi depedant on T and saturation
259               ! ---------------------------------------------------------
[5385]260               zsatur   = ( sio3eq(ji,jj,jk) - trb(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn )
[3443]261               zsatur   = MAX( rtrn, zsatur )
[3446]262               zsatur2  = ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**37
263               znusil   = 0.225  * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2 * zsatur**9.25
264               znusil2  = 0.225  * ( 1. + tsn(ji,jj,1,jp_tem) / 15.) + 0.775 * zsatur2
265
[3443]266               ! Two classes of BSi are considered : a labile fraction and
267               ! a more refractory one. The ratio between both fractions is
268               ! constant and specified in the namelist.
269               ! ----------------------------------------------------------
270               zdep     = MAX( hmld(ji,jj), heup(ji,jj) ) 
[6140]271               zdep     = MAX( 0., gdept_n(ji,jj,jk) - zdep )
[3446]272               ztem     = MAX( tsn(ji,jj,1,jp_tem), 0. )
273               zfactdep = xsilab * EXP(-( xsiremlab - xsirem ) * znusil2 * zdep / wsbio2 ) * ztem / ( ztem + 10. )
[3443]274               zsiremin = ( xsiremlab * zfactdep + xsirem * ( 1. - zfactdep ) ) * zstep * znusil
[5385]275               zosil    = zsiremin * trb(ji,jj,jk,jpgsi)
[3443]276               !
277               tra(ji,jj,jk,jpgsi) = tra(ji,jj,jk,jpgsi) - zosil
278               tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) + zosil
279               !
280            END DO
281         END DO
282      END DO
283
284      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
285         WRITE(charout, FMT="('rem4')")
286         CALL prt_ctl_trc_info(charout)
287         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
288       ENDIF
289
290      ! Update the arrays TRA which contain the biological sources and sinks
291      ! --------------------------------------------------------------------
292
293      DO jk = 1, jpkm1
294         tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk)
295         tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk)
296         tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit
297         tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk)
298         tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi (:,:,jk) * o2ut
299         tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk)
300         tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) )
301      END DO
302
[5385]303      IF( knt == nrdttrc ) THEN
[4996]304          CALL wrk_alloc( jpi, jpj, jpk, zw3d )
305          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s
306          !
307          IF( iom_use( "REMIN" ) )  THEN
308              zw3d(:,:,:) = zolimi(:,:,:) * tmask(:,:,:) * zfact !  Remineralisation rate
309              CALL iom_put( "REMIN"  , zw3d )
310          ENDIF
311          IF( iom_use( "DENIT" ) )  THEN
312              zw3d(:,:,:) = denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zfact ! Denitrification
313              CALL iom_put( "DENIT"  , zw3d )
314          ENDIF
315          !
316          CALL wrk_dealloc( jpi, jpj, jpk, zw3d )
317       ENDIF
[3443]318
319      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
320         WRITE(charout, FMT="('rem6')")
321         CALL prt_ctl_trc_info(charout)
322         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
323      ENDIF
324      !
[3446]325      CALL wrk_dealloc( jpi, jpj,      ztempbac                  )
326      CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zdepprod, zolimi )
[3443]327      !
328      IF( nn_timing == 1 )  CALL timing_stop('p4z_rem')
329      !
330   END SUBROUTINE p4z_rem
331
332
333   SUBROUTINE p4z_rem_init
334      !!----------------------------------------------------------------------
335      !!                  ***  ROUTINE p4z_rem_init  ***
336      !!
337      !! ** Purpose :   Initialization of remineralization parameters
338      !!
339      !! ** Method  :   Read the nampisrem namelist and check the parameters
340      !!      called at the first timestep
341      !!
342      !! ** input   :   Namelist nampisrem
343      !!
344      !!----------------------------------------------------------------------
[6945]345      NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xsiremlab, xsilab
[4147]346      INTEGER :: ios                 ! Local integer output status for namelist read
[3443]347
[4147]348      REWIND( numnatp_ref )              ! Namelist nampisrem in reference namelist : Pisces remineralization
349      READ  ( numnatp_ref, nampisrem, IOSTAT = ios, ERR = 901)
350901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisrem in reference namelist', lwp )
[3443]351
[4147]352      REWIND( numnatp_cfg )              ! Namelist nampisrem in configuration namelist : Pisces remineralization
353      READ  ( numnatp_cfg, nampisrem, IOSTAT = ios, ERR = 902 )
354902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisrem in configuration namelist', lwp )
[4624]355      IF(lwm) WRITE ( numonp, nampisrem )
[4147]356
[3443]357      IF(lwp) THEN                         ! control print
358         WRITE(numout,*) ' '
359         WRITE(numout,*) ' Namelist parameters for remineralization, nampisrem'
360         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
361         WRITE(numout,*) '    remineralisation rate of POC              xremip    =', xremip
362         WRITE(numout,*) '    remineralization rate of DOC              xremik    =', xremik
363         WRITE(numout,*) '    remineralization rate of Si               xsirem    =', xsirem
364         WRITE(numout,*) '    fast remineralization rate of Si          xsiremlab =', xsiremlab
365         WRITE(numout,*) '    fraction of labile biogenic silica        xsilab    =', xsilab
366         WRITE(numout,*) '    NH4 nitrification rate                    nitrif    =', nitrif
367      ENDIF
368      !
369      denitr  (:,:,:) = 0._wp
370      denitnh4(:,:,:) = 0._wp
371      !
372   END SUBROUTINE p4z_rem_init
373
374
375   INTEGER FUNCTION p4z_rem_alloc()
376      !!----------------------------------------------------------------------
377      !!                     ***  ROUTINE p4z_rem_alloc  ***
378      !!----------------------------------------------------------------------
379      ALLOCATE( denitr(jpi,jpj,jpk), denitnh4(jpi,jpj,jpk), STAT=p4z_rem_alloc )
380      !
381      IF( p4z_rem_alloc /= 0 )   CALL ctl_warn('p4z_rem_alloc: failed to allocate arrays')
382      !
383   END FUNCTION p4z_rem_alloc
384
385#else
386   !!======================================================================
387   !!  Dummy module :                                   No PISCES bio-model
388   !!======================================================================
389CONTAINS
390   SUBROUTINE p4z_rem                    ! Empty routine
391   END SUBROUTINE p4z_rem
392#endif 
393
394   !!======================================================================
395END MODULE p4zrem
Note: See TracBrowser for help on using the repository browser.