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.
trcbc.F90 in branches/2015/dev_r5144_CMCC5_BDY_for_TOP/NEMOGCM/NEMO/TOP_SRC – NEMO

source: branches/2015/dev_r5144_CMCC5_BDY_for_TOP/NEMOGCM/NEMO/TOP_SRC/trcbc.F90 @ 5160

Last change on this file since 5160 was 5160, checked in by lovato, 9 years ago

First implementation of BDY for TOP component, see #1441 (dev_r5144_CMCC5_BDY_for_TOP).

File size: 20.2 KB
Line 
1MODULE trcbc
2   !!======================================================================
3   !!                     ***  MODULE  trcdta  ***
4   !! TOP :  module for passive tracer boundary conditions
5   !!=====================================================================
6   !! History :  3.5 !  2014-04  (M. Vichi, T. Lovato)  Original
7   !!            3.6 !  2015-03  (T . Lovato) Revision and BDY support
8   !!----------------------------------------------------------------------
9#if defined key_top
10   !!----------------------------------------------------------------------
11   !!   'key_top'                                                TOP model
12   !!----------------------------------------------------------------------
13   !!   trc_bc       : read and time interpolated tracer Boundary Conditions
14   !!----------------------------------------------------------------------
15   USE par_trc       !  passive tracers parameters
16   USE oce_trc       !  shared variables between ocean and passive tracers
17   USE trc           !  passive tracers common variables
18   USE iom           !  I/O manager
19   USE lib_mpp       !  MPP library
20   USE fldread       !  read input fields
21#if defined key_bdy
22   USE bdy_oce, only: nb_bdy , idx_bdy, ln_coords_file, rn_time_dmp, rn_time_dmp_out
23#endif
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   trc_bc_init    ! called in trcini.F90
29   PUBLIC   trc_bc_read    ! called in trcstp.F90 or within
30
31   INTEGER  , SAVE, PUBLIC                             :: nb_trcobc    ! number of tracers with open BC
32   INTEGER  , SAVE, PUBLIC                             :: nb_trcsbc    ! number of tracers with surface BC
33   INTEGER  , SAVE, PUBLIC                             :: nb_trccbc    ! number of tracers with coastal BC
34   INTEGER  , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: n_trc_indobc ! index of tracer with OBC data
35   INTEGER  , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: n_trc_indsbc ! index of tracer with SBC data
36   INTEGER  , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: n_trc_indcbc ! index of tracer with CBC data
37   REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: rf_trsfac    ! multiplicative factor for SBC tracer values
38   TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: sf_trcsbc    ! structure of data input SBC (file informations, fields read)
39   REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: rf_trcfac    ! multiplicative factor for CBC tracer values
40   TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: sf_trccbc    ! structure of data input CBC (file informations, fields read)
41   REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:)  :: rf_trofac    ! multiplicative factor for OBCtracer values
42   TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:), TARGET  :: sf_trcobc    ! structure of data input OBC (file informations, fields read)
43   TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr   ! array of pointers to nbmap
44
45   !! * Substitutions
46#  include "domzgr_substitute.h90"
47   !!----------------------------------------------------------------------
48   !! NEMO/OPA 3.6 , NEMO Consortium (2015)
49   !! $Id$
50   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
51   !!----------------------------------------------------------------------
52CONTAINS
53
54   SUBROUTINE trc_bc_init(ntrc)
55      !!----------------------------------------------------------------------
56      !!                   ***  ROUTINE trc_bc_init  ***
57      !!                   
58      !! ** Purpose :   initialisation of passive tracer BC data
59      !!
60      !! ** Method  : - Read namtsd namelist
61      !!              - allocates passive tracer BC data structure
62      !!----------------------------------------------------------------------
63      !
64      INTEGER,INTENT(IN) :: ntrc                           ! number of tracers
65      INTEGER            :: jl, jn , ib, ibd, ii, ij, ik   ! dummy loop indices
66      INTEGER            :: ierr0, ierr1, ierr2, ierr3     ! temporary integers
67      INTEGER            :: ios                            ! Local integer output status for namelist read
68      INTEGER            :: nblen, igrd                    ! support arrays for BDY
69      CHARACTER(len=100) :: clndta, clntrc
70      !
71      CHARACTER(len=100) :: cn_dir_sbc, cn_dir_cbc, cn_dir_obc
72
73      TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_i  ! local array of namelist informations on the fields to read
74      TYPE(FLD_N), DIMENSION(jpmaxtrc) :: sn_trcobc    ! open
75      TYPE(FLD_N), DIMENSION(jpmaxtrc) :: sn_trcsbc    ! surface
76      TYPE(FLD_N), DIMENSION(jpmaxtrc) :: sn_trccbc    ! coastal
77      REAL(wp)   , DIMENSION(jpmaxtrc) :: rn_trofac    ! multiplicative factor for tracer values
78      REAL(wp)   , DIMENSION(jpmaxtrc) :: rn_trsfac    ! multiplicative factor for tracer values
79      REAL(wp)   , DIMENSION(jpmaxtrc) :: rn_trcfac    ! multiplicative factor for tracer values
80      !!
81      NAMELIST/namtrc_bc/ cn_dir_sbc, cn_dir_cbc, cn_dir_obc, sn_trcobc, rn_trofac, sn_trcsbc, rn_trsfac, sn_trccbc, rn_trcfac
82#if defined key_bdy
83      NAMELIST/namtrc_bdy/ cn_trc_dflt, cn_trc, nn_trcdmp_bdy
84#endif
85      !!----------------------------------------------------------------------
86      IF( nn_timing == 1 )  CALL timing_start('trc_bc_init')
87      !
88      IF( lwp ) THEN
89         WRITE(numout,*) ' '
90         WRITE(numout,*) 'trc_bc_init : Tracers Boundary Conditions (BC)'
91         WRITE(numout,*) '~~~~~~~~~~~ '
92      ENDIF
93      !  Initialisation and local array allocation
94      ierr0 = 0  ;  ierr1 = 0  ;  ierr2 = 0  ;  ierr3 = 0 
95      ALLOCATE( slf_i(ntrc), STAT=ierr0 )
96      IF( ierr0 > 0 ) THEN
97         CALL ctl_stop( 'trc_bc_init: unable to allocate local slf_i' )   ;   RETURN
98      ENDIF
99
100      ! Compute the number of tracers to be initialised with open, surface and boundary data
101      ALLOCATE( n_trc_indobc(ntrc), STAT=ierr0 )
102      IF( ierr0 > 0 ) THEN
103         CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indobc' )   ;   RETURN
104      ENDIF
105      nb_trcobc      = 0
106      n_trc_indobc(:) = 0
107      !
108      ALLOCATE( n_trc_indsbc(ntrc), STAT=ierr0 )
109      IF( ierr0 > 0 ) THEN
110         CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indsbc' )   ;   RETURN
111      ENDIF
112      nb_trcsbc      = 0
113      n_trc_indsbc(:) = 0
114      !
115      ALLOCATE( n_trc_indcbc(ntrc), STAT=ierr0 )
116      IF( ierr0 > 0 ) THEN
117         CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indcbc' )   ;   RETURN
118      ENDIF
119      nb_trccbc      = 0
120      n_trc_indcbc(:) = 0
121      !
122      ! Read Boundary Conditions Namelists
123      REWIND( numnat_ref )              ! Namelist namtrc_bc in reference namelist : Passive tracer data structure
124      READ  ( numnat_ref, namtrc_bc, IOSTAT = ios, ERR = 901)
125901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in reference namelist', lwp )
126
127      REWIND( numnat_cfg )              ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure
128      READ  ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 )
129902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist', lwp )
130      IF(lwm) WRITE ( numont, namtrc_bc )
131
132#if defined key_bdy
133      REWIND( numnat_ref )              ! Namelist namtrc_bc in reference namelist : Passive tracer data structure
134      READ  ( numnat_ref, namtrc_bdy, IOSTAT = ios, ERR = 903)
135903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist', lwp )
136
137      REWIND( numnat_cfg )              ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure
138      READ  ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 )
139904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist', lwp )
140      IF(lwm) WRITE ( numont, namtrc_bdy )
141      ! setup up preliminary informations for BDY structure
142      DO jn = 1, ntrc
143         DO ib = 1, nb_bdy
144            ! Set type of obc in BDY data structure (around here we may plug user override of obc type from nml)
145            IF ( ln_trc_obc(jn) ) THEN
146               trcdta_bdy(jn,ib)%cn_obc = TRIM( cn_trc(ib) )
147            ELSE
148               trcdta_bdy(jn,ib)%cn_obc = TRIM( cn_trc_dflt(ib) )
149            ENDIF
150            ! set damping use in BDY data structure
151            trcdta_bdy(jn,ib)%dmp = .false.
152            IF(nn_trcdmp_bdy(ib) .EQ. 1 .AND. ln_trc_obc(jn) ) trcdta_bdy(jn,ib)%dmp = .true.
153            IF(nn_trcdmp_bdy(ib) .EQ. 2 ) trcdta_bdy(jn,ib)%dmp = .true.
154            IF(trcdta_bdy(jn,ib)%cn_obc == 'frs' .AND. nn_trcdmp_bdy(ib) .NE. 0 )  &
155                & CALL ctl_stop( 'Use FRS OR relaxation' )
156            IF (nn_trcdmp_bdy(ib) .LT. 0 .OR. nn_trcdmp_bdy(ib) .GT. 2)            &
157                & CALL ctl_stop( 'Not a valid option for nn_trcdmp_bdy. Allowed: 0,1,2.' )
158         ENDDO
159      ENDDO
160
161#else
162      ! Force all tracers OBC to false if bdy not used
163      ln_trc_obc = .false.
164#endif
165      ! compose BC data indexes
166      DO jn = 1, ntrc
167         IF( ln_trc_obc(jn) ) THEN
168             nb_trcobc       = nb_trcobc + 1  ; n_trc_indobc(jn) = nb_trcobc
169         ENDIF
170         IF( ln_trc_sbc(jn) ) THEN
171             nb_trcsbc       = nb_trcsbc + 1  ; n_trc_indsbc(jn) = nb_trcsbc
172         ENDIF
173         IF( ln_trc_cbc(jn) ) THEN
174             nb_trccbc       = nb_trccbc + 1  ; n_trc_indcbc(jn) = nb_trccbc
175         ENDIF
176      ENDDO
177
178      ! Print summmary of Boundary Conditions
179      IF( lwp ) THEN
180         WRITE(numout,*) ' '
181         WRITE(numout,'(a,i3)') '   Total tracers to be initialized with SURFACE BCs data:', nb_trcsbc
182         IF ( nb_trcsbc > 0 ) THEN
183            WRITE(numout,*) '   #trc        NAME        Boundary     Mult.Fact. '
184            DO jn = 1, ntrc
185               IF ( ln_trc_sbc(jn) ) WRITE(numout,9001) jn, TRIM( sn_trcsbc(jn)%clvar ), 'SBC', rn_trsfac(jn)
186            ENDDO
187         ENDIF
188         WRITE(numout,'(2a)') '   SURFACE BC data repository : ', TRIM(cn_dir_sbc)
189
190         WRITE(numout,*) ' '
191         WRITE(numout,'(a,i3)') '   Total tracers to be initialized with COASTAL BCs data:', nb_trccbc
192         IF ( nb_trccbc > 0 ) THEN
193            WRITE(numout,*) '   #trc        NAME        Boundary     Mult.Fact. '
194            DO jn = 1, ntrc
195               IF ( ln_trc_cbc(jn) ) WRITE(numout, 9001) jn, TRIM( sn_trccbc(jn)%clvar ), 'CBC', rn_trcfac(jn)
196            ENDDO
197         ENDIF
198         WRITE(numout,'(2a)') '   COASTAL BC data repository : ', TRIM(cn_dir_cbc)
199
200         WRITE(numout,*) ' '
201         WRITE(numout,'(a,i3)') '   Total tracers to be initialized with OPEN BCs data:', nb_trcobc
202#if defined key_bdy
203         IF ( nb_trcobc > 0 ) THEN
204            WRITE(numout,*) '   #trc        NAME        Boundary     Mult.Fact.   OBC Settings'
205            DO jn = 1, ntrc
206               IF ( ln_trc_obc(jn) )  WRITE(numout, 9001) jn, TRIM( sn_trcobc(jn)%clvar ), 'OBC', rn_trofac(jn), (trcdta_bdy(jn,ib)%cn_obc,ib=1,nb_bdy)
207               IF ( .NOT. ln_trc_obc(jn) )  WRITE(numout, 9002) jn, 'Set data to IC and use default condition', (trcdta_bdy(jn,ib)%cn_obc,ib=1,nb_bdy)
208            ENDDO
209            WRITE(numout,*) ' '
210            DO ib = 1, nb_bdy
211                IF (nn_trcdmp_bdy(ib) .EQ. 0) WRITE(numout,9003) '   Boundary ',ib,' -> NO damping of tracers'
212                IF (nn_trcdmp_bdy(ib) .EQ. 1) WRITE(numout,9003) '   Boundary ',ib,' -> damping ONLY for tracers with external data provided'
213                IF (nn_trcdmp_bdy(ib) .EQ. 2) WRITE(numout,9003) '   Boundary ',ib,' -> damping of ALL tracers'
214                IF (nn_trcdmp_bdy(ib) .GT. 0) THEN
215                   WRITE(numout,9003) '     USE damping parameters from nambdy for boundary ', ib,' : '
216                   WRITE(numout,'(a,f10.2,a)') '     - Inflow damping time scale  : ',rn_time_dmp(ib),' days'
217                   WRITE(numout,'(a,f10.2,a)') '     - Outflow damping time scale : ',rn_time_dmp_out(ib),' days'
218                ENDIF
219            ENDDO
220         ENDIF
221#endif
222         WRITE(numout,'(2a)') '   OPEN BC data repository : ', TRIM(cn_dir_obc)
223      ENDIF
2249001  FORMAT(2x,i5, 3x, a15, 3x, a5, 6x, e11.3, 4x, 10a13)
2259002  FORMAT(2x,i5, 3x, a41, 3x, 10a13)
2269003  FORMAT(a, i5, a)
227
228      !
229#if defined key_bdy
230      ! OPEN Lateral boundary conditions
231      IF( nb_trcobc > 0 ) THEN
232         ALLOCATE ( sf_trcobc(nb_trcobc), rf_trofac(nb_trcobc), nbmap_ptr(nb_trcobc), STAT=ierr1 )
233         IF( ierr1 > 0 ) THEN
234            CALL ctl_stop( 'trc_bc_init: unable to allocate sf_trcobc structure' )   ;   RETURN
235         ENDIF
236
237         igrd = 1                       ! Everything is at T-points here
238
239         DO jn = 1, ntrc
240            DO ib = 1, nb_bdy
241
242               nblen = idx_bdy(ib)%nblen(igrd)
243
244               IF ( ln_trc_obc(jn) ) THEN
245               ! Initialise from external data
246                  jl = n_trc_indobc(jn)
247                  slf_i(jl)    = sn_trcobc(jn)
248                  rf_trofac(jl) = rn_trofac(jn)
249                                               ALLOCATE( sf_trcobc(jl)%fnow(nblen,1,jpk)   , STAT=ierr2 )
250                  IF( sn_trcobc(jn)%ln_tint )  ALLOCATE( sf_trcobc(jl)%fdta(nblen,1,jpk,2) , STAT=ierr3 )
251                  IF( ierr2 + ierr3 > 0 ) THEN
252                    CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer OBC data arrays' )   ;   RETURN
253                  ENDIF
254                  trcdta_bdy(jn,ib)%trc => sf_trcobc(jl)%fnow(:,1,:)
255                  trcdta_bdy(jn,ib)%rn_fac = rf_trofac(jl)
256                  ! create OBC mapping array
257                  nbmap_ptr(jl)%ptr => idx_bdy(ib)%nbmap(:,igrd)
258                  nbmap_ptr(jl)%ll_unstruc = ln_coords_file(igrd)
259               ELSE
260               ! Initialise obc arrays from initial conditions
261                  ALLOCATE ( trcdta_bdy(jn,ib)%trc(nblen,jpk) )
262                  DO ibd = 1, nblen
263                     DO ik = 1, jpkm1
264                        ii = idx_bdy(ib)%nbi(ibd,igrd)
265                        ij = idx_bdy(ib)%nbj(ibd,igrd)
266                        trcdta_bdy(jn,ib)%trc(ibd,ik) = trn(ii,ij,ik,jn) * tmask(ii,ij,ik)
267                     END DO
268                  END DO
269                  trcdta_bdy(jn,ib)%rn_fac = 1._wp
270               ENDIF
271            ENDDO
272         ENDDO
273
274         CALL fld_fill( sf_trcobc, slf_i, cn_dir_obc, 'trc_bc_init', 'Passive tracer OBC data', 'namtrc_bc' )
275      ENDIF
276#endif
277      ! SURFACE Boundary conditions
278      IF( nb_trcsbc > 0 ) THEN       !  allocate only if the number of tracer to initialise is greater than zero
279         ALLOCATE( sf_trcsbc(nb_trcsbc), rf_trsfac(nb_trcsbc), STAT=ierr1 )
280         IF( ierr1 > 0 ) THEN
281            CALL ctl_stop( 'trc_bc_init: unable to allocate  sf_trcsbc structure' )   ;   RETURN
282         ENDIF
283         !
284         DO jn = 1, ntrc
285            IF( ln_trc_sbc(jn) ) THEN      ! update passive tracers arrays with input data read from file
286               jl = n_trc_indsbc(jn)
287               slf_i(jl)    = sn_trcsbc(jn)
288               rf_trsfac(jl) = rn_trsfac(jn)
289                                            ALLOCATE( sf_trcsbc(jl)%fnow(jpi,jpj,1)   , STAT=ierr2 )
290               IF( sn_trcsbc(jn)%ln_tint )  ALLOCATE( sf_trcsbc(jl)%fdta(jpi,jpj,1,2) , STAT=ierr3 )
291               IF( ierr2 + ierr3 > 0 ) THEN
292                 CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer SBC data arrays' )   ;   RETURN
293               ENDIF
294            ENDIF
295            !   
296         ENDDO
297         !                         ! fill sf_trcsbc with slf_i and control print
298         CALL fld_fill( sf_trcsbc, slf_i, cn_dir_sbc, 'trc_bc_init', 'Passive tracer SBC data', 'namtrc_bc' )
299         !
300      ENDIF
301      !
302      ! COSTAL Boundary conditions
303      IF( nb_trccbc > 0 ) THEN       !  allocate only if the number of tracer to initialise is greater than zero
304         ALLOCATE( sf_trccbc(nb_trccbc), rf_trcfac(nb_trccbc), STAT=ierr1 )
305         IF( ierr1 > 0 ) THEN
306            CALL ctl_stop( 'trc_bc_ini: unable to allocate  sf_trccbc structure' )   ;   RETURN
307         ENDIF
308         !
309         DO jn = 1, ntrc
310            IF( ln_trc_cbc(jn) ) THEN      ! update passive tracers arrays with input data read from file
311               jl = n_trc_indcbc(jn)
312               slf_i(jl)    = sn_trccbc(jn)
313               rf_trcfac(jl) = rn_trcfac(jn)
314                                            ALLOCATE( sf_trccbc(jl)%fnow(jpi,jpj,1)   , STAT=ierr2 )
315               IF( sn_trccbc(jn)%ln_tint )  ALLOCATE( sf_trccbc(jl)%fdta(jpi,jpj,1,2) , STAT=ierr3 )
316               IF( ierr2 + ierr3 > 0 ) THEN
317                 CALL ctl_stop( 'trc_bc_ini : unable to allocate passive tracer CBC data arrays' )   ;   RETURN
318               ENDIF
319            ENDIF
320            !   
321         ENDDO
322         !                         ! fill sf_trccbc with slf_i and control print
323         CALL fld_fill( sf_trccbc, slf_i, cn_dir_cbc, 'trc_bc_init', 'Passive tracer CBC data', 'namtrc_bc' )
324         !
325      ENDIF
326 
327      DEALLOCATE( slf_i )          ! deallocate local field structure
328      IF( nn_timing == 1 )  CALL timing_stop('trc_bc_init')
329
330   END SUBROUTINE trc_bc_init
331
332
333   SUBROUTINE trc_bc_read(kt, jit)
334      !!----------------------------------------------------------------------
335      !!                   ***  ROUTINE trc_bc_init  ***
336      !!
337      !! ** Purpose :  Read passive tracer Boundary Conditions data
338      !!
339      !! ** Method  :  Read BC inputs and update data structures using fldread
340      !!             
341      !!----------------------------------------------------------------------
342   
343      ! NEMO
344      USE fldread
345     
346      !! * Arguments
347      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
348      INTEGER, INTENT( in ), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option)
349      !!---------------------------------------------------------------------
350      !
351      IF( nn_timing == 1 )  CALL timing_start('trc_bc_read')
352
353      IF( kt == nit000 .AND. lwp) THEN
354         WRITE(numout,*)
355         WRITE(numout,*) 'trc_bc_read : Surface boundary conditions for passive tracers.'
356         WRITE(numout,*) '~~~~~~~~~~~ '
357      ENDIF
358
359      IF ( PRESENT(jit) ) THEN 
360
361         ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step)
362         IF( nb_trcobc > 0 ) THEN
363           if (lwp) write(numout,'(a,i5,a,i10)') '   reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt
364           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcobc, map=nbmap_ptr, kit=jit, kt_offset=+1)
365         ENDIF
366
367         ! SURFACE boundary conditions
368         IF( nb_trcsbc > 0 ) THEN
369           if (lwp) write(numout,'(a,i5,a,i10)') '   reading SBC data for ', nb_trcsbc ,' variable(s) at step ', kt
370           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcsbc, kit=jit)
371         ENDIF
372
373         ! COASTAL boundary conditions
374         IF( nb_trccbc > 0 ) THEN
375           if (lwp) write(numout,'(a,i5,a,i10)') '   reading CBC data for ', nb_trccbc ,' variable(s) at step ', kt
376           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trccbc, kit=jit)
377         ENDIF
378
379      ELSE
380
381         ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step)
382         IF( nb_trcobc > 0 ) THEN
383           if (lwp) write(numout,'(a,i5,a,i10)') '   reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt
384           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcobc, map=nbmap_ptr, kt_offset=+1)
385         ENDIF
386
387         ! SURFACE boundary conditions
388         IF( nb_trcsbc > 0 ) THEN
389           if (lwp) write(numout,'(a,i5,a,i10)') '   reading SBC data for ', nb_trcsbc ,' variable(s) at step ', kt
390           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcsbc)
391         ENDIF
392
393         ! COASTAL boundary conditions
394         IF( nb_trccbc > 0 ) THEN
395           if (lwp) write(numout,'(a,i5,a,i10)') '   reading CBC data for ', nb_trccbc ,' variable(s) at step ', kt
396           CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trccbc)
397         ENDIF
398
399      ENDIF
400
401      !
402      IF( nn_timing == 1 )  CALL timing_stop('trc_bc_read')
403      !       
404
405   END SUBROUTINE trc_bc_read
406#else
407   !!----------------------------------------------------------------------
408   !!   Dummy module                              NO 3D passive tracer data
409   !!----------------------------------------------------------------------
410CONTAINS
411
412   SUBROUTINE trc_bc_init( ntrc )        ! Empty routine
413      INTEGER,INTENT(IN) :: ntrc                           ! number of tracers
414      WRITE(*,*) 'trc_bc_init: You should not have seen this print! error?', kt
415   END SUBROUTINE trc_bc_init
416
417   SUBROUTINE trc_bc_read( kt )        ! Empty routine
418      WRITE(*,*) 'trc_bc_read: You should not have seen this print! error?', kt
419   END SUBROUTINE trc_bc_read
420#endif
421
422   !!======================================================================
423END MODULE trcbc
Note: See TracBrowser for help on using the repository browser.