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.
trcini_pisces.F90 in NEMO/trunk/src/TOP/PISCES – NEMO

source: NEMO/trunk/src/TOP/PISCES/trcini_pisces.F90

Last change on this file was 15459, checked in by cetlod, 2 years ago

Various bug fixes and more comments in PISCES routines ; sette test OK in debug mode, nn_hls=1/2, with tiling ; run.stat unchanged ; of course tracer.stat different

  • Property svn:keywords set to Id
File size: 17.2 KB
Line 
1MODULE trcini_pisces
2   !!======================================================================
3   !!                         ***  MODULE trcini_pisces  ***
4   !! TOP :   initialisation of the PISCES biochemical model
5   !!         This module is for LOBSTER, PISCES and PISCES-QUOTA
6   !!======================================================================
7   !! History :    -   !  1988-07  (E. Maier-Reiner) Original code
8   !!              -   !  1999-10  (O. Aumont, C. Le Quere)
9   !!              -   !  2002     (O. Aumont)  PISCES
10   !!             1.0  !  2005-03  (O. Aumont, A. El Moussaoui) F90
11   !!             2.0  !  2007-12  (C. Ethe, G. Madec) from trcini.pisces.h90
12   !!             3.5  !  2012-05  (C. Ethe) Merge PISCES-LOBSTER
13   !!----------------------------------------------------------------------
14   !! trc_ini_pisces   : PISCES biochemical model initialisation
15   !!----------------------------------------------------------------------
16   USE par_trc         !  TOP parameters
17   USE oce_trc         !  shared variables between ocean and passive tracers
18   USE trc             !  passive tracers common variables
19   USE trcnam_pisces   !  PISCES namelist
20   USE sms_pisces      !  PISCES Source Minus Sink variables
21   USE sedini          !  SEDIMENTS initialization routine
22
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC   trc_ini_pisces   ! called by trcini.F90 module
27
28   !!----------------------------------------------------------------------
29   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
30   !! $Id$
31   !! Software governed by the CeCILL license (see ./LICENSE)
32   !!----------------------------------------------------------------------
33CONTAINS
34
35   SUBROUTINE trc_ini_pisces( Kmm )
36      !!----------------------------------------------------------------------
37      !!                   ***  ROUTINE trc_ini_pisces ***
38      !!
39      !! ** Purpose :   Initialisation of the PISCES biochemical model
40      !!                Allocation of the dynamic arrays
41      !!----------------------------------------------------------------------
42      INTEGER, INTENT(in)  ::  Kmm      ! time level indices
43      !
44      ! Read the PISCES namelist
45      CALL trc_nam_pisces
46      !
47      IF( ln_p4z .OR. ln_p5z ) THEN  ;   CALL p4z_ini( Kmm )   !  PISCES
48      ELSE                           ;   CALL p2z_ini( Kmm )   !  LOBSTER
49      ENDIF
50
51   END SUBROUTINE trc_ini_pisces
52
53
54   SUBROUTINE p4z_ini( Kmm )
55      !!----------------------------------------------------------------------
56      !!                   ***  ROUTINE p4z_ini ***
57      !!
58      !! ** Purpose :   Initialisation of the PISCES biochemical model
59      !!----------------------------------------------------------------------
60      USE p4zsms          !  Main P4Z routine
61      USE p4zche          !  Chemical model
62      USE p4zsink         !  vertical flux of particulate matter due to sinking
63      USE p4zopt          !  optical model
64      USE p4zbc          !  Boundary conditions
65      USE p4zfechem       !  Iron chemistry
66      USE p4zrem          !  Remineralisation of organic matter
67      USE p4zflx          !  Gas exchange
68      USE p4zlim          !  Co-limitations of differents nutrients
69      USE p4zprod         !  Growth rate of the 2 phyto groups
70      USE p4zmicro        !  Sources and sinks of microzooplankton
71      USE p4zmeso         !  Sources and sinks of mesozooplankton
72      USE p4zmort         !  Mortality terms for phytoplankton
73      USE p4zlys          !  Calcite saturation
74      USE p4zsed          !  Sedimentation & burial
75      USE p4zpoc          !  Remineralization of organic particles
76      USE p4zligand       !  Remineralization of organic ligands
77      USE p5zlim          !  Co-limitations of differents nutrients (QUOTA)
78      USE p5zprod         !  Growth rate of the 3 phyto groups (QUOTA)
79      USE p5zmicro        !  Sources and sinks of microzooplankton (QUOTA)
80      USE p5zmeso         !  Sources and sinks of mesozooplankton (QUOTA)
81      USE p5zmort         !  Mortality terms for phytoplankton (QUOTA)
82      !
83      INTEGER, INTENT(in)  ::  Kmm      ! time level indices
84      !
85      INTEGER  ::  ji, jj, jk, jn, ierr
86      REAL(wp) ::  zcaralk, zbicarb, zco3
87      REAL(wp) ::  ztmas, ztmas1
88      REAL(wp) ::  sco2, alka0, oxyg0, po4, bioma0, silic1, no3   
89      CHARACTER(len = 20)  ::  cltra
90      !!----------------------------------------------------------------------
91      !
92      IF(lwp) THEN
93         WRITE(numout,*)
94         IF( ln_p4z ) THEN
95            WRITE(numout,*) 'p4z_ini :   PISCES biochemical model initialisation'
96            WRITE(numout,*) '~~~~~~~'
97         ELSE
98            WRITE(numout,*) 'p5z_ini :   PISCES biochemical model initialisation'
99            WRITE(numout,*) '~~~~~~~     With variable stoichiometry'
100         ENDIF
101      ENDIF
102      !
103      sco2   =  2.312e-3_wp
104      alka0  =  2.426e-3_wp
105      oxyg0  =  177.6e-6_wp 
106      po4    =  2.165e-6_wp 
107      bioma0 =  1.000e-8_wp 
108      silic1 =  91.51e-6_wp 
109      no3    =  30.9e-6_wp * 7.3125_wp
110      !
111      ! Allocate PISCES arrays
112      ierr =         sms_pisces_alloc()         
113      ierr = ierr +  p4z_che_alloc()
114      ierr = ierr +  p4z_sink_alloc()
115      ierr = ierr +  p4z_opt_alloc()
116      ierr = ierr +  p4z_flx_alloc()
117      ierr = ierr +  p4z_sed_alloc()
118      ierr = ierr +  p4z_lim_alloc()
119      IF( ln_p4z ) THEN
120         ! PISCES part
121         ierr = ierr +  p4z_prod_alloc()
122         ierr = ierr +  p4z_meso_alloc()
123      ELSE
124         ! PISCES-QUOTA part
125         ierr = ierr +  p5z_lim_alloc()
126         ierr = ierr +  p5z_prod_alloc()
127         ierr = ierr +  p5z_meso_alloc()
128      ENDIF
129      ierr = ierr +  p4z_rem_alloc()
130      !
131      CALL mpp_sum( 'trcini_pisces', ierr )
132      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'pisces_alloc: unable to allocate PISCES arrays' )
133      !
134      ryyss    = nyear_len(1) * rday    ! number of seconds per year
135      r1_ryyss = 1. / ryyss
136      !
137
138      ! assign an index in trc arrays for each prognostic variables
139      ! This is based on the information read in the namelist_top
140      DO jn = 1, jptra
141        cltra = ctrcnm(jn) 
142        IF( cltra == 'DIC'      )   jpdic = jn      !: dissolved inoganic carbon concentration
143        IF( cltra == 'Alkalini' )   jptal = jn      !: total alkalinity
144        IF( cltra == 'O2'       )   jpoxy = jn      !: oxygen carbon concentration
145        IF( cltra == 'CaCO3'    )   jpcal = jn      !: calcite  concentration
146        IF( cltra == 'PO4'      )   jppo4 = jn      !: phosphate concentration
147        IF( cltra == 'POC'      )   jppoc = jn      !: small particulate organic phosphate concentration
148        IF( cltra == 'Si'       )   jpsil = jn      !: silicate concentration
149        IF( cltra == 'PHY'      )   jpphy = jn      !: phytoplancton concentration
150        IF( cltra == 'ZOO'      )   jpzoo = jn      !: zooplancton concentration
151        IF( cltra == 'DOC'      )   jpdoc = jn      !: dissolved organic carbon concentration
152        IF( cltra == 'PHY2'     )   jpdia = jn      !: Diatoms Concentration
153        IF( cltra == 'ZOO2'     )   jpmes = jn      !: Mesozooplankton Concentration
154        IF( cltra == 'DSi'      )   jpdsi = jn      !: Diatoms Silicate Concentration
155        IF( cltra == 'Fer'      )   jpfer = jn      !: Iron Concentration
156        IF( cltra == 'BFe'      )   jpbfe = jn      !: Big iron particles Concentration
157        IF( cltra == 'GOC'      )   jpgoc = jn      !: Big particulate organic phosphate concentration
158        IF( cltra == 'SFe'      )   jpsfe = jn      !: Small iron particles Concentration
159        IF( cltra == 'DFe'      )   jpdfe = jn      !: Diatoms iron Concentration
160        IF( cltra == 'GSi'      )   jpgsi = jn      !: (big) Silicate Concentration
161        IF( cltra == 'NFe'      )   jpnfe = jn      !: Nano iron Concentration
162        IF( cltra == 'NCHL'     )   jpnch = jn      !: Nano Chlorophyll Concentration
163        IF( cltra == 'DCHL'     )   jpdch = jn      !: Diatoms Chlorophyll Concentration
164        IF( cltra == 'NO3'      )   jpno3 = jn      !: Nitrates Concentration
165        IF( cltra == 'NH4'      )   jpnh4 = jn      !: Ammonium Concentration
166        IF( cltra == 'DON'      )   jpdon = jn      !: Dissolved organic N Concentration
167        IF( cltra == 'DOP'      )   jpdop = jn      !: Dissolved organic P Concentration
168        IF( cltra == 'PON'      )   jppon = jn      !: Small Nitrogen particle Concentration
169        IF( cltra == 'POP'      )   jppop = jn      !: Small Phosphorus particle Concentration
170        IF( cltra == 'GON'      )   jpgon = jn      !: Big Nitrogen particles Concentration
171        IF( cltra == 'GOP'      )   jpgop = jn      !: Big Phosphorus Concentration
172        IF( cltra == 'PHYN'     )   jpnph = jn      !: Nanophytoplankton N biomass
173        IF( cltra == 'PHYP'     )   jppph = jn      !: Nanophytoplankton P biomass
174        IF( cltra == 'DIAN'     )   jpndi = jn      !: Diatoms N biomass
175        IF( cltra == 'DIAP'     )   jppdi = jn      !: Diatoms P biomass
176        IF( cltra == 'PIC'      )   jppic = jn      !: Picophytoplankton C biomass
177        IF( cltra == 'PICN'     )   jpnpi = jn      !: Picophytoplankton N biomass
178        IF( cltra == 'PICP'     )   jpppi = jn      !: Picophytoplankton P biomass
179        IF( cltra == 'PCHL'     )   jppch = jn      !: Diatoms Chlorophyll Concentration
180        IF( cltra == 'PFe'      )   jppfe = jn      !: Picophytoplankton Fe biomass
181        IF( cltra == 'LGW'      )   jplgw = jn      !: Weak ligands
182      END DO
183
184      CALL p4z_sms_init       !  Maint routine
185      !
186
187      ! Set biological ratios
188      ! ---------------------
189      rno3    =  16._wp / 117._wp   ! C/N
190      po4r    =   1._wp / 117._wp   ! C/P
191      o2nit   =  32._wp / 117._wp   ! O2/C for nitrification
192      o2ut    = 138._wp / 117._wp   ! O2/C for ammonification
193      rdenit  =  ( ( o2ut + o2nit ) * 0.80 - rno3 - rno3 * 0.60 ) / rno3  ! Denitrification
194      rdenita =   3._wp /  5._wp    ! Denitrification
195      IF( ln_p5z ) THEN
196         no3rat3 = no3rat3 / rno3   ! C/N ratio in zooplankton
197         po4rat3 = po4rat3 / po4r   ! C/P ratio in zooplankton
198      ENDIF
199
200      ! Initialization of tracer concentration in case of  no restart
201      !--------------------------------------------------------------
202      IF( .NOT.ln_rsttr ) THEN 
203         tr(:,:,:,jpdic,Kmm) = sco2
204         tr(:,:,:,jpdoc,Kmm) = bioma0
205         tr(:,:,:,jptal,Kmm) = alka0
206         tr(:,:,:,jpoxy,Kmm) = oxyg0
207         tr(:,:,:,jpcal,Kmm) = bioma0
208         tr(:,:,:,jppo4,Kmm) = po4 / po4r
209         tr(:,:,:,jppoc,Kmm) = bioma0
210         tr(:,:,:,jpgoc,Kmm) = bioma0
211         tr(:,:,:,jpbfe,Kmm) = bioma0 * 5.e-6
212         tr(:,:,:,jpsil,Kmm) = silic1
213         tr(:,:,:,jpdsi,Kmm) = bioma0 * 0.15
214         tr(:,:,:,jpgsi,Kmm) = bioma0 * 5.e-6
215         tr(:,:,:,jpphy,Kmm) = bioma0
216         tr(:,:,:,jpdia,Kmm) = bioma0
217         tr(:,:,:,jpzoo,Kmm) = bioma0
218         tr(:,:,:,jpmes,Kmm) = bioma0
219         tr(:,:,:,jpfer,Kmm) = 0.6E-9
220         tr(:,:,:,jpsfe,Kmm) = bioma0 * 5.e-6
221         tr(:,:,:,jpdfe,Kmm) = bioma0 * 5.e-6
222         tr(:,:,:,jpnfe,Kmm) = bioma0 * 5.e-6
223         tr(:,:,:,jpnch,Kmm) = bioma0 * 12. / 55.
224         tr(:,:,:,jpdch,Kmm) = bioma0 * 12. / 55.
225         tr(:,:,:,jpno3,Kmm) = no3
226         tr(:,:,:,jpnh4,Kmm) = bioma0
227         IF( ln_ligand) THEN
228            tr(:,:,:,jplgw,Kmm) = 0.6E-9
229         ENDIF
230         IF( ln_p5z ) THEN
231            tr(:,:,:,jpdon,Kmm) = bioma0
232            tr(:,:,:,jpdop,Kmm) = bioma0
233            tr(:,:,:,jppon,Kmm) = bioma0
234            tr(:,:,:,jppop,Kmm) = bioma0
235            tr(:,:,:,jpgon,Kmm) = bioma0
236            tr(:,:,:,jpgop,Kmm) = bioma0
237            tr(:,:,:,jpnph,Kmm) = bioma0
238            tr(:,:,:,jppph,Kmm) = bioma0
239            tr(:,:,:,jppic,Kmm) = bioma0
240            tr(:,:,:,jpnpi,Kmm) = bioma0
241            tr(:,:,:,jpppi,Kmm) = bioma0
242            tr(:,:,:,jpndi,Kmm) = bioma0
243            tr(:,:,:,jppdi,Kmm) = bioma0
244            tr(:,:,:,jppfe,Kmm) = bioma0 * 5.e-6
245            tr(:,:,:,jppch,Kmm) = bioma0 * 12. / 55.
246         ENDIF
247         ! initialize the half saturation constant for silicate
248         ! ----------------------------------------------------
249         xksi(:,:)      = 2.e-6
250         xksimax(:,:)   = xksi(:,:)
251         consfe3(:,:,:) = 0._wp
252         !
253         sized(:,:,:) = 1.0
254         sizen(:,:,:) = 1.0
255         IF( ln_p5z )  sizep(:,:,:) = 1.0
256      END IF
257
258
259      ! Initialization of the different PISCES modules
260      ! Mainly corresponds to the namelist use
261      ! ----------------------------------------------
262      CALL p4z_sink_init         !  vertical flux of particulate organic matter
263      CALL p4z_opt_init          !  Optic: PAR in the water column
264      IF( ln_p4z ) THEN
265         ! PISCES part
266         CALL p4z_lim_init       !  co-limitations by the various nutrients
267         CALL p4z_prod_init      !  phytoplankton growth rate over the global ocean.
268      ELSE
269         ! PISCES-QUOTA part
270         CALL p5z_lim_init       !  co-limitations by the various nutrients
271         CALL p5z_prod_init      !  phytoplankton growth rate over the global ocean.
272      ENDIF
273      CALL p4z_bc_init( Kmm )    !  boundary conditions
274      CALL p4z_fechem_init       !  Iron chemistry
275      CALL p4z_rem_init          !  remineralisation
276      CALL p4z_poc_init          !  remineralisation of organic particles
277      IF( ln_ligand ) &
278         & CALL p4z_ligand_init  !  remineralisation of organic ligands
279
280      IF( ln_p4z ) THEN ! PISCES-std
281         CALL p4z_mort_init      !  phytoplankton mortality
282         CALL p4z_micro_init     !  microzooplankton
283         CALL p4z_meso_init      !  mesozooplankton
284      ELSE ! PISCES-QUOTA
285         CALL p5z_mort_init      !  phytoplankton mortality
286         CALL p5z_micro_init     !  microzooplankton
287         CALL p5z_meso_init      !  mesozooplankton
288      ENDIF
289      CALL p4z_lys_init          !  calcite saturation
290      IF( .NOT.l_co2cpl ) &
291        & CALL p4z_flx_init      !  gas exchange
292
293      ! Initialization of the sediment model
294      IF( ln_sediment)   &
295        & CALL sed_ini           ! Initialization of the sediment model
296
297      CALL p4z_sed_init          ! loss of organic matter in the sediments
298
299      IF(lwp) WRITE(numout,*) 
300      IF(lwp) WRITE(numout,*) '   ==>>>   Initialization of PISCES tracers done'
301      IF(lwp) WRITE(numout,*) 
302      !
303   END SUBROUTINE p4z_ini
304
305
306   SUBROUTINE p2z_ini( Kmm )
307      !!----------------------------------------------------------------------
308      !!                   ***  ROUTINE p2z_ini ***
309      !!
310      !! ** Purpose :   Initialisation of the LOBSTER biochemical model
311      !!----------------------------------------------------------------------
312      !
313      USE p2zopt
314      USE p2zexp
315      USE p2zbio
316      USE p2zsed
317      !
318      INTEGER, INTENT(in)  ::  Kmm      ! time level indices
319      INTEGER  ::  ji, jj, jk, jn, ierr
320      CHARACTER(len = 10)  ::  cltra
321      !!----------------------------------------------------------------------
322
323      IF(lwp) WRITE(numout,*)
324      IF(lwp) WRITE(numout,*) ' p2z_ini :   LOBSTER biochemical model initialisation'
325      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
326
327      ierr =        sms_pisces_alloc()         
328      ierr = ierr + p2z_exp_alloc()
329      !
330      CALL mpp_sum( 'trcini_pisces', ierr )
331      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'p2z_ini: unable to allocate LOBSTER arrays' )
332
333      DO jn = 1, jptra
334        cltra = ctrcnm(jn) 
335        IF( cltra == 'DET' )   jpdet = jn       !: detritus                    [mmoleN/m3]
336        IF( cltra == 'ZOO' )   jpzoo = jn       !: zooplancton concentration   [mmoleN/m3]
337        IF( cltra == 'PHY' )   jpphy = jn       !: phytoplancton concentration [mmoleN/m3]
338        IF( cltra == 'NO3' )   jpno3 = jn       !: nitrate concentration       [mmoleN/m3]
339        IF( cltra == 'NH4' )   jpnh4 = jn       !: ammonium concentration      [mmoleN/m3]
340        IF( cltra == 'DOM' )   jpdom = jn       !: dissolved organic matter    [mmoleN/m3]
341      ENDDO
342
343      jpkb = 10        !  last level where depth less than 200 m
344      DO jk = jpkm1, 1, -1
345         IF( gdept_1d(jk) > 200. ) jpkb = jk 
346      END DO
347      IF (lwp) WRITE(numout,*)
348      IF (lwp) WRITE(numout,*) ' first vertical layers where biology is active (200m depth ) ', jpkb
349      IF (lwp) WRITE(numout,*)
350      jpkbm1 = jpkb - 1
351      !
352
353
354      ! LOBSTER initialisation for GYRE : init NO3=f(density) by asklod AS Kremeur 2005-07
355      ! ----------------------
356      IF( .NOT. ln_rsttr ) THEN             ! in case of  no restart
357         tr(:,:,:,jpdet,Kmm) = 0.1 * tmask(:,:,:)
358         tr(:,:,:,jpzoo,Kmm) = 0.1 * tmask(:,:,:)
359         tr(:,:,:,jpnh4,Kmm) = 0.1 * tmask(:,:,:)
360         tr(:,:,:,jpphy,Kmm) = 0.1 * tmask(:,:,:)
361         tr(:,:,:,jpdom,Kmm) = 1.0 * tmask(:,:,:)
362         WHERE( rhd(:,:,:) <= 24.5e-3 )  ;  tr(:,:,:,jpno3,Kmm) = 2._wp * tmask(:,:,:)
363         ELSE WHERE                      ;  tr(:,:,:,jpno3,Kmm) = ( 15.55 * ( rhd(:,:,:) * 1000. ) - 380.11 ) * tmask(:,:,:)
364         END WHERE                       
365      ENDIF
366      !                        !  Namelist read
367      CALL p2z_opt_init        !  Optics parameters
368      CALL p2z_sed_init        !  sedimentation
369      CALL p2z_bio_init        !  biology
370      CALL p2z_exp_init( Kmm ) !  export
371      !
372      IF(lwp) WRITE(numout,*) 
373      IF(lwp) WRITE(numout,*) '   ==>>>   Initialization of LOBSTER tracers done'
374      IF(lwp) WRITE(numout,*) 
375      !
376   END SUBROUTINE p2z_ini
377
378   !!======================================================================
379END MODULE trcini_pisces
Note: See TracBrowser for help on using the repository browser.