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.
p2zbio.F90 in NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/PISCES/P2Z – NEMO

source: NEMO/branches/2019/dev_r11943_MERGE_2019/src/TOP/PISCES/P2Z/p2zbio.F90 @ 12340

Last change on this file since 12340 was 12340, checked in by acc, 4 years ago

Branch 2019/dev_r11943_MERGE_2019. This commit introduces basic do loop macro
substitution to the 2019 option 1, merge branch. These changes have been SETTE
tested. The only addition is the do_loop_substitute.h90 file in the OCE directory but
the macros defined therein are used throughout the code to replace identifiable, 2D-
and 3D- nested loop opening and closing statements with single-line alternatives. Code
indents are also adjusted accordingly.

The following explanation is taken from comments in the new header file:

This header file contains preprocessor definitions and macros used in the do-loop
substitutions introduced between version 4.0 and 4.2. The primary aim of these macros
is to assist in future applications of tiling to improve performance. This is expected
to be achieved by alternative versions of these macros in selected locations. The
initial introduction of these macros simply replaces all identifiable nested 2D- and
3D-loops with single line statements (and adjusts indenting accordingly). Do loops
are identifiable if they comform to either:

DO jk = ....

DO jj = .... DO jj = ...

DO ji = .... DO ji = ...
. OR .
. .

END DO END DO

END DO END DO

END DO

and white-space variants thereof.

Additionally, only loops with recognised jj and ji loops limits are treated; these are:
Lower limits of 1, 2 or fs_2
Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj)

The macro naming convention takes the form: DO_2D_BT_LR where:

B is the Bottom offset from the PE's inner domain;
T is the Top offset from the PE's inner domain;
L is the Left offset from the PE's inner domain;
R is the Right offset from the PE's inner domain

So, given an inner domain of 2,jpim1 and 2,jpjm1, a typical example would replace:

DO jj = 2, jpj

DO ji = 1, jpim1
.
.

END DO

END DO

with:

DO_2D_01_10
.
.
END_2D

similar conventions apply to the 3D loops macros. jk loop limits are retained
through macro arguments and are not restricted. This includes the possibility of
strides for which an extra set of DO_3DS macros are defined.

In the example definition below the inner PE domain is defined by start indices of
(kIs, kJs) and end indices of (kIe, KJe)

#define DO_2D_00_00 DO jj = kJs, kJe ; DO ji = kIs, kIe
#define END_2D END DO ; END DO

TO DO:


Only conventional nested loops have been identified and replaced by this step. There are constructs such as:

DO jk = 2, jpkm1

z2d(:,:) = z2d(:,:) + e3w(:,:,jk,Kmm) * z3d(:,:,jk) * wmask(:,:,jk)

END DO

which may need to be considered.

  • Property svn:keywords set to Id
File size: 22.9 KB
Line 
1MODULE p2zbio
2   !!======================================================================
3   !!                         ***  MODULE p2zbio  ***
4   !! TOP :   LOBSTER
5   !!======================================================================
6   !! History :    -   !  1999-07  (M. Levy) Original code
7   !!              -   !  2000-12  (E. Kestenare) assign a parameter to name individual tracers
8   !!              -   !  2001-03  (M. Levy)  LNO3 + dia2d
9   !!             2.0  !  2007-12  (C. Deltel, G. Madec)  F90
10   !!----------------------------------------------------------------------
11   !!   p2z_bio        : 
12   !!----------------------------------------------------------------------
13   USE oce_trc         !
14   USE trc             !
15   USE sms_pisces      !
16   USE p2zopt          !
17   USE trd_oce         !
18   USE trdtrc          !
19   !
20   USE lbclnk          !
21   USE prtctl_trc      ! Print control for debbuging
22   USE iom             !
23   
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   p2z_bio         ! called in ???
28   PUBLIC   p2z_bio_init    ! called in ???
29
30   REAL(wp) ::   tmumax     ! maximal phytoplankton growth rate            [s-1]
31   REAL(wp) ::   rgamma     ! phytoplankton exudation fraction             [%]
32   REAL(wp) ::   fphylab    ! NH4 fraction of phytoplankton exsudation
33   REAL(wp) ::   tmminp     ! minimal phytoplancton mortality rate         [0.05/86400 s-1=20 days]
34   REAL(wp) ::   aki        ! light photosynthesis half saturation constant[W/m2]
35   !
36   REAL(wp) ::   akno3      ! nitrate limitation half-saturation value     [mmol/m3]
37   REAL(wp) ::   aknh4      ! ammonium limitation half-saturation value    [mmol/m3]
38   REAL(wp) ::   taunn      ! nitrification rate                           [s-1]
39   REAL(wp) ::   psinut     ! inhibition of nitrate uptake by ammonium
40   !
41   REAL(wp) ::   taudn      ! detritus breakdown rate                        [0.1/86400 s-1=10 days]
42   REAL(wp) ::   fdetlab    ! NH4 fraction of detritus dissolution
43   !
44   REAL(wp) ::   taudomn    ! DOM breakdown rate                             [s-1]
45   !                        ! slow remineralization rate of semi-labile dom to nh4 (1 month)
46   !
47   REAL(wp) ::   rppz       ! ivlev coeff for zoo mortality
48   REAL(wp) ::   taus       ! specific zooplankton maximal grazing rate              [s-1]
49   !                                     ! 0.75/86400 s-1=8.680555E-6    1/86400 = 1.15e-5
50   REAL(wp) ::   aks        ! half-saturation constant for total zooplankton grazing [mmolN.m-3]
51   REAL(wp) ::   rpnaz      ! non-assimilated phytoplankton by zooplancton           [%]
52   REAL(wp) ::   rdnaz      ! non-assimilated detritus by zooplankton                [%]
53   REAL(wp) ::   tauzn      ! zooplancton specific excretion rate                    [0.1/86400 s-1=10 days]
54   REAL(wp) ::   tmminz     ! minimal zooplankton mortality rate                     [(mmolN/m3)-1 d-1]
55   REAL(wp) ::   fzoolab    ! NH4 fraction of zooplankton excretion
56   REAL(wp) ::   fdbod      ! zooplankton mortality fraction that goes to detritus
57
58   !! * Substitutions
59#  include "vectopt_loop_substitute.h90"
60#  include "do_loop_substitute.h90"
61   !!----------------------------------------------------------------------
62   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
63   !! $Id$
64   !! Software governed by the CeCILL license (see ./LICENSE)
65   !!----------------------------------------------------------------------
66CONTAINS
67
68   SUBROUTINE p2z_bio( kt, Kmm, Krhs )
69      !!---------------------------------------------------------------------
70      !!                     ***  ROUTINE p2z_bio  ***
71      !!
72      !! ** Purpose :   compute the now trend due to biogeochemical processes
73      !!              and add it to the general trend of passive tracers equations
74      !!
75      !! ** Method  :   each now biological flux is calculated in function of now
76      !!              concentrations of tracers.
77      !!              depending on the tracer, these fluxes are sources or sinks.
78      !!              the total of the sources and sinks for each tracer
79      !!              is added to the general trend.
80      !!       
81      !!                      tr(Krhs) = tr(Krhs) + zf...tr(Krhs) - zftra...
82      !!                                     |         |
83      !!                                     |         |
84      !!                                  source      sink
85      !!       
86      !!---------------------------------------------------------------------
87      INTEGER, INTENT( in ) ::   kt             ! ocean time-step index     
88      INTEGER, INTENT( in ) ::   Kmm, Krhs      ! time level indices
89      !
90      INTEGER  ::   ji, jj, jk, jl
91      REAL(wp) ::   zdet, zzoo, zphy, zno3, znh4, zdom      ! now concentrations
92      REAL(wp) ::   zlno3, zlnh4, zle, zlt                  ! limitation terms for phyto
93      REAL(wp) ::   zno3phy, znh4phy, zphynh4, zphydom
94      REAL(wp) ::   zphydet, zphyzoo, zdetzoo
95      REAL(wp) ::   zzoonh4, zzoodom, zzoodet, zdetnh4, zdetdom
96      REAL(wp) ::   znh4no3, zdomnh4, zppz, zpdz, zpppz, zppdz, zfood
97      REAL(wp) ::   zfilpz, zfildz, zphya, zzooa, zno3a
98      REAL(wp) ::   znh4a, zdeta, zdoma, zzoobod, zboddet, zdomaju
99      REAL(wp) ::   ze3t
100      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zw2d
101      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   zw3d
102      CHARACTER (len=25) :: charout
103      !!---------------------------------------------------------------------
104      !
105      IF( ln_timing )   CALL timing_start('p2z_bio')
106      !
107      IF( lk_iomput )   ALLOCATE( zw2d(jpi,jpj,17), zw3d(jpi,jpj,jpk,3) )
108
109      IF( kt == nittrc000 ) THEN
110         IF(lwp) WRITE(numout,*)
111         IF(lwp) WRITE(numout,*) ' p2z_bio: LOBSTER bio-model'
112         IF(lwp) WRITE(numout,*) ' ~~~~~~~'
113      ENDIF
114
115      xksi(:,:) = 0.e0        ! zooplakton closure ( fbod)
116      IF( lk_iomput ) THEN
117         zw2d  (:,:,:) = 0._wp
118         zw3d(:,:,:,:) = 0._wp
119      ENDIF
120
121      !                                      ! -------------------------- !
122      DO jk = 1, jpkbm1                      !  Upper ocean (bio-layers)  !
123         !                                   ! -------------------------- !
124         DO_2D_00_00
125            ! trophic variables( det, zoo, phy, no3, nh4, dom)
126            ! ------------------------------------------------
127
128            ! negative trophic variables DO not contribute to the fluxes
129            zdet = MAX( 0.e0, tr(ji,jj,jk,jpdet,Kmm) )
130            zzoo = MAX( 0.e0, tr(ji,jj,jk,jpzoo,Kmm) )
131            zphy = MAX( 0.e0, tr(ji,jj,jk,jpphy,Kmm) )
132            zno3 = MAX( 0.e0, tr(ji,jj,jk,jpno3,Kmm) )
133            znh4 = MAX( 0.e0, tr(ji,jj,jk,jpnh4,Kmm) )
134            zdom = MAX( 0.e0, tr(ji,jj,jk,jpdom,Kmm) )
135
136            ! Limitations
137            zlt   = 1.
138            zle   = 1. - EXP( -etot(ji,jj,jk) / aki / zlt )
139            ! psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03
140            zlno3 = zno3 * EXP( -psinut * znh4 ) / ( akno3 + zno3 )
141            zlnh4 = znh4 / (znh4+aknh4) 
142
143            ! sinks and sources
144            !    phytoplankton production and exsudation
145            zno3phy = tmumax * zle * zlt * zlno3 * zphy
146            znh4phy = tmumax * zle * zlt * zlnh4 * zphy
147
148            !    fphylab added by asklod AS Kremeur 2005-03
149            zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy)
150            zphynh4 = rgamma * fphylab * (zno3phy + znh4phy)
151            ! zooplankton production
152            !    preferences
153            zppz = rppz
154            zpdz = 1. - rppz
155            zpppz = ( zppz * zphy ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
156            zppdz = ( zpdz * zdet ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 )
157            zfood = zpppz * zphy + zppdz * zdet
158            !    filtration
159            zfilpz = taus * zpppz / (aks + zfood)
160            zfildz = taus * zppdz / (aks + zfood)
161            !    grazing
162            zphyzoo = zfilpz * zphy * zzoo
163            zdetzoo = zfildz * zdet * zzoo
164
165            ! fecal pellets production
166            zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo
167
168            ! zooplankton liquide excretion
169            zzoonh4 = tauzn * fzoolab * zzoo 
170            zzoodom = tauzn * (1 - fzoolab) * zzoo
171
172            ! mortality
173            !    phytoplankton mortality
174            zphydet = tmminp * zphy
175
176            !    zooplankton mortality
177            !    closure : flux grazing is redistributed below level jpkbio
178            zzoobod = tmminz * zzoo * zzoo
179            xksi(ji,jj) = xksi(ji,jj) + (1-fdbod) * zzoobod * e3t(ji,jj,jk,Kmm)
180            zboddet = fdbod * zzoobod
181
182            ! detritus and dom breakdown
183            zdetnh4 = taudn * fdetlab * zdet
184            zdetdom = taudn * (1 - fdetlab) * zdet
185
186            zdomnh4 = taudomn * zdom
187
188            ! flux added to express how the excess of nitrogen from
189            ! PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment)
190            zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
191
192            ! Nitrification
193            znh4no3 = taunn * znh4
194
195            ! determination of trends
196            !    total trend for each biological tracer
197            zphya =   zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet
198            zzooa =   zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod
199            zno3a = - zno3phy + znh4no3
200            znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju
201            zdeta =   zphydet + zzoodet - zdetzoo - zdetnh4 - zdetdom + zboddet
202            zdoma =   zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
203
204            ! tracer flux at totox-point added to the general trend
205            tr(ji,jj,jk,jpdet,Krhs) = tr(ji,jj,jk,jpdet,Krhs) + zdeta
206            tr(ji,jj,jk,jpzoo,Krhs) = tr(ji,jj,jk,jpzoo,Krhs) + zzooa
207            tr(ji,jj,jk,jpphy,Krhs) = tr(ji,jj,jk,jpphy,Krhs) + zphya
208            tr(ji,jj,jk,jpno3,Krhs) = tr(ji,jj,jk,jpno3,Krhs) + zno3a
209            tr(ji,jj,jk,jpnh4,Krhs) = tr(ji,jj,jk,jpnh4,Krhs) + znh4a
210            tr(ji,jj,jk,jpdom,Krhs) = tr(ji,jj,jk,jpdom,Krhs) + zdoma
211
212             IF( lk_iomput ) THEN
213               ! convert fluxes in per day
214               ze3t = e3t(ji,jj,jk,Kmm) * 86400._wp
215               zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
216               zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
217               zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
218               zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
219               zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
220               zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
221               zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
222               zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
223               zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
224               zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
225               zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
226               zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
227               zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
228               zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
229               zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
230               zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
231               zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
232               !   
233               zw3d(ji,jj,jk,1) = zno3phy * 86400
234               zw3d(ji,jj,jk,2) = znh4phy * 86400     
235               zw3d(ji,jj,jk,3) = znh4no3 * 86400   
236                !
237             ENDIF
238         END_2D
239      END DO
240
241      !                                      ! -------------------------- !
242      DO jk = jpkb, jpkm1                    !  Upper ocean (bio-layers)  !
243         !                                   ! -------------------------- !
244         DO_2D_00_00
245            ! remineralisation of all quantities towards nitrate
246
247            !    trophic variables( det, zoo, phy, no3, nh4, dom)
248            !       negative trophic variables DO not contribute to the fluxes
249            zdet = MAX( 0.e0, tr(ji,jj,jk,jpdet,Kmm) )
250            zzoo = MAX( 0.e0, tr(ji,jj,jk,jpzoo,Kmm) )
251            zphy = MAX( 0.e0, tr(ji,jj,jk,jpphy,Kmm) )
252            zno3 = MAX( 0.e0, tr(ji,jj,jk,jpno3,Kmm) )
253            znh4 = MAX( 0.e0, tr(ji,jj,jk,jpnh4,Kmm) )
254            zdom = MAX( 0.e0, tr(ji,jj,jk,jpdom,Kmm) )
255
256            !    Limitations
257            zlt   = 0.e0
258            zle   = 0.e0
259            zlno3 = 0.e0
260            zlnh4 = 0.e0
261
262            !    sinks and sources
263            !       phytoplankton production and exsudation
264            zno3phy = 0.e0
265            znh4phy = 0.e0
266            zphydom = 0.e0
267            zphynh4 = 0.e0
268
269            !    zooplankton production
270            zphyzoo = 0.e0      ! grazing
271            zdetzoo = 0.e0
272
273            zzoodet = 0.e0      ! fecal pellets production
274
275            zzoonh4 = tauzn * fzoolab * zzoo         ! zooplankton liquide excretion
276            zzoodom = tauzn * (1 - fzoolab) * zzoo
277
278            !    mortality
279            zphydet = tmminp * zphy      ! phytoplankton mortality
280
281            zzoobod = 0.e0               ! zooplankton mortality
282            zboddet = 0.e0               ! closure : flux fbod is redistributed below level jpkbio
283
284            !    detritus and dom breakdown
285            zdetnh4 = taudn * fdetlab * zdet
286            zdetdom = taudn * (1 - fdetlab) * zdet
287
288            zdomnh4 = taudomn * zdom
289            zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom)
290
291            !    Nitrification
292            znh4no3 = taunn * znh4
293
294
295            ! determination of trends
296            !     total trend for each biological tracer
297            zphya =   zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet
298            zzooa =   zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod
299            zno3a = - zno3phy + znh4no3 
300            znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju
301            zdeta = zphydet + zzoodet  - zdetzoo - zdetnh4 - zdetdom + zboddet
302            zdoma = zphydom + zzoodom + zdetdom - zdomnh4 - zdomaju
303
304            ! tracer flux at totox-point added to the general trend
305            tr(ji,jj,jk,jpdet,Krhs) = tr(ji,jj,jk,jpdet,Krhs) + zdeta
306            tr(ji,jj,jk,jpzoo,Krhs) = tr(ji,jj,jk,jpzoo,Krhs) + zzooa
307            tr(ji,jj,jk,jpphy,Krhs) = tr(ji,jj,jk,jpphy,Krhs) + zphya
308            tr(ji,jj,jk,jpno3,Krhs) = tr(ji,jj,jk,jpno3,Krhs) + zno3a
309            tr(ji,jj,jk,jpnh4,Krhs) = tr(ji,jj,jk,jpnh4,Krhs) + znh4a
310            tr(ji,jj,jk,jpdom,Krhs) = tr(ji,jj,jk,jpdom,Krhs) + zdoma
311            !
312             IF( lk_iomput ) THEN                  ! convert fluxes in per day
313               ze3t = e3t(ji,jj,jk,Kmm) * 86400._wp
314               zw2d(ji,jj,1)  = zw2d(ji,jj,1)  + zno3phy * ze3t
315               zw2d(ji,jj,2)  = zw2d(ji,jj,2)  + znh4phy * ze3t
316               zw2d(ji,jj,3)  = zw2d(ji,jj,3)  + zphydom * ze3t
317               zw2d(ji,jj,4)  = zw2d(ji,jj,4)  + zphynh4 * ze3t
318               zw2d(ji,jj,5)  = zw2d(ji,jj,5)  + zphyzoo * ze3t
319               zw2d(ji,jj,6)  = zw2d(ji,jj,6)  + zphydet * ze3t
320               zw2d(ji,jj,7)  = zw2d(ji,jj,7)  + zdetzoo * ze3t
321               zw2d(ji,jj,8)  = zw2d(ji,jj,8)  + zzoodet * ze3t
322               zw2d(ji,jj,9)  = zw2d(ji,jj,9)  + zzoobod * ze3t
323               zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t
324               zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t
325               zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t
326               zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t
327               zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t
328               zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t
329               zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t
330               zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t
331               !   
332               zw3d(ji,jj,jk,1) = zno3phy * 86400._wp
333               zw3d(ji,jj,jk,2) = znh4phy * 86400._wp
334               zw3d(ji,jj,jk,3) = znh4no3 * 86400._wp
335               !
336            ENDIF
337         END_2D
338      END DO
339      !
340      IF( lk_iomput ) THEN
341         CALL lbc_lnk( 'p2zbio', zw2d(:,:,:),'T', 1. )
342         CALL lbc_lnk_multi( 'p2zbio', zw3d(:,:,:,1),'T', 1., zw3d(:,:,:,2),'T', 1., zw3d(:,:,:,3),'T', 1. )
343         ! Save diagnostics
344         CALL iom_put( "TNO3PHY", zw2d(:,:,1) )
345         CALL iom_put( "TNH4PHY", zw2d(:,:,2) )
346         CALL iom_put( "TPHYDOM", zw2d(:,:,3) )
347         CALL iom_put( "TPHYNH4", zw2d(:,:,4) )
348         CALL iom_put( "TPHYZOO", zw2d(:,:,5) )
349         CALL iom_put( "TPHYDET", zw2d(:,:,6) )
350         CALL iom_put( "TDETZOO", zw2d(:,:,7) )
351         CALL iom_put( "TZOODET", zw2d(:,:,8) )
352         CALL iom_put( "TZOOBOD", zw2d(:,:,9) )
353         CALL iom_put( "TZOONH4", zw2d(:,:,10) )
354         CALL iom_put( "TZOODOM", zw2d(:,:,11) )
355         CALL iom_put( "TNH4NO3", zw2d(:,:,12) )
356         CALL iom_put( "TDOMNH4", zw2d(:,:,13) )
357         CALL iom_put( "TDETNH4", zw2d(:,:,14) )
358         CALL iom_put( "TPHYTOT", zw2d(:,:,15) )
359         CALL iom_put( "TZOOTOT", zw2d(:,:,16) )
360         !
361         CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) )
362         CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) )
363         CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) )
364         !
365      ENDIF
366
367      IF(sn_cfctl%l_prttrc)   THEN  ! print mean trends (used for debugging)
368         WRITE(charout, FMT="('bio')")
369         CALL prt_ctl_trc_info(charout)
370         CALL prt_ctl_trc(tab4d=tr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm)
371      ENDIF
372      !
373      IF( lk_iomput )   DEALLOCATE( zw2d, zw3d )
374      !
375      IF( ln_timing )  CALL timing_stop('p2z_bio')
376      !
377   END SUBROUTINE p2z_bio
378
379
380   SUBROUTINE p2z_bio_init
381      !!----------------------------------------------------------------------
382      !!                  ***  ROUTINE p2z_bio_init  ***
383      !!
384      !! ** Purpose :  biological parameters
385      !!
386      !! ** Method  :   Read namelist and check the parameters
387      !!
388      !!----------------------------------------------------------------------
389      INTEGER ::   ios   ! Local integer
390      !!
391      NAMELIST/namlobphy/ tmumax, rgamma, fphylab, tmminp, aki
392      NAMELIST/namlobnut/ akno3, aknh4, taunn, psinut
393      NAMELIST/namlobzoo/ rppz, taus, aks, rpnaz, rdnaz, tauzn, fzoolab, fdbod, tmminz
394      NAMELIST/namlobdet/ taudn, fdetlab
395      NAMELIST/namlobdom/ taudomn
396      !!----------------------------------------------------------------------
397      !
398      IF(lwp) WRITE(numout,*)
399      IF(lwp) WRITE(numout,*) ' p2z_bio_init : LOBSTER bio-model initialization'
400      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~'
401      !
402      READ  ( numnatp_ref, namlobphy, IOSTAT = ios, ERR = 901)
403901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlobphy in reference namelist' )
404      READ  ( numnatp_cfg, namlobphy, IOSTAT = ios, ERR = 902 )
405902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobphy in configuration namelist' )
406      IF(lwm) WRITE ( numonp, namlobphy )
407      !
408      IF(lwp) THEN
409         WRITE(numout,*) '   Namelist namlobphy'
410         WRITE(numout,*) '      phyto max growth rate                                tmumax    =', 86400 * tmumax, ' d'
411         WRITE(numout,*) '      phytoplankton exudation fraction                     rgamma    =', rgamma
412         WRITE(numout,*) '      NH4 fraction of phytoplankton exsudation             fphylab   =', fphylab
413         WRITE(numout,*) '      minimal phyto mortality rate                         tmminp    =', 86400 * tmminp
414         WRITE(numout,*) '      light hlaf saturation constant                       aki       =', aki
415      ENDIF
416
417      READ  ( numnatp_ref, namlobnut, IOSTAT = ios, ERR = 903)
418903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlobnut in reference namelist' )
419      READ  ( numnatp_cfg, namlobnut, IOSTAT = ios, ERR = 904 )
420904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobnut in configuration namelist' )
421      IF(lwm) WRITE ( numonp, namlobnut )
422
423      IF(lwp) THEN
424         WRITE(numout,*) 
425         WRITE(numout,*) '   Namelist namlobnut'
426         WRITE(numout,*) '      half-saturation nutrient for no3 uptake              akno3     =', akno3
427         WRITE(numout,*) '      half-saturation nutrient for nh4 uptake              aknh4     =', aknh4
428         WRITE(numout,*) '      nitrification rate                                   taunn     =', taunn
429         WRITE(numout,*) '      inhibition of no3 uptake by nh4                      psinut    =', psinut
430      ENDIF
431
432      READ  ( numnatp_ref, namlobzoo, IOSTAT = ios, ERR = 905)
433905   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlobzoo in reference namelist' )
434      READ  ( numnatp_cfg, namlobzoo, IOSTAT = ios, ERR = 906 )
435906   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobzoo in configuration namelist' )
436      IF(lwm) WRITE ( numonp, namlobzoo )
437
438      IF(lwp) THEN
439         WRITE(numout,*) 
440         WRITE(numout,*) '   Namelist namlobzoo'
441         WRITE(numout,*) '      zoo preference for phyto                             rppz      =', rppz
442         WRITE(numout,*) '      maximal zoo grazing rate                             taus      =', 86400 * taus, ' d'
443         WRITE(numout,*) '      half saturation constant for zoo food                aks       =', aks
444         WRITE(numout,*) '      non-assimilated phyto by zoo                         rpnaz     =', rpnaz
445         WRITE(numout,*) '      non-assimilated detritus by zoo                      rdnaz     =', rdnaz
446         WRITE(numout,*) '      zoo specific excretion rate                          tauzn     =', 86400 * tauzn
447         WRITE(numout,*) '      minimal zoo mortality rate                           tmminz    =', 86400 * tmminz
448         WRITE(numout,*) '      NH4 fraction of zooplankton excretion                fzoolab   =', fzoolab
449         WRITE(numout,*) '      Zooplankton mortality fraction that goes to detritus fdbod     =', fdbod
450      ENDIF
451
452      READ  ( numnatp_ref, namlobdet, IOSTAT = ios, ERR = 907)
453907   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlobdet in reference namelist' )
454      READ  ( numnatp_cfg, namlobdet, IOSTAT = ios, ERR = 908 )
455908   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobdet in configuration namelist' )
456      IF(lwm) WRITE ( numonp, namlobdet )
457
458      IF(lwp) THEN
459          WRITE(numout,*) 
460          WRITE(numout,*) '   Namelist namlobdet'
461          WRITE(numout,*) '      detrital breakdown rate                              taudn     =', 86400 * taudn , ' d'
462          WRITE(numout,*) '      NH4 fraction of detritus dissolution                 fdetlab   =', fdetlab
463      ENDIF
464
465      READ  ( numnatp_ref, namlobdom, IOSTAT = ios, ERR = 909)
466909   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namlobdom in reference namelist' )
467      READ  ( numnatp_cfg, namlobdom, IOSTAT = ios, ERR = 910 )
468910   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlobdom in configuration namelist' )
469      IF(lwm) WRITE ( numonp, namlobdom )
470
471      IF(lwp) THEN
472          WRITE(numout,*) 
473          WRITE(numout,*) '   Namelist namlobdom'
474          WRITE(numout,*) '      DOM breakdown rate                                 taudomn     =', 86400 * taudn , ' d'
475      ENDIF
476      !
477   END SUBROUTINE p2z_bio_init
478
479   !!======================================================================
480END MODULE p2zbio
Note: See TracBrowser for help on using the repository browser.