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 branches/CNRS/dev_r8832_PISCO/NEMOGCM/NEMO/TOP_SRC/PISCES – NEMO

source: branches/CNRS/dev_r8832_PISCO/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90 @ 9450

Last change on this file since 9450 was 9450, checked in by aumont, 6 years ago

debug PISCES code

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