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.
Changeset 7646 for trunk/NEMOGCM/NEMO/TOP_SRC/trcbc.F90 – NEMO

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/trcbc.F90

    r6140 r7646  
    44   !! TOP :  module for passive tracer boundary conditions 
    55   !!===================================================================== 
    6    !! History :  3.5 !  2014-04  (M. Vichi, T. Lovato)  Original 
    7    !!            3.6 !  2015-03  (T . Lovato) Revision and BDY support 
     6   !! History :  3.5 !  2014 (M. Vichi, T. Lovato)  Original 
     7   !!            3.6 !  2015 (T . Lovato) Revision and BDY support 
     8   !!            4.0 !  2016 (T . Lovato) Include application of sbc and cbc 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_top 
     
    1112   !!   'key_top'                                                TOP model  
    1213   !!---------------------------------------------------------------------- 
    13    !!   trc_bc       : read and time interpolated tracer Boundary Conditions 
     14   !!   trc_bc       :  Apply tracer Boundary Conditions 
    1415   !!---------------------------------------------------------------------- 
    1516   USE par_trc       !  passive tracers parameters 
     
    1920   USE lib_mpp       !  MPP library 
    2021   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 
     22   USE bdy_oce,  ONLY: ln_bdy, nb_bdy , idx_bdy, ln_coords_file, rn_time_dmp, rn_time_dmp_out 
    2423 
    2524   IMPLICIT NONE 
    2625   PRIVATE 
    2726 
    28    PUBLIC   trc_bc_init    ! called in trcini.F90  
    29    PUBLIC   trc_bc_read    ! called in trcstp.F90 or within 
     27   PUBLIC   trc_bc         ! called in trcstp.F90 or within TOP modules 
     28   PUBLIC   trc_bc_ini     ! called in trcini.F90  
    3029 
    3130   INTEGER  , SAVE, PUBLIC                             :: nb_trcobc    ! number of tracers with open BC 
     
    4342   TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr   ! array of pointers to nbmap 
    4443 
    45    !!---------------------------------------------------------------------- 
    46    !! NEMO/OPA 3.6 , NEMO Consortium (2015) 
     44   !! * Substitutions 
     45#  include "vectopt_loop_substitute.h90" 
     46   !!---------------------------------------------------------------------- 
     47   !! NEMO/TOP 4.0 , NEMO Consortium (2016) 
    4748   !! $Id$ 
    4849   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    5051CONTAINS 
    5152 
    52    SUBROUTINE trc_bc_init( ntrc ) 
     53   SUBROUTINE trc_bc_ini( ntrc ) 
    5354      !!---------------------------------------------------------------------- 
    54       !!                   ***  ROUTINE trc_bc_init  *** 
     55      !!                   ***  ROUTINE trc_bc_ini  *** 
    5556      !!                     
    5657      !! ** Purpose :   initialisation of passive tracer BC data  
     
    7778      REAL(wp)   , DIMENSION(jpmaxtrc) :: rn_trcfac    ! multiplicative factor for tracer values 
    7879      !! 
    79       NAMELIST/namtrc_bc/ cn_dir_sbc, cn_dir_cbc, cn_dir_obc, sn_trcobc, rn_trofac, sn_trcsbc, rn_trsfac, sn_trccbc, rn_trcfac 
    80 #if defined key_bdy 
     80      NAMELIST/namtrc_bc/ cn_dir_obc, sn_trcobc, rn_trofac, cn_dir_sbc, sn_trcsbc, rn_trsfac, &  
     81                        & cn_dir_cbc, sn_trccbc, rn_trcfac, ln_rnf_ctl, rn_bc_time 
    8182      NAMELIST/namtrc_bdy/ cn_trc_dflt, cn_trc, nn_trcdmp_bdy 
    82 #endif 
     83 
    8384      !!---------------------------------------------------------------------- 
    84       IF( nn_timing == 1 )  CALL timing_start('trc_bc_init') 
     85      IF( nn_timing == 1 )  CALL timing_start('trc_bc_ini') 
    8586      ! 
    8687      IF( lwp ) THEN 
    8788         WRITE(numout,*) ' ' 
    88          WRITE(numout,*) 'trc_bc_init : Tracers Boundary Conditions (BC)' 
     89         WRITE(numout,*) 'trc_bc_ini : Tracers Boundary Conditions (BC)' 
    8990         WRITE(numout,*) '~~~~~~~~~~~ ' 
    9091      ENDIF 
     
    9394      ALLOCATE( slf_i(ntrc), STAT=ierr0 ) 
    9495      IF( ierr0 > 0 ) THEN 
    95          CALL ctl_stop( 'trc_bc_init: unable to allocate local slf_i' )   ;   RETURN 
     96         CALL ctl_stop( 'trc_bc_ini: unable to allocate local slf_i' )   ;   RETURN 
    9697      ENDIF 
    9798 
     
    99100      ALLOCATE( n_trc_indobc(ntrc), STAT=ierr0 ) 
    100101      IF( ierr0 > 0 ) THEN 
    101          CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indobc' )   ;   RETURN 
     102         CALL ctl_stop( 'trc_bc_ini: unable to allocate n_trc_indobc' )   ;   RETURN 
    102103      ENDIF 
    103104      nb_trcobc      = 0 
     
    106107      ALLOCATE( n_trc_indsbc(ntrc), STAT=ierr0 ) 
    107108      IF( ierr0 > 0 ) THEN 
    108          CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indsbc' )   ;   RETURN 
     109         CALL ctl_stop( 'trc_bc_ini: unable to allocate n_trc_indsbc' )   ;   RETURN 
    109110      ENDIF 
    110111      nb_trcsbc      = 0 
     
    113114      ALLOCATE( n_trc_indcbc(ntrc), STAT=ierr0 ) 
    114115      IF( ierr0 > 0 ) THEN 
    115          CALL ctl_stop( 'trc_bc_init: unable to allocate n_trc_indcbc' )   ;   RETURN 
     116         CALL ctl_stop( 'trc_bc_ini: unable to allocate n_trc_indcbc' )   ;   RETURN 
    116117      ENDIF 
    117118      nb_trccbc      = 0 
     
    128129      IF(lwm) WRITE ( numont, namtrc_bc ) 
    129130 
    130 #if defined key_bdy 
    131       REWIND( numnat_ref )              ! Namelist namtrc_bc in reference namelist : Passive tracer data structure 
    132       READ  ( numnat_ref, namtrc_bdy, IOSTAT = ios, ERR = 903) 
    133 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist', lwp ) 
    134  
    135       REWIND( numnat_cfg )              ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure 
    136       READ  ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 
    137 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist', lwp ) 
    138       IF(lwm) WRITE ( numont, namtrc_bdy ) 
    139       ! setup up preliminary informations for BDY structure 
    140       DO jn = 1, ntrc 
    141          DO ib = 1, nb_bdy 
    142             ! Set type of obc in BDY data structure (around here we may plug user override of obc type from nml) 
    143             IF ( ln_trc_obc(jn) ) THEN 
    144                trcdta_bdy(jn,ib)%cn_obc = TRIM( cn_trc(ib) ) 
    145             ELSE 
    146                trcdta_bdy(jn,ib)%cn_obc = TRIM( cn_trc_dflt(ib) ) 
    147             ENDIF 
    148             ! set damping use in BDY data structure 
    149             trcdta_bdy(jn,ib)%dmp = .false. 
    150             IF(nn_trcdmp_bdy(ib) .EQ. 1 .AND. ln_trc_obc(jn) ) trcdta_bdy(jn,ib)%dmp = .true. 
    151             IF(nn_trcdmp_bdy(ib) .EQ. 2 ) trcdta_bdy(jn,ib)%dmp = .true. 
    152             IF(trcdta_bdy(jn,ib)%cn_obc == 'frs' .AND. nn_trcdmp_bdy(ib) .NE. 0 )  & 
    153                 & CALL ctl_stop( 'Use FRS OR relaxation' ) 
    154             IF (nn_trcdmp_bdy(ib) .LT. 0 .OR. nn_trcdmp_bdy(ib) .GT. 2)            & 
    155                 & CALL ctl_stop( 'Not a valid option for nn_trcdmp_bdy. Allowed: 0,1,2.' ) 
     131      IF ( ln_bdy ) THEN 
     132         REWIND( numnat_ref )              ! Namelist namtrc_bdy in reference namelist : Passive tracer data structure 
     133         READ  ( numnat_ref, namtrc_bdy, IOSTAT = ios, ERR = 903) 
     134903      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist', lwp ) 
     135 
     136         REWIND( numnat_cfg )              ! Namelist namtrc_bdy in configuration namelist : Passive tracer data structure 
     137         READ  ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 
     138904      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist', lwp ) 
     139         IF(lwm) WRITE ( numont, namtrc_bdy ) 
     140       
     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 
    156159         ENDDO 
    157       ENDDO 
    158  
    159 #else 
    160       ! Force all tracers OBC to false if bdy not used 
    161       ln_trc_obc = .false. 
    162 #endif 
     160      ELSE 
     161         ! Force all tracers OBC to false if bdy not used 
     162         ln_trc_obc = .false. 
     163      ENDIF 
     164 
    163165      ! compose BC data indexes 
    164166      DO jn = 1, ntrc 
     
    188190         WRITE(numout,*) ' ' 
    189191         WRITE(numout,'(a,i3)') '   Total tracers to be initialized with COASTAL BCs data:', nb_trccbc 
    190          IF ( nb_trccbc > 0 ) THEN 
     192         IF( nb_trccbc > 0 ) THEN 
    191193            WRITE(numout,*) '   #trc        NAME        Boundary     Mult.Fact. ' 
    192194            DO jn = 1, ntrc 
     
    195197         ENDIF 
    196198         WRITE(numout,'(2a)') '   COASTAL BC data repository : ', TRIM(cn_dir_cbc) 
    197  
     199         IF( .NOT.ln_rnf .OR. .NOT.ln_linssh ) ln_rnf_ctl = .FALSE. 
     200         IF( ln_rnf_ctl )  WRITE(numout,'(a)') ' -> Remove runoff dilution effect on tracers with absent river load (ln_rnf_ctl = .TRUE.)'  
    198201         WRITE(numout,*) ' ' 
    199202         WRITE(numout,'(a,i3)') '   Total tracers to be initialized with OPEN BCs data:', nb_trcobc 
    200 #if defined key_bdy 
    201          IF ( nb_trcobc > 0 ) THEN 
     203 
     204         IF( ln_bdy .AND. nb_trcobc > 0 ) THEN 
    202205            WRITE(numout,*) '   #trc        NAME        Boundary     Mult.Fact.   OBC Settings' 
    203206            DO jn = 1, ntrc 
    204                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) 
    205                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) 
     207               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) 
     208               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) 
    206209            ENDDO 
    207210            WRITE(numout,*) ' ' 
    208211            DO ib = 1, nb_bdy 
    209                 IF (nn_trcdmp_bdy(ib) .EQ. 0) WRITE(numout,9003) '   Boundary ',ib,' -> NO damping of tracers' 
    210                 IF (nn_trcdmp_bdy(ib) .EQ. 1) WRITE(numout,9003) '   Boundary ',ib,' -> damping ONLY for tracers with external data provided' 
    211                 IF (nn_trcdmp_bdy(ib) .EQ. 2) WRITE(numout,9003) '   Boundary ',ib,' -> damping of ALL tracers' 
    212                 IF (nn_trcdmp_bdy(ib) .GT. 0) THEN 
     212                IF(nn_trcdmp_bdy(ib) .EQ. 0) WRITE(numout,9003) '   Boundary ',ib,' -> NO damping of tracers' 
     213                IF(nn_trcdmp_bdy(ib) .EQ. 1) WRITE(numout,9003) '   Boundary ',ib,' -> damping ONLY for tracers with external data provided' 
     214                IF(nn_trcdmp_bdy(ib) .EQ. 2) WRITE(numout,9003) '   Boundary ',ib,' -> damping of ALL tracers' 
     215                IF(nn_trcdmp_bdy(ib) .GT. 0) THEN 
    213216                   WRITE(numout,9003) '     USE damping parameters from nambdy for boundary ', ib,' : ' 
    214217                   WRITE(numout,'(a,f10.2,a)') '     - Inflow damping time scale  : ',rn_time_dmp(ib),' days' 
     
    217220            ENDDO 
    218221         ENDIF 
    219 #endif 
     222 
    220223         WRITE(numout,'(2a)') '   OPEN BC data repository : ', TRIM(cn_dir_obc) 
    221224      ENDIF 
     
    225228 
    226229      ! 
    227 #if defined key_bdy 
    228230      ! OPEN Lateral boundary conditions 
    229       IF( nb_trcobc > 0 ) THEN  
     231      IF( ln_bdy .AND. nb_trcobc > 0 ) THEN  
    230232         ALLOCATE ( sf_trcobc(nb_trcobc), rf_trofac(nb_trcobc), nbmap_ptr(nb_trcobc), STAT=ierr1 ) 
    231233         IF( ierr1 > 0 ) THEN 
    232             CALL ctl_stop( 'trc_bc_init: unable to allocate sf_trcobc structure' )   ;   RETURN 
     234            CALL ctl_stop( 'trc_bc_ini: unable to allocate sf_trcobc structure' )   ;   RETURN 
    233235         ENDIF 
    234236 
     
    248250                  IF( sn_trcobc(jn)%ln_tint )  ALLOCATE( sf_trcobc(jl)%fdta(nblen,1,jpk,2) , STAT=ierr3 ) 
    249251                  IF( ierr2 + ierr3 > 0 ) THEN 
    250                     CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer OBC data arrays' )   ;   RETURN 
     252                    CALL ctl_stop( 'trc_bc_ini : unable to allocate passive tracer OBC data arrays' )   ;   RETURN 
    251253                  ENDIF 
    252254                  trcdta_bdy(jn,ib)%trc => sf_trcobc(jl)%fnow(:,1,:) 
     
    270272         ENDDO 
    271273 
    272          CALL fld_fill( sf_trcobc, slf_i, cn_dir_obc, 'trc_bc_init', 'Passive tracer OBC data', 'namtrc_bc' ) 
    273       ENDIF 
    274 #endif 
     274         CALL fld_fill( sf_trcobc, slf_i, cn_dir_obc, 'trc_bc_ini', 'Passive tracer OBC data', 'namtrc_bc' ) 
     275      ENDIF 
     276 
    275277      ! SURFACE Boundary conditions 
    276278      IF( nb_trcsbc > 0 ) THEN       !  allocate only if the number of tracer to initialise is greater than zero 
    277279         ALLOCATE( sf_trcsbc(nb_trcsbc), rf_trsfac(nb_trcsbc), STAT=ierr1 ) 
    278280         IF( ierr1 > 0 ) THEN 
    279             CALL ctl_stop( 'trc_bc_init: unable to allocate  sf_trcsbc structure' )   ;   RETURN 
     281            CALL ctl_stop( 'trc_bc_ini: unable to allocate  sf_trcsbc structure' )   ;   RETURN 
    280282         ENDIF 
    281283         ! 
     
    288290               IF( sn_trcsbc(jn)%ln_tint )  ALLOCATE( sf_trcsbc(jl)%fdta(jpi,jpj,1,2) , STAT=ierr3 ) 
    289291               IF( ierr2 + ierr3 > 0 ) THEN 
    290                  CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer SBC data arrays' )   ;   RETURN 
     292                 CALL ctl_stop( 'trc_bc_ini : unable to allocate passive tracer SBC data arrays' )   ;   RETURN 
    291293               ENDIF 
    292294            ENDIF 
     
    294296         ENDDO 
    295297         !                         ! fill sf_trcsbc with slf_i and control print 
    296          CALL fld_fill( sf_trcsbc, slf_i, cn_dir_sbc, 'trc_bc_init', 'Passive tracer SBC data', 'namtrc_bc' ) 
     298         CALL fld_fill( sf_trcsbc, slf_i, cn_dir_sbc, 'trc_bc_ini', 'Passive tracer SBC data', 'namtrc_bc' ) 
    297299         ! 
    298300      ENDIF 
     
    319321         ENDDO 
    320322         !                         ! fill sf_trccbc with slf_i and control print 
    321          CALL fld_fill( sf_trccbc, slf_i, cn_dir_cbc, 'trc_bc_init', 'Passive tracer CBC data', 'namtrc_bc' ) 
     323         CALL fld_fill( sf_trccbc, slf_i, cn_dir_cbc, 'trc_bc_ini', 'Passive tracer CBC data', 'namtrc_bc' ) 
    322324         ! 
    323325      ENDIF 
    324326      ! 
    325327      DEALLOCATE( slf_i )          ! deallocate local field structure 
    326       IF( nn_timing == 1 )  CALL timing_stop('trc_bc_init') 
    327       ! 
    328    END SUBROUTINE trc_bc_init 
    329  
    330  
    331    SUBROUTINE trc_bc_read(kt, jit) 
     328      IF( nn_timing == 1 )  CALL timing_stop('trc_bc_ini') 
     329      ! 
     330   END SUBROUTINE trc_bc_ini 
     331 
     332 
     333   SUBROUTINE trc_bc(kt, jit) 
    332334      !!---------------------------------------------------------------------- 
    333       !!                   ***  ROUTINE trc_bc_init  *** 
     335      !!                   ***  ROUTINE trc_bc  *** 
    334336      !! 
    335       !! ** Purpose :  Read passive tracer Boundary Conditions data 
     337      !! ** Purpose :  Apply Boundary Conditions data to tracers 
    336338      !! 
    337       !! ** Method  :  Read BC inputs and update data structures using fldread 
     339      !! ** Method  :  1) Read BC inputs and update data structures using fldread 
     340      !!               2) Apply Boundary Conditions to tracers 
    338341      !!               
    339342      !!---------------------------------------------------------------------- 
     
    341344       
    342345      !! * Arguments 
    343       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     346      INTEGER, INTENT( in ) ::   kt              ! ocean time-step index 
    344347      INTEGER, INTENT( in ), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option) 
     348      !! 
     349      INTEGER  :: ji, jj, jk, jn, jl             ! Loop index 
     350      REAL(wp) :: zfact, zrnf 
    345351      !!--------------------------------------------------------------------- 
    346352      ! 
    347       IF( nn_timing == 1 )  CALL timing_start('trc_bc_read') 
     353      IF( nn_timing == 1 )  CALL timing_start('trc_bc') 
    348354 
    349355      IF( kt == nit000 .AND. lwp) THEN 
    350356         WRITE(numout,*) 
    351          WRITE(numout,*) 'trc_bc_read : Surface boundary conditions for passive tracers.' 
     357         WRITE(numout,*) 'trc_bc : Surface boundary conditions for passive tracers.' 
    352358         WRITE(numout,*) '~~~~~~~~~~~ ' 
    353359      ENDIF 
    354360 
     361      ! 1. Update Boundary conditions data 
    355362      IF ( PRESENT(jit) ) THEN  
    356363 
     
    395402      ENDIF 
    396403 
    397       ! 
    398       IF( nn_timing == 1 )  CALL timing_stop('trc_bc_read') 
    399       ! 
    400    END SUBROUTINE trc_bc_read 
     404      ! 2. Apply Boundary conditions data 
     405      !  
     406      DO jn = 1 , jptra 
     407         ! 
     408         ! Remove river dilution for tracers with absent river load 
     409         IF ( ln_rnf_ctl .AND. .NOT. ln_trc_cbc(jn) ) THEN 
     410            DO jj = 2, jpj 
     411               DO ji = fs_2, fs_jpim1 
     412                  DO jk = 1, nk_rnf(ji,jj) 
     413                     zrnf = (rnf(ji,jj) + rnf_b(ji,jj)) * 0.5_wp * r1_rau0 / h_rnf(ji,jj) 
     414                     tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn)  + (trn(ji,jj,jk,jn) * zrnf) 
     415                  ENDDO 
     416               ENDDO 
     417            ENDDO 
     418         ENDIF 
     419           
     420         ! OPEN boundary conditions: trcbdy is called in trcnxt ! 
     421 
     422         ! SURFACE boundary conditions 
     423         IF (ln_trc_sbc(jn)) THEN 
     424            jl = n_trc_indsbc(jn) 
     425            DO jj = 2, jpj 
     426               DO ji = fs_2, fs_jpim1   ! vector opt. 
     427                  zfact = 1. / ( e3t_n(ji,jj,1) * rn_bc_time ) 
     428                  tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact 
     429               END DO 
     430            END DO 
     431         END IF 
     432 
     433         ! COASTAL boundary conditions 
     434         IF ( ln_rnf .AND. ln_trc_cbc(jn)) THEN 
     435            jl = n_trc_indcbc(jn) 
     436            DO jj = 2, jpj 
     437               DO ji = fs_2, fs_jpim1   ! vector opt. 
     438                  DO jk = 1, nk_rnf(ji,jj) 
     439                     zfact = rn_rfact / ( e1e2t(ji,jj) * h_rnf(ji,jj) * rn_bc_time )  
     440                     tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact 
     441                  ENDDO 
     442               END DO 
     443            END DO 
     444         END IF 
     445         !                                                       ! =========== 
     446      END DO                                                     ! tracer loop 
     447      !                                                          ! =========== 
     448      ! 
     449      IF( nn_timing == 1 )  CALL timing_stop('trc_bc') 
     450      ! 
     451   END SUBROUTINE trc_bc 
    401452 
    402453#else 
     
    406457CONTAINS 
    407458 
    408    SUBROUTINE trc_bc_init( ntrc )        ! Empty routine 
     459   SUBROUTINE trc_bc_ini( ntrc )        ! Empty routine 
    409460      INTEGER,INTENT(IN) :: ntrc                           ! number of tracers 
    410       WRITE(*,*) 'trc_bc_init: You should not have seen this print! error?', kt 
    411    END SUBROUTINE trc_bc_init 
    412  
    413    SUBROUTINE trc_bc_read( kt )        ! Empty routine 
    414       WRITE(*,*) 'trc_bc_read: You should not have seen this print! error?', kt 
    415    END SUBROUTINE trc_bc_read 
     461      WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', kt 
     462   END SUBROUTINE trc_bc_ini 
     463 
     464   SUBROUTINE trc_bc( kt )        ! Empty routine 
     465      WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt 
     466   END SUBROUTINE trc_bc 
    416467#endif 
    417468 
Note: See TracChangeset for help on using the changeset viewer.