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/branches/2020/dev_r13333_TOP-05_Ethe_Agrif/src/TOP/PISCES – NEMO

source: NEMO/branches/2020/dev_r13333_TOP-05_Ethe_Agrif/src/TOP/PISCES/trcini_pisces.F90 @ 13373

Last change on this file since 13373 was 13373, checked in by cetlod, 4 years ago

TOP-05_Ethe_Agrif : 1st step of changes to successfully compile, see ticket #2508

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