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.
p4zsed.F90 in branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z – NEMO

source: branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90 @ 9241

Last change on this file since 9241 was 9241, checked in by cetlod, 6 years ago

v3.6 stable : bugfix on PISCES, see ticket #2003

  • Property svn:keywords set to Id
File size: 20.3 KB
Line 
1MODULE p4zsed
2   !!======================================================================
3   !!                         ***  MODULE p4sed  ***
4   !! TOP :   PISCES Compute loss of organic matter in the sediments
5   !!======================================================================
6   !! History :   1.0  !  2004-03 (O. Aumont) Original code
7   !!             2.0  !  2007-12 (C. Ethe, G. Madec)  F90
8   !!             3.4  !  2011-06 (C. Ethe) USE of fldread
9   !!             3.5  !  2012-07 (O. Aumont) improvment of river input of nutrients
10   !!----------------------------------------------------------------------
11#if defined key_pisces
12   !!----------------------------------------------------------------------
13   !!   'key_pisces'                                       PISCES bio-model
14   !!----------------------------------------------------------------------
15   !!   p4z_sed        :  Compute loss of organic matter in the sediments
16   !!----------------------------------------------------------------------
17   USE oce_trc         !  shared variables between ocean and passive tracers
18   USE trc             !  passive tracers common variables
19   USE sms_pisces      !  PISCES Source Minus Sink variables
20   USE p4zsink         !  vertical flux of particulate matter due to sinking
21   USE p4zopt          !  optical model
22   USE p4zlim          !  Co-limitations of differents nutrients
23   USE p4zsbc          !  External source of nutrients
24   USE p4zint          !  interpolation and computation of various fields
25   USE iom             !  I/O manager
26   USE prtctl_trc      !  print control for debugging
27
28   IMPLICIT NONE
29   PRIVATE
30
31   PUBLIC   p4z_sed 
32   PUBLIC   p4z_sed_alloc
33 
34
35   !! * Module variables
36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nitrpot    !: Nitrogen fixation
37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:  ) :: sdenit     !: Nitrate reduction in the sediments
38   REAL(wp) :: r1_rday                  !: inverse of rday
39
40   !!* Substitution
41#  include "top_substitute.h90"
42   !!----------------------------------------------------------------------
43   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
44   !! $Id$
45   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
46   !!----------------------------------------------------------------------
47CONTAINS
48
49   SUBROUTINE p4z_sed( kt, knt )
50      !!---------------------------------------------------------------------
51      !!                     ***  ROUTINE p4z_sed  ***
52      !!
53      !! ** Purpose :   Compute loss of organic matter in the sediments. This
54      !!              is by no way a sediment model. The loss is simply
55      !!              computed to balance the inout from rivers and dust
56      !!
57      !! ** Method  : - ???
58      !!---------------------------------------------------------------------
59      !
60      INTEGER, INTENT(in) ::   kt, knt ! ocean time step
61      INTEGER  ::   ji, jj, jk, ikt
62#if ! defined key_sed
63      REAL(wp) ::   zrivalk, zrivsil, zrivno3
64#endif
65      REAL(wp) ::  zwflux, zfminus, zfplus
66      REAL(wp) ::  zlim, zfact, zfactcal
67      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zolimit
68      REAL(wp) ::  zsiloss, zcaloss, zws3, zws4, zwsc, zdep, zwstpoc
69      REAL(wp) ::  ztrfer, ztrpo4, zwdust, zlight
70      !
71      CHARACTER (len=25) :: charout
72      REAL(wp), POINTER, DIMENSION(:,:  ) :: zpdep, zsidep, zwork
73      REAL(wp), POINTER, DIMENSION(:,:)   :: zsedcal, zsedsi, zsedc
74      REAL(wp), POINTER, DIMENSION(:,:  ) :: zdenit2d, zironice, zbureff
75      REAL(wp), POINTER, DIMENSION(:,:  ) :: zwsbio3, zwsbio4, zwscal
76      REAL(wp), POINTER, DIMENSION(:,:,:) :: zirondep, zsoufer
77      !!---------------------------------------------------------------------
78      !
79      IF( nn_timing == 1 )  CALL timing_start('p4z_sed')
80      !
81      IF( kt == nittrc000 .AND. knt == 1 )   r1_rday  = 1. / rday
82      !
83      ! Allocate temporary workspace
84      CALL wrk_alloc( jpi, jpj, zdenit2d, zbureff )
85      CALL wrk_alloc( jpi, jpj, zsedcal,  zsedsi, zsedc )
86      CALL wrk_alloc( jpi, jpj, zwsbio3, zwsbio4, zwscal )
87      CALL wrk_alloc( jpi, jpj, jpk, zsoufer )
88
89      zdenit2d(:,:) = 0.e0
90      zbureff (:,:) = 0.e0
91      zsedsi   (:,:) = 0.e0
92      zsedcal  (:,:) = 0.e0
93      zsedc    (:,:) = 0.e0
94
95      ! Iron input/uptake due to sea ice : Crude parameterization based on Lancelot et al.
96      ! ----------------------------------------------------
97      IF( ln_ironice ) THEN 
98         !                                             
99         CALL wrk_alloc( jpi, jpj, zironice )
100         !                                             
101         DO jj = 1, jpj
102            DO ji = 1, jpi
103               zdep    = rfact2 / fse3t(ji,jj,1)
104               zwflux  = fmmflx(ji,jj) / 1000._wp
105               zfminus = MIN( 0._wp, -zwflux ) * trb(ji,jj,1,jpfer) * zdep
106               zfplus  = MAX( 0._wp, -zwflux ) * icefeinput * zdep
107               zironice(ji,jj) =  zfplus + zfminus
108            END DO
109         END DO
110         !
111         tra(:,:,1,jpfer) = tra(:,:,1,jpfer) + zironice(:,:) 
112         !
113         IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "Ironice" ) )   &
114            &   CALL iom_put( "Ironice", zironice(:,:) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) ) ! iron flux from ice
115         !
116         CALL wrk_dealloc( jpi, jpj, zironice )
117         !                                             
118      ENDIF
119
120      ! Add the external input of nutrients from dust deposition
121      ! ----------------------------------------------------------
122      IF( ln_dust ) THEN
123         !                                             
124         CALL wrk_alloc( jpi, jpj,      zpdep, zsidep )
125         CALL wrk_alloc( jpi, jpj, jpk, zirondep      )
126         !                                              ! Iron and Si deposition at the surface
127         IF( ln_solub ) THEN
128            zirondep(:,:,1) = solub(:,:) * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / 55.85 + 3.e-10 * r1_ryyss 
129         ELSE
130            zirondep(:,:,1) = dustsolub  * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / 55.85 + 3.e-10 * r1_ryyss 
131         ENDIF
132         zsidep(:,:) = 8.8 * 0.075 * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / 28.1 
133         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * mfrac * rfact2 / fse3t(:,:,1) / 31. / po4r 
134         !                                              ! Iron solubilization of particles in the water column
135         !                                              ! dust in kg/m2/s ---> 1/55.85 to put in mol/Fe ;  wdust in m/j
136         zwdust = 0.03 * rday / ( wdust * 55.85 ) / ( 270. * rday )
137         DO jk = 2, jpkm1
138            zirondep(:,:,jk) = dust(:,:) * mfrac * zwdust * rfact2 * EXP( -fsdept(:,:,jk) / 540. )
139         END DO
140         !                                              ! Iron solubilization of particles in the water column
141         tra(:,:,1,jppo4) = tra(:,:,1,jppo4) + zpdep   (:,:)
142         tra(:,:,1,jpsil) = tra(:,:,1,jpsil) + zsidep  (:,:)
143         tra(:,:,:,jpfer) = tra(:,:,:,jpfer) + zirondep(:,:,:) 
144         !
145         IF( lk_iomput ) THEN
146            IF( knt == nrdttrc ) THEN
147                IF( iom_use( "Irondep" ) )   &
148                &  CALL iom_put( "Irondep", zirondep(:,:,1) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron
149                IF( iom_use( "pdust" ) )   &
150                &  CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface
151            ENDIF
152         ELSE                                   
153            IF( ln_diatrc )  &
154              &  trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1)
155         ENDIF
156         CALL wrk_dealloc( jpi, jpj,      zpdep, zsidep )
157         CALL wrk_dealloc( jpi, jpj, jpk, zirondep      )
158         !                                             
159      ENDIF
160     
161      ! Add the external input of nutrients from river
162      ! ----------------------------------------------------------
163      IF( ln_river ) THEN
164         DO jj = 1, jpj
165            DO ji = 1, jpi
166               DO jk = 1, nk_rnf(ji,jj)
167                  tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) +  rivdip(ji,jj) * rfact2
168                  tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) +  rivdin(ji,jj) * rfact2
169                  tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) +  rivdic(ji,jj) * 5.e-5 * rfact2
170                  tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) +  rivdsi(ji,jj) * rfact2
171                  tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) +  rivdic(ji,jj) * rfact2
172                  tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) +  ( rivalk(ji,jj) - rno3 * rivdin(ji,jj) ) * rfact2
173               ENDDO
174            ENDDO
175         ENDDO
176      ENDIF
177     
178      ! Add the external input of nutrients from nitrogen deposition
179      ! ----------------------------------------------------------
180      IF( ln_ndepo ) THEN
181         tra(:,:,1,jpno3) = tra(:,:,1,jpno3) + nitdep(:,:) * rfact2
182         tra(:,:,1,jptal) = tra(:,:,1,jptal) - rno3 * nitdep(:,:) * rfact2
183      ENDIF
184
185      ! Add the external input of iron from sediment mobilization
186      ! ------------------------------------------------------
187      IF( ln_ironsed ) THEN
188         tra(:,:,:,jpfer) = tra(:,:,:,jpfer) + ironsed(:,:,:) * rfact2
189         !
190         IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "Ironsed" ) )   &
191            &   CALL iom_put( "Ironsed", ironsed(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! iron inputs from sediments
192      ENDIF
193
194      ! Add the external input of iron from hydrothermal vents
195      ! ------------------------------------------------------
196      IF( ln_hydrofe ) THEN
197         tra(:,:,:,jpfer) = tra(:,:,:,jpfer) + hydrofe(:,:,:) * rfact2
198         !
199         IF( lk_iomput .AND. knt == nrdttrc .AND. iom_use( "HYDR" ) )   &
200            &   CALL iom_put( "HYDR", hydrofe(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! hydrothermal iron input
201      ENDIF
202
203      ! OA: Warning, the following part is necessary, especially with Kriest
204      ! to avoid CFL problems above the sediments
205      ! --------------------------------------------------------------------
206      DO jj = 1, jpj
207         DO ji = 1, jpi
208            ikt  = mbkt(ji,jj)
209            zdep = fse3t(ji,jj,ikt) / xstep
210            zwsbio4(ji,jj) = MIN( 0.99 * zdep, wsbio4(ji,jj,ikt) )
211            zwscal (ji,jj) = MIN( 0.99 * zdep, wscal (ji,jj,ikt) )
212            zwsbio3(ji,jj) = MIN( 0.99 * zdep, wsbio3(ji,jj,ikt) )
213         END DO
214      END DO
215
216#if ! defined key_sed
217      ! Computation of the sediment denitrification proportion: The metamodel from midlleburg (2006) is being used
218      ! Computation of the fraction of organic matter that is permanently buried from Dunne's model
219      ! -------------------------------------------------------
220      DO jj = 1, jpj
221         DO ji = 1, jpi
222           IF( tmask(ji,jj,1) == 1 ) THEN
223              ikt = mbkt(ji,jj)
224# if defined key_kriest
225              zflx =    trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj)    * 1E3 * 1E6 / 1E4
226# else
227              zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
228                &     + trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) )  * 1E3 * 1E6 / 1E4
229#endif
230              zflx  = LOG10( MAX( 1E-3, zflx ) )
231              zo2   = LOG10( MAX( 10. , trb(ji,jj,ikt,jpoxy) * 1E6 ) )
232              zno3  = LOG10( MAX( 1.  , trb(ji,jj,ikt,jpno3) * 1E6 * rno3 ) )
233              zdep  = LOG10( fsdepw(ji,jj,ikt+1) )
234              zdenit2d(ji,jj) = -2.2567 - 1.185 * zflx - 0.221 * zflx**2 - 0.3995 * zno3 * zo2 + 1.25 * zno3    &
235              &                + 0.4721 * zo2 - 0.0996 * zdep + 0.4256 * zflx * zo2
236              zdenit2d(ji,jj) = 10.0**( zdenit2d(ji,jj) )
237              !
238              zflx = (  trb(ji,jj,ikt,jpgoc) * zwsbio4(ji,jj)   &
239                &     + trb(ji,jj,ikt,jppoc) * zwsbio3(ji,jj) ) * 1E6
240              zbureff(ji,jj) = 0.013 + 0.53 * zflx**2 / ( 7.0 + zflx )**2
241           ENDIF
242         END DO
243      END DO 
244
245#endif
246
247      ! This loss is scaled at each bottom grid cell for equilibrating the total budget of silica in the ocean.
248      ! Thus, the amount of silica lost in the sediments equal the supply at the surface (dust+rivers)
249      ! ------------------------------------------------------
250#if ! defined key_sed
251      zrivsil =  1._wp - sedsilfrac
252#endif
253
254      DO jj = 1, jpj
255         DO ji = 1, jpi
256            ikt  = mbkt(ji,jj)
257            zdep = xstep / fse3t(ji,jj,ikt) 
258            zws4 = zwsbio4(ji,jj) * zdep
259            zwsc = zwscal (ji,jj) * zdep
260# if defined key_kriest
261            zsiloss = trb(ji,jj,ikt,jpgsi) * zws4
262# else
263            zsiloss = trb(ji,jj,ikt,jpgsi) * zwsc
264# endif
265            zcaloss = trb(ji,jj,ikt,jpcal) * zwsc
266            !
267            tra(ji,jj,ikt,jpgsi) = tra(ji,jj,ikt,jpgsi) - zsiloss
268            tra(ji,jj,ikt,jpcal) = tra(ji,jj,ikt,jpcal) - zcaloss
269#if ! defined key_sed
270            tra(ji,jj,ikt,jpsil) = tra(ji,jj,ikt,jpsil) + zsiloss * zrivsil 
271            ! Loss of biogenic silicon, Caco3 organic carbon in the sediments.
272            ! The factor for calcite comes from the alkalinity effect
273            ! -------------------------------------------------------------
274            zfactcal = MIN( excess(ji,jj,ikt), 0.2 )
275            zfactcal = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) )
276            zrivalk  =  sedcalfrac * zfactcal
277            tra(ji,jj,ikt,jptal) =  tra(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0
278            tra(ji,jj,ikt,jpdic) =  tra(ji,jj,ikt,jpdic) + zcaloss * zrivalk
279            zsedcal(ji,jj) = (1.0 - zrivalk) * zcaloss * fse3t(ji,jj,ikt) 
280            zsedsi (ji,jj) = (1.0 - zrivsil) * zsiloss * fse3t(ji,jj,ikt) 
281#endif
282         END DO
283      END DO
284
285      DO jj = 1, jpj
286         DO ji = 1, jpi
287            ikt  = mbkt(ji,jj)
288            zdep = xstep / fse3t(ji,jj,ikt) 
289            zws4 = zwsbio4(ji,jj) * zdep
290            zws3 = zwsbio3(ji,jj) * zdep
291            zrivno3 = 1. - zbureff(ji,jj)
292# if ! defined key_kriest
293            tra(ji,jj,ikt,jpgoc) = tra(ji,jj,ikt,jpgoc) - trb(ji,jj,ikt,jpgoc) * zws4 
294            tra(ji,jj,ikt,jppoc) = tra(ji,jj,ikt,jppoc) - trb(ji,jj,ikt,jppoc) * zws3
295            tra(ji,jj,ikt,jpbfe) = tra(ji,jj,ikt,jpbfe) - trb(ji,jj,ikt,jpbfe) * zws4
296            tra(ji,jj,ikt,jpsfe) = tra(ji,jj,ikt,jpsfe) - trb(ji,jj,ikt,jpsfe) * zws3
297            zwstpoc              = trb(ji,jj,ikt,jpgoc) * zws4 + trb(ji,jj,ikt,jppoc) * zws3
298# else
299            tra(ji,jj,ikt,jpnum) = tra(ji,jj,ikt,jpnum) - trb(ji,jj,ikt,jpnum) * zws4 
300            tra(ji,jj,ikt,jppoc) = tra(ji,jj,ikt,jppoc) - trb(ji,jj,ikt,jppoc) * zws3
301            tra(ji,jj,ikt,jpsfe) = tra(ji,jj,ikt,jpsfe) - trb(ji,jj,ikt,jpsfe) * zws3
302            zwstpoc = trb(ji,jj,ikt,jppoc) * zws3 
303# endif
304
305#if ! defined key_sed
306            ! The 0.5 factor in zpdenit is to avoid negative NO3 concentration after
307            ! denitrification in the sediments. Not very clever, but simpliest option.
308            zpdenit  = MIN( 0.5 * ( trb(ji,jj,ikt,jpno3) - rtrn ) / rdenit, &
309                            zdenit2d(ji,jj) * zwstpoc * zrivno3 * (1. - nitrfac2(ji,jj,ikt) ) )
310            z1pdenit = zwstpoc * zrivno3 - zpdenit
311            zolimit = MIN( ( trb(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) )
312            tra(ji,jj,ikt,jpdoc) = tra(ji,jj,ikt,jpdoc) + z1pdenit - zolimit
313            tra(ji,jj,ikt,jppo4) = tra(ji,jj,ikt,jppo4) + zpdenit + zolimit
314            tra(ji,jj,ikt,jpnh4) = tra(ji,jj,ikt,jpnh4) + zpdenit + zolimit
315            tra(ji,jj,ikt,jpno3) = tra(ji,jj,ikt,jpno3) - rdenit * zpdenit
316            tra(ji,jj,ikt,jpoxy) = tra(ji,jj,ikt,jpoxy) - zolimit * o2ut
317            tra(ji,jj,ikt,jptal) = tra(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * zpdenit )
318            tra(ji,jj,ikt,jpdic) = tra(ji,jj,ikt,jpdic) + zpdenit + zolimit
319            sdenit(ji,jj) = rdenit * zpdenit * fse3t(ji,jj,ikt) 
320            zsedc(ji,jj)   = (1. - zrivno3) * zwstpoc * fse3t(ji,jj,ikt) 
321#endif
322         END DO
323      END DO
324
325      ! Nitrogen fixation process
326      ! Small source iron from particulate inorganic iron
327      !-----------------------------------
328      DO jk = 1, jpkm1
329         DO jj = 1, jpj
330            DO ji = 1, jpi
331               !                      ! Potential nitrogen fixation dependant on temperature and iron
332               zlim = ( 1.- xnanono3(ji,jj,jk) - xnanonh4(ji,jj,jk) )
333               IF( zlim <= 0.2 )   zlim = 0.01
334#if defined key_degrad
335               zfact = zlim * rfact2 * facvol(ji,jj,jk)
336#else
337               zfact = zlim * rfact2
338#endif
339               ztrfer = biron(ji,jj,jk)       / ( concfediaz + biron(ji,jj,jk)       )
340               ztrpo4 = trb  (ji,jj,jk,jppo4) / ( concnnh4   + trb  (ji,jj,jk,jppo4) ) 
341               zlight =  ( 1.- EXP( -etot_ndcy(ji,jj,jk) / diazolight ) ) 
342               nitrpot(ji,jj,jk) =  MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * r1_rday )   &
343                 &         *  zfact * MIN( ztrfer, ztrpo4 ) * zlight
344               zsoufer(ji,jj,jk) = zlight * 2E-11 / (2E-11 + biron(ji,jj,jk))
345            END DO
346         END DO
347      END DO
348
349      ! Nitrogen change due to nitrogen fixation
350      ! ----------------------------------------
351      DO jk = 1, jpkm1
352         DO jj = 1, jpj
353            DO ji = 1, jpi
354               zfact = nitrpot(ji,jj,jk) * nitrfix
355               tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) +             zfact
356               tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3      * zfact
357               tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) + o2nit     * zfact 
358               tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + concdnh4 / ( concdnh4 + trb(ji,jj,jk,jppo4) ) &
359               &                     * 0.002 * trb(ji,jj,jk,jpdoc) * xstep
360               tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + 0.002 * 4E-10 * zsoufer(ji,jj,jk) * xstep
361           END DO
362         END DO
363      END DO
364
365      IF( lk_iomput ) THEN
366         IF( knt == nrdttrc ) THEN
367            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s
368            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix", nitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation
369            IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated )
370               CALL wrk_alloc( jpi, jpj, zwork )
371               zwork(:,:) = 0.
372               DO jk = 1, jpkm1
373                 zwork(:,:) = zwork(:,:) + nitrpot(:,:,jk) * nitrfix * rno3 * zfact * fse3t(:,:,jk) * tmask(:,:,jk)
374               ENDDO
375               CALL iom_put( "INTNFIX", zwork ) 
376               CALL wrk_dealloc( jpi, jpj, zwork )
377            ENDIF
378            IF( iom_use("SedCal" ) ) CALL iom_put( "SedCal", zsedcal(:,:) * zfact )
379            IF( iom_use("SedSi" ) )  CALL iom_put( "SedSi",  zsedsi (:,:) * zfact )
380            IF( iom_use("SedC" ) )   CALL iom_put( "SedC",   zsedc  (:,:) * zfact )
381            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", sdenit (:,:) * rno3 * zfact )
382         ENDIF
383      ELSE
384         IF( ln_diatrc ) THEN
385            zfact = 1.e+3 * rfact2r  !  conversion from molC/l/kt  to molC/m3/s
386            trc2d(:,:,jp_pcs0_2d + 12) = nitrpot(:,:,1) * nitrfix * rno3 * zfact * fse3t(:,:,1) * tmask(:,:,1)
387         ENDIF
388      ENDIF
389      !
390      IF(ln_ctl) THEN  ! print mean trends (USEd for debugging)
391         WRITE(charout, fmt="('sed ')")
392         CALL prt_ctl_trc_info(charout)
393         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
394      ENDIF
395      !
396      CALL wrk_dealloc( jpi, jpj, zdenit2d, zbureff )
397      CALL wrk_dealloc( jpi, jpj, zsedcal , zsedsi, zsedc )
398      CALL wrk_dealloc( jpi, jpj, zwsbio3, zwsbio4, zwscal )
399      CALL wrk_dealloc( jpi, jpj, jpk, zsoufer )
400      !
401      IF( nn_timing == 1 )  CALL timing_stop('p4z_sed')
402      !
403 9100  FORMAT(i8,3f10.5)
404      !
405   END SUBROUTINE p4z_sed
406
407
408   INTEGER FUNCTION p4z_sed_alloc()
409      !!----------------------------------------------------------------------
410      !!                     ***  ROUTINE p4z_sed_alloc  ***
411      !!----------------------------------------------------------------------
412      ALLOCATE( nitrpot(jpi,jpj,jpk), sdenit(jpi,jpj), STAT=p4z_sed_alloc )
413      !
414      IF( p4z_sed_alloc /= 0 )   CALL ctl_warn('p4z_sed_alloc: failed to allocate arrays')
415      !
416   END FUNCTION p4z_sed_alloc
417
418
419#else
420   !!======================================================================
421   !!  Dummy module :                                   No PISCES bio-model
422   !!======================================================================
423CONTAINS
424   SUBROUTINE p4z_sed                         ! Empty routine
425   END SUBROUTINE p4z_sed
426#endif 
427
428   !!======================================================================
429END MODULE p4zsed
Note: See TracBrowser for help on using the repository browser.