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_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z – NEMO

source: branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90 @ 3780

Last change on this file since 3780 was 3780, checked in by cetlod, 11 years ago

nemo_v3_5_alpha : bug correction to avoid compilation errors when using key_kriest, see ticket #1050

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