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.
p4zsms.F90 in branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z – NEMO

source: branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90 @ 3496

Last change on this file since 3496 was 3496, checked in by cetlod, 12 years ago

branch:2012/dev_r3438_LOCEAN15_PISLOB: minor changes in PISCES log files, see ticket #972

File size: 23.6 KB
Line 
1MODULE p4zsms
2   !!======================================================================
3   !!                         ***  MODULE p4zsms  ***
4   !! TOP :   PISCES Source Minus Sink manager
5   !!======================================================================
6   !! History :   1.0  !  2004-03 (O. Aumont) Original code
7   !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
8   !!----------------------------------------------------------------------
9#if defined key_pisces
10   !!----------------------------------------------------------------------
11   !!   'key_pisces'                                       PISCES bio-model
12   !!----------------------------------------------------------------------
13   !!   p4zsms        :  Time loop of passive tracers sms
14   !!----------------------------------------------------------------------
15   USE oce_trc         !  shared variables between ocean and passive tracers
16   USE trc             !  passive tracers common variables
17   USE trcdta
18   USE sms_pisces      !  PISCES Source Minus Sink variables
19   USE p4zbio          !  Biological model
20   USE p4zche          !  Chemical model
21   USE p4zlys          !  Calcite saturation
22   USE p4zflx          !  Gas exchange
23   USE p4zsbc          !  External source of nutrients
24   USE p4zsed          !  Sedimentation
25   USE p4zint          !  time interpolation
26   USE iom             !  I/O manager
27   USE trdmod_oce      !  Ocean trends variables
28   USE trdmod_trc      !  TOP trends variables
29   USE sedmodel        !  Sediment model
30   USE prtctl_trc      !  print control for debugging
31
32   IMPLICIT NONE
33   PRIVATE
34
35   PUBLIC   p4z_sms_init    ! called in p4zsms.F90
36   PUBLIC   p4z_sms    ! called in p4zsms.F90
37
38   LOGICAL ::  ln_check_mass = .false.       !: Flag to check mass conservation
39   REAL(wp) :: alkbudget, no3budget, silbudget, ferbudget
40   INTEGER ::  numco2, numnut  !: logical unit for co2 budget
41
42   !!----------------------------------------------------------------------
43   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
44   !! $Id: p4zsms.F90 3320 2012-03-05 16:37:52Z cetlod $
45   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
46   !!----------------------------------------------------------------------
47
48CONTAINS
49
50   SUBROUTINE p4z_sms( kt )
51      !!---------------------------------------------------------------------
52      !!                     ***  ROUTINE p4z_sms  ***
53      !!
54      !! ** Purpose :   Managment of the call to Biological sources and sinks
55      !!              routines of PISCES bio-model
56      !!
57      !! ** Method  : - at each new day ...
58      !!              - several calls of bio and sed ???
59      !!              - ...
60      !!---------------------------------------------------------------------
61      !
62      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index     
63      !!
64      INTEGER ::   jnt, jn, jl
65      CHARACTER (len=25) :: charout
66      REAL(wp), POINTER, DIMENSION(:,:,:,:)  :: ztrdpis
67      !!---------------------------------------------------------------------
68      !
69      IF( nn_timing == 1 )  CALL timing_start('p4z_sms')
70      !
71      IF( l_trdtrc )  THEN
72         CALL wrk_alloc( jpi, jpj, jpk, jp_pisces, ztrdpis ) 
73         DO jn = 1, jp_pisces
74            jl = jn + jp_pcs0 - 1
75            ztrdpis(:,:,:,jn) = trn(:,:,:,jl)
76         ENDDO
77      ENDIF
78      !
79      IF( ln_rsttr .AND. kt == nittrc000 )                         CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields
80      IF( ln_rsttr  .AND. ln_pisclo )                              CALL p4z_clo            ! damping on closed seas
81      IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 )   CALL p4z_dmp( kt )      ! Relaxation of some tracers
82      !
83      IF( ndayflxtr /= nday_year ) THEN      ! New days
84         !
85         ndayflxtr = nday_year
86
87         IF(lwp) write(numout,*)
88         IF(lwp) write(numout,*) ' New chemical constants and various rates for biogeochemistry at new day : ', nday_year
89         IF(lwp) write(numout,*) '~~~~~~'
90
91         CALL p4z_che              ! computation of chemical constants
92         CALL p4z_int( kt )        ! computation of various rates for biogeochemistry
93         !
94      ENDIF
95
96      IF( ll_sbc ) CALL p4z_sbc( kt )   ! external sources of nutrients
97
98      DO jnt = 1, nrdttrc          ! Potential time splitting if requested
99         !
100         CALL p4z_bio (kt, jnt)    ! Biology
101         CALL p4z_sed (kt, jnt)    ! Sedimentation
102         !
103         DO jn = jp_pcs0, jp_pcs1
104            trb(:,:,:,jn) = trn(:,:,:,jn)
105         ENDDO
106         !
107      END DO
108
109      IF( l_trdtrc )  THEN
110         DO jn = 1, jp_pisces
111            jl = jn + jp_pcs0 - 1
112            ztrdpis(:,:,:,jn) = ( ztrdpis(:,:,:,jn) - trn(:,:,:,jl) ) * rfact2r
113         ENDDO
114      ENDIF
115
116      CALL p4z_lys( kt )             ! Compute CaCO3 saturation
117      CALL p4z_flx( kt )             ! Compute surface fluxes
118
119      DO jn = jp_pcs0, jp_pcs1
120        CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. )
121        CALL lbc_lnk( trb(:,:,:,jn), 'T', 1. )
122        CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. )
123      END DO
124      !
125      IF( lk_sed ) THEN 
126         !
127         CALL sed_model( kt )     !  Main program of Sediment model
128         !
129         DO jn = jp_pcs0, jp_pcs1
130           CALL lbc_lnk( trn(:,:,:,jn), 'T', 1. )
131         END DO
132         !
133      ENDIF
134      !
135      IF( lrst_trc )  CALL p4z_rst( kt, 'WRITE' )  !* Write PISCES informations in restart file
136      !
137      IF( l_trdtrc ) THEN
138         DO jn = 1, jp_pisces
139            jl = jn + jp_pcs0 - 1
140             ztrdpis(:,:,:,jn) = ztrdpis(:,:,:,jn) + tra(:,:,:,jl)
141             CALL trd_mod_trc( ztrdpis(:,:,:,jn), jn, jptra_trd_sms, kt )   ! save trends
142          END DO
143          CALL wrk_dealloc( jpi, jpj, jpk, jp_pisces, ztrdpis ) 
144      END IF
145      !
146      CALL p4z_chk_mass( kt ) ! Mass conservation checking
147
148      IF( nn_timing == 1 )  CALL timing_stop('p4z_sms')
149      !
150      !
151   END SUBROUTINE p4z_sms
152
153   SUBROUTINE p4z_sms_init
154      !!----------------------------------------------------------------------
155      !!                     ***  p4z_sms_init  *** 
156      !!
157      !! ** Purpose :   read PISCES namelist
158      !!
159      !! ** input   :   file 'namelist.trc.s' containing the following
160      !!             namelist: natext, natbio, natsms
161      !!                       natkriest ("key_kriest")
162      !!----------------------------------------------------------------------
163      NAMELIST/nampisbio/ nrdttrc, wsbio, xkmort, ferat3, wsbio2, niter1max, niter2max
164#if defined key_kriest
165      NAMELIST/nampiskrp/ xkr_eta, xkr_zeta, xkr_ncontent, xkr_mass_min, xkr_mass_max
166#endif
167      NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp, ln_pisclo
168
169      REWIND( numnatp )
170      READ  ( numnatp, nampisbio )
171
172      IF(lwp) THEN                         ! control print
173         WRITE(numout,*) ' Namelist : nampisbio'
174         WRITE(numout,*) '    frequence pour la biologie                nrdttrc   =', nrdttrc
175         WRITE(numout,*) '    POC sinking speed                         wsbio     =', wsbio
176         WRITE(numout,*) '    half saturation constant for mortality    xkmort    =', xkmort
177         WRITE(numout,*) '    Fe/C in zooplankton                       ferat3    =', ferat3
178         WRITE(numout,*) '    Big particles sinking speed               wsbio2    =', wsbio2
179         WRITE(numout,*) '    Maximum number of iterations for POC      niter1max =', niter1max
180         WRITE(numout,*) '    Maximum number of iterations for GOC      niter2max =', niter2max
181      ENDIF
182
183#if defined key_kriest
184
185      !                               ! nampiskrp : kriest parameters
186      !                               ! -----------------------------
187      xkr_eta      = 0.62
188      xkr_zeta     = 1.62
189      xkr_ncontent = 5.7E-6
190      xkr_mass_min = 0.0002
191      xkr_mass_max = 1.
192
193      REWIND( numnatp )                     ! read natkriest
194      READ  ( numnatp, nampiskrp )
195
196      IF(lwp) THEN
197         WRITE(numout,*)
198         WRITE(numout,*) ' Namelist : nampiskrp'
199         WRITE(numout,*) '    Sinking  exponent                        xkr_eta      = ', xkr_eta
200         WRITE(numout,*) '    N content exponent                       xkr_zeta     = ', xkr_zeta
201         WRITE(numout,*) '    N content factor                         xkr_ncontent = ', xkr_ncontent
202         WRITE(numout,*) '    Minimum mass for Aggregates              xkr_mass_min = ', xkr_mass_min
203         WRITE(numout,*) '    Maximum mass for Aggregates              xkr_mass_max = ', xkr_mass_max
204         WRITE(numout,*)
205     ENDIF
206
207
208     ! Computation of some variables
209     xkr_massp = xkr_ncontent * 7.625 * xkr_mass_min**xkr_zeta
210
211#endif
212
213      REWIND( numnatp )
214      READ  ( numnatp, nampisdmp )
215
216      IF(lwp) THEN                         ! control print
217         WRITE(numout,*)
218         WRITE(numout,*) ' Namelist : nampisdmp'
219         WRITE(numout,*) '    Relaxation of tracer to glodap mean value             ln_pisdmp      =', ln_pisdmp
220         WRITE(numout,*) '    Frequency of Relaxation                               nn_pisdmp      =', nn_pisdmp
221         WRITE(numout,*) '    Restoring of tracer to initial value  on closed seas  ln_pisclo      =', ln_pisclo
222         WRITE(numout,*) ' '
223      ENDIF
224
225   END SUBROUTINE p4z_sms_init
226
227   SUBROUTINE p4z_rst( kt, cdrw )
228      !!---------------------------------------------------------------------
229      !!                   ***  ROUTINE p4z_rst  ***
230      !!
231      !!  ** Purpose : Read or write variables in restart file:
232      !!
233      !!  WRITE(READ) mode:
234      !!       kt        : number of time step since the begining of the experiment at the
235      !!                   end of the current(previous) run
236      !!---------------------------------------------------------------------
237      INTEGER         , INTENT(in) ::   kt         ! ocean time-step
238      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
239      !
240      INTEGER  ::  ji, jj, jk
241      REAL(wp) ::  zcaralk, zbicarb, zco3
242      REAL(wp) ::  ztmas, ztmas1
243      !!---------------------------------------------------------------------
244
245      IF( TRIM(cdrw) == 'READ' ) THEN
246         !
247         IF(lwp) WRITE(numout,*)
248         IF(lwp) WRITE(numout,*) ' p4z_rst : Read specific variables from pisces model '
249         IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
250         !
251         IF( iom_varid( numrtr, 'PH', ldstop = .FALSE. ) > 0 ) THEN
252            CALL iom_get( numrtr, jpdom_autoglo, 'PH' , hi(:,:,:)  )
253         ELSE
254!            hi(:,:,:) = 1.e-9
255            ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???)
256            ! --------------------------------------------------------
257            DO jk = 1, jpk
258               DO jj = 1, jpj
259                  DO ji = 1, jpi
260                     ztmas   = tmask(ji,jj,jk)
261                     ztmas1  = 1. - tmask(ji,jj,jk)
262                     zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  )
263                     zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1
264                     zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )
265                     hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1
266                  END DO
267               END DO
268            END DO
269         ENDIF
270         CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:) )
271         IF( iom_varid( numrtr, 'Silicamax', ldstop = .FALSE. ) > 0 ) THEN
272            CALL iom_get( numrtr, jpdom_autoglo, 'Silicamax' , xksimax(:,:)  )
273         ELSE
274            xksimax(:,:) = xksi(:,:)
275         ENDIF
276         !
277      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
278         IF( kt == nitrst ) THEN
279            IF(lwp) WRITE(numout,*)
280            IF(lwp) WRITE(numout,*) 'p4z_rst : write pisces restart file  kt =', kt
281            IF(lwp) WRITE(numout,*) '~~~~~~~'
282         ENDIF
283         CALL iom_rstput( kt, nitrst, numrtw, 'PH', hi(:,:,:) )
284         CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) )
285         CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) )
286      ENDIF
287      !
288   END SUBROUTINE p4z_rst
289
290   SUBROUTINE p4z_dmp( kt )
291      !!----------------------------------------------------------------------
292      !!                    ***  p4z_dmp  ***
293      !!
294      !! ** purpose  : Relaxation of some tracers
295      !!----------------------------------------------------------------------
296      !
297      INTEGER, INTENT( in )  ::     kt ! time step
298      !
299      REAL(wp) ::  alkmean = 2426.     ! mean value of alkalinity ( Glodap ; for Goyet 2391. )
300      REAL(wp) ::  po4mean = 2.165     ! mean value of phosphates
301      REAL(wp) ::  no3mean = 30.90     ! mean value of nitrate
302      REAL(wp) ::  silmean = 91.51     ! mean value of silicate
303      !
304      REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum
305      !!---------------------------------------------------------------------
306
307
308      IF(lwp)  WRITE(numout,*)
309      IF(lwp)  WRITE(numout,*) ' p4z_dmp : Relaxation of nutrients at time-step kt = ', kt
310      IF(lwp)  WRITE(numout,*)
311
312      IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN      ! ORCA condiguration (not 1D) !
313         !                                                    ! --------------------------- !
314         ! set total alkalinity, phosphate, nitrate & silicate
315         zarea          = 1._wp / glob_sum( cvol(:,:,:) ) * 1e6             
316
317         zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:)  ) * zarea
318         zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:)  ) * zarea * po4r
319         zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:)  ) * zarea * rno3
320         zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:)  ) * zarea
321 
322         IF(lwp) WRITE(numout,*) '       TALK mean : ', zalksum
323         trn(:,:,:,jptal) = trn(:,:,:,jptal) * alkmean / zalksum
324
325         IF(lwp) WRITE(numout,*) '       PO4  mean : ', zpo4sum
326         trn(:,:,:,jppo4) = trn(:,:,:,jppo4) * po4mean / zpo4sum
327
328         IF(lwp) WRITE(numout,*) '       NO3  mean : ', zno3sum
329         trn(:,:,:,jpno3) = trn(:,:,:,jpno3) * no3mean / zno3sum
330
331         IF(lwp) WRITE(numout,*) '       SiO3 mean : ', zsilsum
332         trn(:,:,:,jpsil) = MIN( 400.e-6,trn(:,:,:,jpsil) * silmean / zsilsum )
333         !
334      ENDIF
335
336   END SUBROUTINE p4z_dmp
337
338
339   SUBROUTINE p4z_chk_mass( kt )
340      !!----------------------------------------------------------------------
341      !!                  ***  ROUTINE p4z_chk_mass  ***
342      !!
343      !! ** Purpose :  Mass conservation check
344      !!
345      !!---------------------------------------------------------------------
346      !
347      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index     
348      !!
349      NAMELIST/nampismass/ ln_check_mass
350      !!---------------------------------------------------------------------
351
352      IF( kt == nittrc000 ) THEN
353         REWIND( numnatp )       
354         READ  ( numnatp, nampismass )
355         IF(lwp) THEN                         ! control print
356            WRITE(numout,*) ' '
357            WRITE(numout,*) ' Namelist parameter for mass conservation checking'
358            WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
359            WRITE(numout,*) '    Flag to check mass conservation of NO3/Si/TALK ln_check_mass = ', ln_check_mass
360         ENDIF
361
362         IF( ln_check_mass .AND. lwp) THEN      !   Open budget file of NO3, ALK, Si, Fer
363            CALL ctl_opn( numco2, 'carbon.budget'  , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
364            CALL ctl_opn( numnut, 'nutrient.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
365         ENDIF
366      ENDIF
367
368      IF( ln_check_mass .AND. kt == nitend ) THEN      !   Compute the budget of NO3, ALK, Si, Fer
369         no3budget = glob_sum( (   trn(:,:,:,jpno3) + trn(:,:,:,jpnh4)  &
370            &                     + trn(:,:,:,jpphy) + trn(:,:,:,jpdia)  &
371            &                     + trn(:,:,:,jpzoo) + trn(:,:,:,jpmes)  &
372#if ! defined key_kriest
373            &                     + trn(:,:,:,jppoc) + trn(:,:,:,jpgoc)  &
374#else
375            &                     + trn(:,:,:,jppoc)                     &
376#endif
377            &                     + trn(:,:,:,jpdoc)                     ) * cvol(:,:,:)  ) 
378         !
379         silbudget = glob_sum( (   trn(:,:,:,jpsil) + trn(:,:,:,jpgsi)  &
380            &                     + trn(:,:,:,jpdsi)                     ) * cvol(:,:,:)  )
381         !
382         alkbudget = glob_sum( (   trn(:,:,:,jpno3) * rno3              &
383            &                     + trn(:,:,:,jptal)                     &
384            &                     + trn(:,:,:,jpcal) * 2.                ) * cvol(:,:,:)  )
385         !
386         ferbudget = glob_sum( (   trn(:,:,:,jpfer) + trn(:,:,:,jpnfe)  &
387            &                     + trn(:,:,:,jpdfe) + trn(:,:,:,jpbfe)  &
388            &                     + trn(:,:,:,jpsfe) +                   &
389            &                     + trn(:,:,:,jpzoo)                     &
390            &                     + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  )
391
392         !
393         t_atm_co2_flx  = t_atm_co2_flx / glob_sum( e1e2t(:,:) )
394         t_oce_co2_flx  = t_oce_co2_flx         * 12. / 1.e15 * (-1 )
395         tpp            = tpp           * 1000. * 12. / 1.E15
396         t_oce_co2_exp  = t_oce_co2_exp * 1000. * 12. / 1.E15
397         !
398         no3budget = no3budget / areatot
399         silbudget = silbudget / areatot
400         alkbudget = alkbudget / areatot
401         ferbudget = ferbudget / areatot
402         !
403         IF(lwp) THEN
404            WRITE(numco2,9000) ndastp, t_atm_co2_flx, t_oce_co2_flx, tpp, t_oce_co2_exp
405            WRITE(numnut,9500) ndastp, alkbudget, no3budget, silbudget, ferbudget
406         ENDIF
407         !
408      ENDIF
409       !
410 9000  FORMAT(i8,f10.5,e18.10,f10.5,f10.5)
411 9500  FORMAT(i8,4e18.10)     
412       !
413   END SUBROUTINE p4z_chk_mass
414
415   SUBROUTINE p4z_clo   
416      !!---------------------------------------------------------------------
417      !!                  ***  ROUTINE p4z_clo  ***
418      !!
419      !! ** Purpose :   Closed sea domain initialization
420      !!
421      !! ** Method  :   if a closed sea is located only in a model grid point
422      !!                we restore to initial data
423      !!
424      !! ** Action  :   ictsi1(), ictsj1() : south-west closed sea limits (i,j)
425      !!                ictsi2(), ictsj2() : north-east Closed sea limits (i,j)
426      !!----------------------------------------------------------------------
427      INTEGER, PARAMETER           ::   npicts   = 4        ! number of closed sea
428      INTEGER, DIMENSION(npicts)   ::   ictsi1, ictsj1      ! south-west closed sea limits (i,j)
429      INTEGER, DIMENSION(npicts)   ::   ictsi2, ictsj2      ! north-east closed sea limits (i,j)
430      INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indices
431      INTEGER :: ierr                                       ! local integer
432      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta     ! 4D  workspace
433      !!----------------------------------------------------------------------
434
435      IF(lwp) WRITE(numout,*)
436      IF(lwp) WRITE(numout,*)' p4z_clo : closed seas '
437      IF(lwp) WRITE(numout,*)'~~~~~~~'
438
439      ! initial values
440      ictsi1(:) = 1  ;  ictsi2(:) = 1 
441      ictsj1(:) = 1  ;  ictsj2(:) = 1 
442
443      ! set the closed seas (in data domain indices)
444      ! -------------------
445
446      IF( cp_cfg == "orca" ) THEN
447         !
448         SELECT CASE ( jp_cfg )
449         !                                           ! =======================
450         CASE ( 2 )                                  !  ORCA_R2 configuration
451            !                                        ! =======================
452            !                                            ! Caspian Sea
453            ictsi1(1)   =  11  ;  ictsj1(1)   = 103
454            ictsi2(1)   =  17  ;  ictsj2(1)   = 112
455            !                                            ! Great North American Lakes
456            ictsi1(2)   =  97  ;  ictsj1(2)   = 107
457            ictsi2(2)   = 103  ;  ictsj2(2)   = 111
458            !                                            ! Black Sea 1 : west part of the Black Sea
459            ictsi1(3)   = 174  ; ictsj1(3)   = 107
460            ictsi2(3)   = 181  ; ictsj2(3)   = 112
461            !                                            ! Black Sea 2 : est part of the Black Sea
462            ictsi1(4)   =   2  ;  ictsj1(4)   = 107
463            ictsi2(4)   =   6  ;  ictsj2(4)   = 112
464            !                                        ! =======================
465         CASE ( 4 )                                  !  ORCA_R4 configuration
466            !                                        ! =======================
467            !                                            ! Caspian Sea
468            ictsi1(1)   =  4  ;  ictsj1(1)   = 53
469            ictsi2(1)   =  4  ;  ictsj2(1)   = 56
470            !                                            ! Great North American Lakes
471            ictsi1(2)   = 49  ;  ictsj1(2)   = 55
472            ictsi2(2)   = 51  ;  ictsj2(2)   = 56
473            !                                            ! Black Sea
474            ictsi1(3)   = 88  ;  ictsj1(3)   = 55
475            ictsi2(3)   = 91  ;  ictsj2(3)   = 56
476            !                                            ! Baltic Sea
477            ictsi1(4)   = 75  ;  ictsj1(4)   = 59
478            ictsi2(4)   = 76  ;  ictsj2(4)   = 61
479            !                                        ! =======================
480            !                                        ! =======================
481         CASE ( 025 )                                ! ORCA_R025 configuration
482            !                                        ! =======================
483                                                     ! Caspian + Aral sea
484            ictsi1(1)   = 1330 ; ictsj1(1)   = 645
485            ictsi2(1)   = 1400 ; ictsj2(1)   = 795
486            !                                        ! Azov Sea
487            ictsi1(2)   = 1284 ; ictsj1(2)   = 722
488            ictsi2(2)   = 1304 ; ictsj2(2)   = 747
489            !
490         END SELECT
491         !
492      ENDIF
493
494      ! convert the position in local domain indices
495      ! --------------------------------------------
496      DO jc = 1, npicts 
497         ictsi1(jc)   = mi0( ictsi1(jc) )
498         ictsj1(jc)   = mj0( ictsj1(jc) )
499
500         ictsi2(jc)   = mi1( ictsi2(jc) )
501         ictsj2(jc)   = mj1( ictsj2(jc) )
502      END DO
503
504      ! Restore close seas values to initial data
505      IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping
506         !
507         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )   ! Memory allocation
508         !
509         CALL trc_dta( nittrc000, ztrcdta )   ! read tracer data at nittrc000
510         !
511         DO jn = 1, jptra
512            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
513                jl = n_trc_index(jn)
514                DO jc = 1, npicts
515                   DO jk = 1, jpkm1
516                      DO jj = ictsj1(jc), ictsj2(jc)
517                         DO ji = ictsi1(jc), ictsi2(jc)
518                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk)
519                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
520                         ENDDO
521                      ENDDO
522                   ENDDO
523                ENDDO
524             ENDIF
525          ENDDO
526          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
527      ENDIF
528      !
529   END SUBROUTINE p4z_clo
530#else
531   !!======================================================================
532   !!  Dummy module :                                   No PISCES bio-model
533   !!======================================================================
534CONTAINS
535   SUBROUTINE p4z_sms( kt )                   ! Empty routine
536      INTEGER, INTENT( in ) ::   kt
537      WRITE(*,*) 'p4z_sms: You should not have seen this print! error?', kt
538   END SUBROUTINE p4z_sms
539#endif 
540
541   !!======================================================================
542END MODULE p4zsms 
Note: See TracBrowser for help on using the repository browser.