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 10963 – NEMO

Changeset 10963


Ignore:
Timestamp:
2019-05-10T16:15:43+02:00 (5 years ago)
Author:
acc
Message:

2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : Convert TOP routines in top-level TOP directory and all knock on effects of these conversions. SETTE tested.

Location:
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/MY_TRC/trcsms_my_trc.F90

    r10425 r10963  
    3232CONTAINS 
    3333 
    34    SUBROUTINE trc_sms_my_trc( kt ) 
     34   SUBROUTINE trc_sms_my_trc( kt, Kmm, Krhs ) 
    3535      !!---------------------------------------------------------------------- 
    3636      !!                     ***  trc_sms_my_trc  *** 
     
    4242      ! 
    4343      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     44      INTEGER, INTENT(in) ::   Kmm, Krhs  ! time level indices 
    4445      INTEGER ::   jn   ! dummy loop index 
    4546      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrmyt 
     
    5455      IF( l_trdtrc )  ALLOCATE( ztrmyt(jpi,jpj,jpk) ) 
    5556 
    56       CALL trc_bc ( kt )       ! tracers: surface and lateral Boundary Conditions 
     57      CALL trc_bc ( kt, Kmm, Krhs )       ! tracers: surface and lateral Boundary Conditions 
    5758 
    5859      ! add here the call to BGC model 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/P4Z/p4zsms.F90

    r10425 r10963  
    4646CONTAINS 
    4747 
    48    SUBROUTINE p4z_sms( kt ) 
     48   SUBROUTINE p4z_sms( kt, Kmm ) 
    4949      !!--------------------------------------------------------------------- 
    5050      !!                     ***  ROUTINE p4z_sms  *** 
     
    5959      ! 
    6060      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     61      INTEGER, INTENT( in ) ::   Kmm     ! time level index 
    6162      !! 
    6263      INTEGER ::   ji, jj, jk, jnt, jn, jl 
     
    155156      IF( ln_sediment ) THEN  
    156157         ! 
    157          CALL sed_model( kt )     !  Main program of Sediment model 
     158         CALL sed_model( kt, Kmm )     !  Main program of Sediment model 
    158159         ! 
    159160         IF( ln_top_euler ) THEN 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/sedmodel.F90

    r10222 r10963  
    1616CONTAINS 
    1717 
    18    SUBROUTINE sed_model ( kt ) 
     18   SUBROUTINE sed_model ( kt, Kmm ) 
    1919      !!--------------------------------------------------------------------- 
    2020      !!                  ***  ROUTINE sed_model  *** 
     
    3030      !!---------------------------------------------------------------------- 
    3131      INTEGER, INTENT(in) ::   kt       ! number of iteration 
     32      INTEGER, INTENT(in) ::   Kmm      ! time level indices 
    3233 
    3334 
     
    3536 
    3637      IF( kt == nittrc000 ) CALL sed_initrc       ! Initialization of sediment model 
    37                             CALL sed_stp( kt )  ! Time stepping of Sediment model 
     38                            CALL sed_stp( kt, Kmm )  ! Time stepping of Sediment model 
    3839 
    3940      IF( ln_timing )  CALL timing_stop('sed_model') 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/sedstp.F90

    r10222 r10963  
    2929CONTAINS 
    3030 
    31    SUBROUTINE sed_stp ( kt ) 
     31   SUBROUTINE sed_stp ( kt, Kmm ) 
    3232      !!--------------------------------------------------------------------- 
    3333      !!                  ***  ROUTINE sed_stp  *** 
     
    4545      !!---------------------------------------------------------------------- 
    4646      INTEGER, INTENT(in) ::   kt       ! number of iteration 
     47      INTEGER, INTENT(in) ::   Kmm      ! time level indices 
    4748      INTEGER :: ji,jk,js,jn,jw 
    4849      !!---------------------------------------------------------------------- 
     
    5253      IF( lrst_sed )            CALL sed_rst_cal  ( kt, 'WRITE' )   ! calenda 
    5354 
    54       IF(ln_sediment_offline)   CALL trc_dmp_sed  ( kt ) 
     55      IF(ln_sediment_offline)   CALL trc_dmp_sed  ( kt, Kmm ) 
    5556 
    5657      dtsed  = r2dttrc 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/SED/trcdmp_sed.F90

    r10225 r10963  
    5454 
    5555 
    56    SUBROUTINE trc_dmp_sed( kt ) 
     56   SUBROUTINE trc_dmp_sed( kt, Kmm ) 
    5757      !!---------------------------------------------------------------------- 
    5858      !!                   ***  ROUTINE trc_dmp_sed  *** 
     
    7474      !!---------------------------------------------------------------------- 
    7575      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     76      INTEGER, INTENT(in) ::   Kmm  ! time level index 
    7677      ! 
    7778      INTEGER ::   ji, jj, jk, jn, jl, ikt   ! dummy loop indices 
     
    9091               ! 
    9192               jl = n_trc_index(jn)  
    92                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     93               CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    9394               ! 
    9495               DO jj = 1, jpj 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/PISCES/trcsms_pisces.F90

    r10068 r10963  
    2525CONTAINS 
    2626 
    27    SUBROUTINE trc_sms_pisces( kt ) 
     27   SUBROUTINE trc_sms_pisces( kt, Kmm ) 
    2828      !!--------------------------------------------------------------------- 
    2929      !!                     ***  ROUTINE trc_sms_pisces  *** 
     
    3535      ! 
    3636      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     37      INTEGER, INTENT( in ) ::   Kmm     ! time level index 
    3738      !!--------------------------------------------------------------------- 
    3839      ! 
    39       IF( ln_p4z .OR. ln_p5z ) THEN  ;   CALL p4z_sms( kt )   !  PISCES 
     40      IF( ln_p4z .OR. ln_p5z ) THEN  ;   CALL p4z_sms( kt, Kmm )   !  PISCES 
    4041      ELSE                           ;   CALL p2z_sms( kt )   !  LOBSTER 
    4142      ENDIF 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcdmp.F90

    r10946 r10963  
    106106               ! 
    107107               jl = n_trc_index(jn)  
    108                CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     108               CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    109109               ! 
    110110               SELECT CASE ( nn_zdmp_tr ) 
     
    225225 
    226226 
    227    SUBROUTINE trc_dmp_clo( kt ) 
     227   SUBROUTINE trc_dmp_clo( kt, Kmm ) 
    228228      !!--------------------------------------------------------------------- 
    229229      !!                  ***  ROUTINE trc_dmp_clo  *** 
     
    238238      !!---------------------------------------------------------------------- 
    239239      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     240      INTEGER, INTENT( in ) ::   Kmm     ! time level indices 
    240241      ! 
    241242      INTEGER :: ji , jj, jk, jn, jl, jc                    ! dummy loop indicesa 
     
    355356            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    356357                jl = n_trc_index(jn) 
    357                 CALL trc_dta( kt, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
     358                CALL trc_dta( kt, Kmm, sf_trcdta(jl), rf_trfac(jl), ztrcdta )   ! read tracer data at nit000 
    358359                DO jc = 1, npncts 
    359360                   DO jk = 1, jpkm1 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcnxt.F90

    r10954 r10963  
    100100      CALL lbc_lnk( 'trcnxt', tra(:,:,:,:), 'T', 1. )    
    101101 
    102       IF( ln_bdy )  CALL trc_bdy( kt ) 
     102      IF( ln_bdy )  CALL trc_bdy( kt, Kbb, Kmm, Krhs ) 
    103103 
    104104      IF( l_trdtrc )  THEN             ! trends: store now fields before the Asselin filter application 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trctrp.F90

    r10954 r10963  
    6464         IF( ln_trabbl )        CALL trc_bbl    ( kt, Kbb, Kmm, Krhs ) ! advective (and/or diffusive) bottom boundary layer scheme 
    6565         IF( ln_trcdmp )        CALL trc_dmp    ( kt, Kmm, Krhs )      ! internal damping trends 
    66          IF( ln_bdy )           CALL trc_bdy_dmp( kt )                ! BDY damping trends 
     66         IF( ln_bdy )           CALL trc_bdy_dmp( kt, Kbb,      Krhs ) ! BDY damping trends 
    6767                                CALL trc_adv    ( kt, Kbb, Kmm, tr, Krhs )      ! horizontal & vertical advection  
    6868         !                                                             ! Partial top/bottom cell: GRADh( trb )   
     
    7979                                CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa  )  ! vert. mixing & after tracer ==> after 
    8080                                CALL trc_nxt    ( kt, Kbb, Kmm, Krhs )        ! tracer fields at next time step      
    81          IF( ln_trcrad )        CALL trc_rad    ( kt, Kmm, Krhs )        ! Correct artificial negative concentrations 
    82          IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt )                   ! internal damping trends on closed seas only 
     81         IF( ln_trcrad )        CALL trc_rad    ( kt, Kmm, Krhs )             ! Correct artificial negative concentrations 
     82         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt, Kmm )                   ! internal damping trends on closed seas only 
    8383 
    8484         ! 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/oce_trc.F90

    r10880 r10963  
    3434 
    3535   !* ocean fields: here now and after fields * 
    36    USE oce , ONLY :   un      =>    un      !: i-horizontal velocity (m s-1)  
    37    USE oce , ONLY :   vn      =>    vn      !: j-horizontal velocity (m s-1) 
    38    USE oce , ONLY :   wn      =>    wn      !: vertical velocity (m s-1)   
    39    USE oce , ONLY :   tsn     =>    tsn     !: 4D array contaning ( tn, sn ) 
    40    USE oce , ONLY :   tsb     =>    tsb     !: 4D array contaning ( tb, sb ) 
    41    USE oce , ONLY :   tsa     =>    tsa     !: 4D array contaning ( ta, sa ) 
    42    USE oce , ONLY :   rhop    =>    rhop    !: potential volumic mass (kg m-3)  
    43    USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 
    44    USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s) 
    45    USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]    
    46    USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]    
    47    USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]    
    48    USE oce , ONLY :   rab_n   =>    rab_n   !: local thermal/haline expension ratio at T-points 
     36   USE oce , ONLY :   tsn     =>    tsn     !: 4D array contaning ( tn, sn ) !TEMPORARY 
     37   USE oce , ONLY :   tsb     =>    tsb     !: 4D array contaning ( tb, sb ) !TEMPORARY 
     38   USE oce , ONLY :   tsa     =>    tsa     !: 4D array contaning ( ta, sa ) !TEMPORARY 
     39   USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]    !TEMPORARY 
     40   USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]    !TEMPORARY 
     41   USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]    !TEMPORARY 
     42   USE oce , ONLY :    un     =>     un     !: 4D array  !TEMPORARY 
     43   USE oce , ONLY :    vn     =>     vn     !: 4D array  !TEMPORARY 
     44   USE oce , ONLY :    wn     =>     wn     !: 4D array  !TEMPORARY 
     45   USE oce , ONLY :   uu     =>    uu     !: i-horizontal velocity (m s-1)  
     46   USE oce , ONLY :   vv     =>    vv     !: j-horizontal velocity (m s-1) 
     47   USE oce , ONLY :   ww     =>    ww     !: vertical velocity (m s-1)   
     48   USE oce , ONLY :   ts     =>    ts     !: 4D array contaning ( tn, sn ) 
     49   USE oce , ONLY :   rhop   =>    rhop   !: potential volumic mass (kg m-3)  
     50   USE oce , ONLY :   rhd    =>    rhd    !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 
     51   USE oce , ONLY :   hdiv   =>    hdiv   !: horizontal divergence (1/s) 
     52   USE oce , ONLY :   ssh    =>    ssh    !: sea surface height at t-point [m]    
     53   USE oce , ONLY :   rab_n  =>    rab_n  !: local thermal/haline expension ratio at T-points 
    4954 
    5055   !* surface fluxes * 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90

    r10068 r10963  
    5555CONTAINS 
    5656 
    57    SUBROUTINE trc_bc_ini( ntrc ) 
     57   SUBROUTINE trc_bc_ini( ntrc, Kmm ) 
    5858      !!---------------------------------------------------------------------- 
    5959      !!                   ***  ROUTINE trc_bc_ini  *** 
     
    6464      !!              - allocates passive tracer BC data structure  
    6565      !!---------------------------------------------------------------------- 
    66       INTEGER,INTENT(in) :: ntrc                           ! number of tracers 
     66      INTEGER, INTENT(in) :: ntrc                          ! number of tracers 
     67      INTEGER, INTENT(in) ::   Kmm                         ! time level index 
    6768      ! 
    6869      INTEGER            :: jl, jn , ib, ibd, ii, ij, ik   ! dummy loop indices 
     
    267268                        ii = idx_bdy(ib)%nbi(ibd,igrd) 
    268269                        ij = idx_bdy(ib)%nbj(ibd,igrd) 
    269                         trcdta_bdy(jn,ib)%trc(ibd,ik) = trn(ii,ij,ik,jn) * tmask(ii,ij,ik) 
     270                        trcdta_bdy(jn,ib)%trc(ibd,ik) = tr(ii,ij,ik,jn,Kmm) * tmask(ii,ij,ik) 
    270271                     END DO 
    271272                  END DO 
     
    333334 
    334335 
    335    SUBROUTINE trc_bc(kt, jit) 
     336   SUBROUTINE trc_bc(kt, Kmm, Krhs, jit) 
    336337      !!---------------------------------------------------------------------- 
    337338      !!                   ***  ROUTINE trc_bc  *** 
     
    344345      USE fldread 
    345346      !!       
    346       INTEGER, INTENT(in)           ::   kt    ! ocean time-step index 
    347       INTEGER, INTENT(in), OPTIONAL ::   jit   ! subcycle time-step index (for timesplitting option) 
     347      INTEGER, INTENT(in)           ::   kt        ! ocean time-step index 
     348      INTEGER, INTENT(in)           ::   Kmm, Krhs ! time level indices 
     349      INTEGER, INTENT(in), OPTIONAL ::   jit       ! subcycle time-step index (for timesplitting option) 
    348350      !! 
    349351      INTEGER  :: ji, jj, jk, jn, jl             ! Loop index 
     
    412414                  DO jk = 1, nk_rnf(ji,jj) 
    413415                     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) 
     416                     tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs)  + (tr(ji,jj,jk,jn,Kmm) * zrnf) 
    415417                  END DO 
    416418               END DO 
     
    425427            DO jj = 2, jpj 
    426428               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                  zfact = 1. / ( e3t(ji,jj,1,Kmm) * rn_bc_time ) 
     430                  tr(ji,jj,1,jn,Krhs) = tr(ji,jj,1,jn,Krhs) + rf_trsfac(jl) * sf_trcsbc(jl)%fnow(ji,jj,1) * zfact 
    429431               END DO 
    430432            END DO 
     
    438440                  DO jk = 1, nk_rnf(ji,jj) 
    439441                     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 
     442                     tr(ji,jj,jk,jn,Krhs) = tr(ji,jj,jk,jn,Krhs) + rf_trcfac(jl) * sf_trccbc(jl)%fnow(ji,jj,1) * zfact 
    441443                  END DO 
    442444               END DO 
     
    455457   !!---------------------------------------------------------------------- 
    456458CONTAINS 
    457    SUBROUTINE trc_bc_ini( ntrc )        ! Empty routine 
    458       INTEGER,INTENT(IN) :: ntrc                           ! number of tracers 
     459   SUBROUTINE trc_bc_ini( ntrc, Kmm )        ! Empty routine 
     460      INTEGER, INTENT(IN) :: ntrc                           ! number of tracers 
     461      INTEGER, INTENT(in) :: Kmm                            ! time level index 
    459462      WRITE(*,*) 'trc_bc_ini: You should not have seen this print! error?', kt 
    460463   END SUBROUTINE trc_bc_ini 
    461    SUBROUTINE trc_bc( kt )        ! Empty routine 
     464   SUBROUTINE trc_bc( kt, Kmm, Krhs )        ! Empty routine 
     465      INTEGER, INTENT(in) :: Kmm, Krhs ! time level indices 
    462466      WRITE(*,*) 'trc_bc: You should not have seen this print! error?', kt 
    463467   END SUBROUTINE trc_bc 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbdy.F90

    r10425 r10963  
    3737CONTAINS 
    3838 
    39    SUBROUTINE trc_bdy( kt ) 
     39   SUBROUTINE trc_bdy( kt, Kbb, Kmm, Krhs ) 
    4040      !!---------------------------------------------------------------------- 
    4141      !!                  ***  SUBROUTINE trc_bdy  *** 
     
    4444      !! 
    4545      !!---------------------------------------------------------------------- 
    46       INTEGER, INTENT( in ) :: kt     ! Main time step counter 
     46      INTEGER, INTENT( in ) :: kt              ! Main time step counter 
     47      INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs  ! time level indices 
    4748      !! 
    4849      INTEGER                           :: ib_bdy ,jn ,igrd ! Loop indeces 
     
    6364            SELECT CASE( TRIM(trcdta_bdy(jn,ib_bdy)%cn_obc) ) 
    6465            CASE('none'        )   ;   CYCLE 
    65             CASE('frs'         )   ;   CALL bdy_frs( idx_bdy(ib_bdy),                tra(:,:,:,jn), ztrc*zfac ) 
    66             CASE('specified'   )   ;   CALL bdy_spe( idx_bdy(ib_bdy),                tra(:,:,:,jn), ztrc*zfac ) 
    67             CASE('neumann'     )   ;   CALL bdy_nmn( idx_bdy(ib_bdy), igrd         , tra(:,:,:,jn) ) 
    68             CASE('orlanski'    )   ;   CALL bdy_orl( idx_bdy(ib_bdy), trb(:,:,:,jn), tra(:,:,:,jn), ztrc*zfac, ll_npo=.false. ) 
    69             CASE('orlanski_npo')   ;   CALL bdy_orl( idx_bdy(ib_bdy), trb(:,:,:,jn), tra(:,:,:,jn), ztrc*zfac, ll_npo=.true. ) 
     66            CASE('frs'         )   ;   CALL bdy_frs( idx_bdy(ib_bdy), tr(:,:,:,jn,Krhs), ztrc*zfac ) 
     67            CASE('specified'   )   ;   CALL bdy_spe( idx_bdy(ib_bdy), tr(:,:,:,jn,Krhs), ztrc*zfac ) 
     68            CASE('neumann'     )   ;   CALL bdy_nmn( idx_bdy(ib_bdy), igrd            , tr(:,:,:,jn,Krhs) ) 
     69            CASE('orlanski'    )   ;   CALL bdy_orl( idx_bdy(ib_bdy), tr(:,:,:,jn,Kbb), tr(:,:,:,jn,Krhs), ztrc*zfac, ll_npo=.false. ) 
     70            CASE('orlanski_npo')   ;   CALL bdy_orl( idx_bdy(ib_bdy), tr(:,:,:,jn,Kbb), tr(:,:,:,jn,Krhs), ztrc*zfac, ll_npo=.true. ) 
    7071            CASE DEFAULT           ;   CALL ctl_stop( 'trc_bdy : unrecognised option for open boundaries for passive tracers' ) 
    7172            END SELECT 
    7273            ! Boundary points should be updated 
    73             CALL lbc_bdy_lnk( 'trcbdy', tra(:,:,:,jn), 'T', 1., ib_bdy ) 
     74            CALL lbc_bdy_lnk( 'trcbdy', tr(:,:,:,jn,Krhs), 'T', 1., ib_bdy ) 
    7475            ! 
    7576         END DO 
     
    8182 
    8283 
    83    SUBROUTINE trc_bdy_dmp( kt ) 
     84   SUBROUTINE trc_bdy_dmp( kt, Kbb, Krhs ) 
    8485      !!---------------------------------------------------------------------- 
    8586      !!                 ***  SUBROUTINE trc_bdy_dmp  *** 
     
    9091      !!---------------------------------------------------------------------- 
    9192      INTEGER,         INTENT(in) ::   kt 
     93      INTEGER,         INTENT(in) ::   Kbb, Krhs  ! time level indices 
    9294      !!  
    9395      INTEGER  ::   jn             ! Tracer index 
     
    110112                  zwgt = idx_bdy(ib_bdy)%nbd(ib,igrd) 
    111113                  DO ik = 1, jpkm1 
    112                      zta = zwgt * ( trcdta_bdy(jn, ib_bdy)%trc(ib,ik) - trb(ii,ij,ik,jn) ) * tmask(ii,ij,ik) 
    113                      tra(ii,ij,ik,jn) = tra(ii,ij,ik,jn) + zta 
     114                     zta = zwgt * ( trcdta_bdy(jn, ib_bdy)%trc(ib,ik) - tr(ii,ij,ik,jn,Kbb) ) * tmask(ii,ij,ik) 
     115                     tr(ii,ij,ik,jn,Krhs) = tr(ii,ij,ik,jn,Krhs) + zta 
    114116                  END DO 
    115117               END DO 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcdta.F90

    r10222 r10963  
    154154 
    155155 
    156    SUBROUTINE trc_dta( kt, sf_trcdta, ptrcfac, ptrcdta) 
     156   SUBROUTINE trc_dta( kt, Kmm, sf_trcdta, ptrcfac, ptrcdta) 
    157157      !!---------------------------------------------------------------------- 
    158158      !!                   ***  ROUTINE trc_dta  *** 
     
    167167      !!---------------------------------------------------------------------- 
    168168      INTEGER                          , INTENT(in   )   ::   kt         ! ocean time-step 
     169      INTEGER                          , INTENT(in   )   ::   Kmm        ! time level index 
    169170      TYPE(FLD), DIMENSION(1)          , INTENT(inout)   ::   sf_trcdta  ! array of information on the field to read 
    170171      REAL(wp)                         , INTENT(in   )   ::   ptrcfac    ! multiplication factor 
     
    194195               DO ji = 1, jpi 
    195196                  DO jk = 1, jpk                        ! determines the intepolated T-S profiles at each (i,j) points 
    196                      zl = gdept_n(ji,jj,jk) 
     197                     zl = gdept(ji,jj,jk,Kmm) 
    197198                     IF(     zl < gdept_1d(1  ) ) THEN         ! above the first level of data 
    198199                        ztp(jk) = ptrcdta(ji,jj,1) 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcini.F90

    r10905 r10963  
    8383      ENDIF 
    8484      ! 
    85       CALL trc_ini_state  !  passive tracers initialisation : from a restart or from clim 
     85      CALL trc_ini_state( Kbb, Kmm, Kaa )  !  passive tracers initialisation : from a restart or from clim 
    8686      IF( nn_dttrc /= 1 ) & 
    87       CALL trc_sub_ini    ! Initialize variables for substepping passive tracers 
    88       ! 
    89       CALL trc_ini_inv   ! Inventories 
     87      CALL trc_sub_ini( Kmm )    ! Initialize variables for substepping passive tracers 
     88      ! 
     89      CALL trc_ini_inv( Kmm )    ! Inventories 
    9090      ! 
    9191      IF( ln_timing )   CALL timing_stop('trc_init') 
     
    110110 
    111111 
    112    SUBROUTINE trc_ini_inv 
     112   SUBROUTINE trc_ini_inv( Kmm ) 
    113113      !!---------------------------------------------------------------------- 
    114114      !!                     ***  ROUTINE trc_ini_stat  *** 
    115115      !! ** Purpose :      passive tracers inventories at initialsation phase 
    116116      !!---------------------------------------------------------------------- 
    117       INTEGER ::  jk, jn    ! dummy loop indices 
     117      INTEGER, INTENT(in) ::   Kmm    ! time level index 
     118      INTEGER             ::  jk, jn  ! dummy loop indices 
    118119      CHARACTER (len=25) :: charout 
    119120      !!---------------------------------------------------------------------- 
     
    125126      !                          ! masked grid volume 
    126127      DO jk = 1, jpk 
    127          cvol(:,:,jk) = e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) 
     128         cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    128129      END DO 
    129130      !                          ! total volume of the ocean  
     
    132133      trai(:) = 0._wp            ! initial content of all tracers 
    133134      DO jn = 1, jptra 
    134          trai(jn) = trai(jn) + glob_sum( 'trcini', trn(:,:,:,jn) * cvol(:,:,:)   ) 
     135         trai(jn) = trai(jn) + glob_sum( 'trcini', tr(:,:,:,jn,Kmm) * cvol(:,:,:)   ) 
    135136      END DO 
    136137 
     
    151152         WRITE(charout, FMT="('ini ')") 
    152153         CALL prt_ctl_trc_info( charout ) 
    153          CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 
     154         CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm ) 
    154155      ENDIF 
    1551569000  FORMAT('      tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
     
    229230 
    230231 
    231    SUBROUTINE trc_ini_state 
     232   SUBROUTINE trc_ini_state( Kbb, Kmm, Kaa ) 
    232233      !!---------------------------------------------------------------------- 
    233234      !!                     ***  ROUTINE trc_ini_state *** 
     
    238239      USE trcdta          ! initialisation from files 
    239240      ! 
    240       INTEGER :: jn, jl   ! dummy loop indices 
    241       !!---------------------------------------------------------------------- 
    242       ! 
    243       IF( ln_trcdta )   CALL trc_dta_ini( jptra )      ! set initial tracers values 
    244       ! 
    245       IF( ln_my_trc )   CALL trc_bc_ini ( jptra )      ! set tracers Boundary Conditions 
     241      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa   ! time level index 
     242      INTEGER             :: jn, jl          ! dummy loop indices 
     243      !!---------------------------------------------------------------------- 
     244      ! 
     245      IF( ln_trcdta )   CALL trc_dta_ini( jptra )           ! set initial tracers values 
     246      ! 
     247      IF( ln_my_trc )   CALL trc_bc_ini ( jptra, Kmm )      ! set tracers Boundary Conditions 
    246248      ! 
    247249      ! 
    248250      IF( ln_rsttr ) THEN              ! restart from a file 
    249251        ! 
    250         CALL trc_rst_read 
     252        CALL trc_rst_read( Kbb, Kmm ) 
    251253        ! 
    252254      ELSE                             ! Initialisation of tracer from a file that may also be used for damping 
     
    257259               IF( ln_trc_ini(jn) ) THEN 
    258260                  jl = n_trc_index(jn)  
    259                   CALL trc_dta( nit000, sf_trcdta(jl), rf_trfac(jl), trn(:,:,:,jn) ) 
     261                  CALL trc_dta( nit000, Kmm, sf_trcdta(jl), rf_trfac(jl), tr(:,:,:,jn,Kmm) ) 
    260262                  ! 
    261263                  ! deallocate data structure if data are not used for damping 
     
    271273        ENDIF 
    272274        ! 
    273         trb(:,:,:,:) = trn(:,:,:,:) 
     275        tr(:,:,:,:,Kbb) = tr(:,:,:,:,Kmm) 
    274276        !  
    275277      ENDIF 
    276278      ! 
    277       tra(:,:,:,:) = 0._wp 
    278       !                                                         ! Partial top/bottom cell: GRADh(trn) 
     279      tr(:,:,:,:,Kaa) = 0._wp 
     280      !                                                         ! Partial top/bottom cell: GRADh(tr(Kmm)) 
    279281   END SUBROUTINE trc_ini_state 
    280282 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcrst.F90

    r10425 r10963  
    9494   END SUBROUTINE trc_rst_opn 
    9595 
    96    SUBROUTINE trc_rst_read 
     96   SUBROUTINE trc_rst_read( Kbb, Kmm ) 
    9797      !!---------------------------------------------------------------------- 
    9898      !!                    ***  trc_rst_opn  *** 
     
    100100      !! ** purpose  :   read passive tracer fields in restart files 
    101101      !!---------------------------------------------------------------------- 
     102      INTEGER, INTENT( in ) ::   Kbb, Kmm  ! time level indices 
    102103      INTEGER  ::  jn      
    103104 
     
    110111      ! READ prognostic variables and computes diagnostic variable 
    111112      DO jn = 1, jptra 
    112          CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), trn(:,:,:,jn) ) 
    113       END DO 
    114  
    115       DO jn = 1, jptra 
    116          CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
     113         CALL iom_get( numrtr, jpdom_autoglo, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm) ) 
     114      END DO 
     115 
     116      DO jn = 1, jptra 
     117         CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 
    117118      END DO 
    118119      ! 
     
    121122   END SUBROUTINE trc_rst_read 
    122123 
    123    SUBROUTINE trc_rst_wri( kt ) 
     124   SUBROUTINE trc_rst_wri( kt, Kbb, Kmm, Krhs ) 
    124125      !!---------------------------------------------------------------------- 
    125126      !!                    ***  trc_rst_wri  *** 
     
    127128      !! ** purpose  :   write passive tracer fields in restart files 
    128129      !!---------------------------------------------------------------------- 
    129       INTEGER, INTENT( in ) ::   kt    ! ocean time-step index 
     130      INTEGER, INTENT( in ) ::   kt              ! ocean time-step index 
     131      INTEGER, INTENT( in ) ::   Kbb, Kmm, Krhs  ! time level indices 
    130132      !! 
    131133      INTEGER  :: jn 
     
    136138      ! --------------------  
    137139      DO jn = 1, jptra 
    138          CALL iom_rstput( kt, nitrst, numrtw, 'TRN'//ctrcnm(jn), trn(:,:,:,jn) ) 
    139       END DO 
    140  
    141       DO jn = 1, jptra 
    142          CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
     140         CALL iom_rstput( kt, nitrst, numrtw, 'TRN'//ctrcnm(jn), tr(:,:,:,jn,Kmm) ) 
     141      END DO 
     142 
     143      DO jn = 1, jptra 
     144         CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 
    143145      END DO 
    144146      ! 
     
    146148     
    147149      IF( kt == nitrst ) THEN 
    148           CALL trc_rst_stat            ! statistics 
     150          CALL trc_rst_stat( Kmm, Krhs )             ! statistics 
    149151          CALL iom_close( numrtw )     ! close the restart file (only at last time step) 
    150152#if ! defined key_trdmxl_trc 
     
    297299 
    298300 
    299    SUBROUTINE trc_rst_stat 
     301   SUBROUTINE trc_rst_stat( Kmm, Krhs ) 
    300302      !!---------------------------------------------------------------------- 
    301303      !!                    ***  trc_rst_stat  *** 
     
    303305      !! ** purpose  :   Compute tracers statistics 
    304306      !!---------------------------------------------------------------------- 
     307      INTEGER, INTENT( in ) ::   Kmm, Krhs  ! time level indices 
    305308      INTEGER  :: jk, jn 
    306309      REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift 
     
    315318      ! 
    316319      DO jk = 1, jpk 
    317          zvol(:,:,jk) = e1e2t(:,:) * e3t_a(:,:,jk) * tmask(:,:,jk) 
    318       END DO 
    319       ! 
    320       DO jn = 1, jptra 
    321          ztraf = glob_sum( 'trcrst', trn(:,:,:,jn) * zvol(:,:,:) ) 
    322          zmin  = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 
    323          zmax  = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 
     320         zvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Krhs) * tmask(:,:,jk) 
     321      END DO 
     322      ! 
     323      DO jn = 1, jptra 
     324         ztraf = glob_sum( 'trcrst', tr(:,:,:,jn,Kmm) * zvol(:,:,:) ) 
     325         zmin  = MINVAL( tr(:,:,:,jn,Kmm), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 
     326         zmax  = MAXVAL( tr(:,:,:,jn,Kmm), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 
    324327         IF( lk_mpp ) THEN 
    325328            CALL mpp_min( 'trcrst', zmin )      ! min over the global domain 
     
    341344   !!---------------------------------------------------------------------- 
    342345CONTAINS 
    343    SUBROUTINE trc_rst_read                      ! Empty routines 
     346   SUBROUTINE trc_rst_read( Kbb, Kmm)                      ! Empty routines 
     347      INTEGER, INTENT( in ) :: Kbb, Kmm  ! time level indices 
    344348   END SUBROUTINE trc_rst_read 
    345    SUBROUTINE trc_rst_wri( kt ) 
    346       INTEGER, INTENT ( in ) :: kt 
     349   SUBROUTINE trc_rst_wri( kt, Kbb, Kmm, Krhs ) 
     350      INTEGER, INTENT( in ) :: kt 
     351      INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs  ! time level indices 
    347352      WRITE(*,*) 'trc_rst_wri: You should not have seen this print! error?', kt 
    348353   END SUBROUTINE trc_rst_wri    
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcsms.F90

    r10068 r10963  
    3434CONTAINS 
    3535 
    36    SUBROUTINE trc_sms( kt ) 
     36   SUBROUTINE trc_sms( kt, Kmm , Krhs ) 
    3737      !!--------------------------------------------------------------------- 
    3838      !!                     ***  ROUTINE trc_sms  *** 
     
    4242      !! ** Method  : -  call the main routine of of each defined tracer model 
    4343      !! ------------------------------------------------------------------------------------- 
    44       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     44      INTEGER, INTENT( in ) ::   kt        ! ocean time-step index       
     45      INTEGER, INTENT( in ) ::   Kmm, Krhs ! time level indices 
    4546      !! 
    4647      CHARACTER (len=25) :: charout 
     
    4950      IF( ln_timing )   CALL timing_start('trc_sms') 
    5051      ! 
    51       IF( ln_pisces  )   CALL trc_sms_pisces ( kt )    ! main program of PISCES  
     52      IF( ln_pisces  )   CALL trc_sms_pisces ( kt, Kmm )    ! main program of PISCES  
    5253      IF( ll_cfc     )   CALL trc_sms_cfc    ( kt )    ! surface fluxes of CFC 
    5354      IF( ln_c14     )   CALL trc_sms_c14    ( kt )    ! surface fluxes of C14 
    5455      IF( ln_age     )   CALL trc_sms_age    ( kt )    ! Age tracer 
    55       IF( ln_my_trc  )   CALL trc_sms_my_trc ( kt )    ! MY_TRC  tracers 
     56      IF( ln_my_trc  )   CALL trc_sms_my_trc ( kt, Kmm, Krhs )    ! MY_TRC  tracers 
    5657 
    5758      IF(ln_ctl) THEN      ! print mean trends (used for debugging) 
    5859         WRITE(charout, FMT="('sms ')") 
    5960         CALL prt_ctl_trc_info( charout ) 
    60          CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 
     61         CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm ) 
    6162      ENDIF 
    6263      ! 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcstp.F90

    r10922 r10963  
    7777      IF( .NOT.ln_linssh ) THEN                                           ! update ocean volume due to ssh temporal evolution 
    7878         DO jk = 1, jpk 
    79             cvol(:,:,jk) = e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) 
     79            cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    8080         END DO 
    8181         IF ( ln_ctl .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend )              & 
     
    8787      IF( l_trcdm2dc )   CALL trc_mean_qsr( kt ) 
    8888      !     
    89       IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt, Kmm )  ! averaging physical variables for sub-stepping 
     89      IF( nn_dttrc /= 1 )   CALL trc_sub_stp( kt, Kbb, Kmm, Krhs )  ! averaging physical variables for sub-stepping 
    9090      !     
    9191      IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step 
     
    9696         ENDIF 
    9797         ! 
    98          tra(:,:,:,:) = 0.e0 
     98         tr(:,:,:,:,Krhs) = 0.e0 
    9999         ! 
    100100                                   CALL trc_rst_opn  ( kt )       ! Open tracer restart file  
    101101         IF( lrst_trc )            CALL trc_rst_cal  ( kt, 'WRITE' )   ! calendar 
    102                                    CALL trc_wri      ( kt )       ! output of passive tracers with iom I/O manager 
    103                                    CALL trc_sms      ( kt )       ! tracers: sinks and sources 
    104                                    CALL trc_trp      ( kt, Kbb, Kmm, Krhs, Kaa )       ! transport of passive tracers 
     102                                   CALL trc_wri      ( kt )                       ! output of passive tracers with iom I/O manager 
     103                                   CALL trc_sms      ( kt,      Kmm, Krhs )       ! tracers: sinks and sources 
     104                                   CALL trc_trp      ( kt, Kbb, Kmm, Krhs, Kaa )  ! transport of passive tracers 
    105105         IF( kt == nittrc000 ) THEN 
    106106            CALL iom_close( numrtr )       ! close input tracer restart file 
    107107            IF(lwm) CALL FLUSH( numont )   ! flush namelist output 
    108108         ENDIF 
    109          IF( lrst_trc )            CALL trc_rst_wri  ( kt )       ! write tracer restart file 
    110          IF( lk_trdmxl_trc  )      CALL trd_mxl_trc  ( kt )       ! trends: Mixed-layer 
    111          ! 
    112          IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt )       ! resetting physical variables when sub-stepping 
     109         IF( lrst_trc )            CALL trc_rst_wri  ( kt, Kbb, Kmm, Krhs )       ! write tracer restart file 
     110         IF( lk_trdmxl_trc  )      CALL trd_mxl_trc  ( kt )                       ! trends: Mixed-layer 
     111         ! 
     112         IF( nn_dttrc /= 1   )     CALL trc_sub_reset( kt, Kbb, Kmm, Krhs )       ! resetting physical variables when sub-stepping 
    113113         ! 
    114114      ENDIF 
     
    117117         ztrai = 0._wp                                                   !  content of all tracers 
    118118         DO jn = 1, jptra 
    119             ztrai = ztrai + glob_sum( 'trcstp', trn(:,:,:,jn) * cvol(:,:,:)   ) 
     119            ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Kmm) * cvol(:,:,:)   ) 
    120120         END DO 
    121121         IF( lwm ) WRITE(numstr,9300) kt,  ztrai / areatot 
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcsub.F90

    r10922 r10963  
    4343   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    un_tm ,   un_temp   !: i-horizontal velocity average     [m/s] 
    4444   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    vn_tm ,   vn_temp   !: j-horizontal velocity average     [m/s] 
    45    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::              wn_temp   !: hold current values of avt, un, vn, wn 
     45   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::              wn_temp   !: hold current values of avt, uu(Kmm), vv(Kmm), ww 
    4646   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tsn_tm ,  tsn_temp   !: t/s average     [m/s] 
    4747   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   avs_tm ,  avs_temp   !: vertical diffusivity coeff. at  w-point   [m2/s] 
     
    5959   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   wndm_tm ,   wndm_temp   !: 10m wind average [m] 
    6060   ! 
    61    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]   
     61   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !: hold ssh(Kbb) from the beginning of each sub-stepping[m]   
    6262   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   sshb_temp, ssha_temp 
    6363   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp 
     
    8282CONTAINS 
    8383 
    84    SUBROUTINE trc_sub_stp( kt, Kmm ) 
     84   SUBROUTINE trc_sub_stp( kt, Kbb, Kmm, Krhs ) 
    8585      !!------------------------------------------------------------------- 
    8686      !!                     ***  ROUTINE trc_stp  *** 
     
    9191      !!              on TOP steps, calculate averages. 
    9292      !!------------------------------------------------------------------- 
    93       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    94       INTEGER, INTENT( in ) ::   Kmm  ! ocean time-level index 
     93      INTEGER, INTENT( in ) ::   kt              ! ocean time-step index 
     94      INTEGER, INTENT( in ) ::   Kbb, Kmm, Krhs  ! ocean time-level index 
    9595      ! 
    9696      INTEGER ::   ji, jj, jk   ! dummy loop indices 
     
    105105           IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    106106           ! 
    107            sshb_hold  (:,:) = sshn  (:,:) 
     107           sshb_hold  (:,:) = ssh   (:,:,Kmm) 
    108108           emp_b_hold (:,:) = emp_b (:,:) 
    109109           ! 
     
    114114      IF( MOD( kt , nn_dttrc ) /= 0 ) THEN 
    115115         ! 
    116          un_tm   (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:)  
    117          vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:)  
    118          tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,: 
    119          tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,: 
    120          rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,: 
    121          avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,: 
     116         un_tm   (:,:,:)        = un_tm   (:,:,:)        + uu   (:,:,:,Kmm)        * e3u(:,:,:,Kmm)  
     117         vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vv   (:,:,:,Kmm)        * e3v(:,:,:,Kmm)  
     118         tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + ts   (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm 
     119         tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + ts   (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm 
     120         rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)            * e3t(:,:,:,Kmm 
     121         avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)            * e3w(:,:,:,Kmm 
    122122         IF( l_ldfslp ) THEN 
    123123            uslp_tm (:,:,:)      = uslp_tm (:,:,:)        + uslp (:,:,:) 
     
    137137         ENDIF  
    138138         ! 
    139          sshn_tm  (:,:)         = sshn_tm  (:,:)         + sshn  (:,:)  
     139         sshn_tm  (:,:)         = sshn_tm  (:,:)         + ssh   (:,:,Kmm)  
    140140         rnf_tm   (:,:)         = rnf_tm   (:,:)         + rnf   (:,:)  
    141141         h_rnf_tm (:,:)         = h_rnf_tm (:,:)         + h_rnf (:,:)  
     
    149149      ELSE                           !  It is time to substep  
    150150         !   1. set temporary arrays to hold physics/dynamical variables 
    151          un_temp    (:,:,:)      = un    (:,:,:) 
    152          vn_temp    (:,:,:)      = vn    (:,:,:) 
    153          wn_temp    (:,:,:)      = wn    (:,:,:) 
    154          tsn_temp   (:,:,:,:)    = tsn   (:,:,:,:) 
     151         un_temp    (:,:,:)      = uu    (:,:,:,Kmm) 
     152         vn_temp    (:,:,:)      = vv    (:,:,:,Kmm) 
     153         wn_temp    (:,:,:)      = ww    (:,:,:) 
     154         tsn_temp   (:,:,:,:)    = ts    (:,:,:,:,Kmm) 
    155155         rhop_temp  (:,:,:)      = rhop  (:,:,:)     
    156156         avs_temp   (:,:,:)      = avs   (:,:,:) 
     
    169169            ENDIF 
    170170         ENDIF  
    171          sshn_temp  (:,:)        = sshn  (:,:) 
    172          sshb_temp  (:,:)        = sshb  (:,:) 
    173          ssha_temp  (:,:)        = ssha  (:,:) 
     171         sshn_temp  (:,:)        = ssh   (:,:,Kmm) 
     172         sshb_temp  (:,:)        = ssh   (:,:,Kbb) 
     173         ssha_temp  (:,:)        = ssh   (:,:,Krhs) 
    174174         rnf_temp   (:,:)        = rnf   (:,:) 
    175175         h_rnf_temp (:,:)        = h_rnf (:,:) 
     
    182182         wndm_temp  (:,:)        = wndm  (:,:) 
    183183         !                                    !  Variables reset in trc_sub_ssh 
    184          hdivn_temp (:,:,:)      = hdivn (:,:,:) 
     184         hdivn_temp (:,:,:)      = hdiv (:,:,:) 
    185185         ! 
    186186         ! 2. Create averages and reassign variables 
    187          un_tm    (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:)  
    188          vn_tm    (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:)  
    189          tsn_tm   (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,: 
    190          tsn_tm   (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,: 
    191          rhop_tm (:,:,:)         = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,: 
    192          avs_tm   (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,: 
     187         un_tm    (:,:,:)        = un_tm   (:,:,:)        + uu   (:,:,:,Kmm)        * e3u(:,:,:,Kmm)  
     188         vn_tm    (:,:,:)        = vn_tm   (:,:,:)        + vv   (:,:,:,Kmm)        * e3v(:,:,:,Kmm)  
     189         tsn_tm   (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + ts   (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm 
     190         tsn_tm   (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + ts   (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm 
     191         rhop_tm  (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)            * e3t(:,:,:,Kmm 
     192         avs_tm   (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)            * e3w(:,:,:,Kmm 
    193193         IF( l_ldfslp ) THEN 
    194194            uslp_tm  (:,:,:)     = uslp_tm (:,:,:)        + uslp (:,:,:)  
     
    207207            ENDIF 
    208208         ENDIF  
    209          sshn_tm  (:,:)          = sshn_tm    (:,:)       + sshn  (:,:)  
     209         sshn_tm  (:,:)          = sshn_tm    (:,:)       + ssh   (:,:,Kmm)  
    210210         rnf_tm   (:,:)          = rnf_tm     (:,:)       + rnf   (:,:)  
    211211         h_rnf_tm (:,:)          = h_rnf_tm   (:,:)       + h_rnf (:,:)  
     
    217217         wndm_tm  (:,:)          = wndm_tm    (:,:)       + wndm  (:,:) 
    218218         ! 
    219          sshn     (:,:)          = sshn_tm    (:,:) * r1_ndttrcp1  
    220          sshb     (:,:)          = sshb_hold  (:,:) 
     219         ssh      (:,:,Kmm)      = sshn_tm    (:,:) * r1_ndttrcp1  
     220         ssh      (:,:,Kbb)      = sshb_hold  (:,:) 
    221221         rnf      (:,:)          = rnf_tm     (:,:) * r1_ndttrcp1  
    222222         h_rnf    (:,:)          = h_rnf_tm   (:,:) * r1_ndttrcp1  
    223223         hmld     (:,:)          = hmld_tm    (:,:) * r1_ndttrcp1  
    224224         !  variables that are initialized after averages 
    225          emp_b    (:,:) = emp_b_hold (:,:) 
     225         emp_b    (:,:)          = emp_b_hold (:,:) 
    226226         IF( kt == nittrc000 ) THEN 
    227227            wndm  (:,:)          = wndm_tm    (:,:) * r1_ndttrc  
     
    261261            DO jj = 1, jpj 
    262262               DO ji = 1, jpi 
    263                   z1_ne3t = r1_ndttrcp1  / e3t_n(ji,jj,jk) 
    264                   z1_ne3u = r1_ndttrcp1  / e3u_n(ji,jj,jk) 
    265                   z1_ne3v = r1_ndttrcp1  / e3v_n(ji,jj,jk) 
    266                   z1_ne3w = r1_ndttrcp1  / e3w_n(ji,jj,jk) 
     263                  z1_ne3t = r1_ndttrcp1  / e3t(ji,jj,jk,Kmm) 
     264                  z1_ne3u = r1_ndttrcp1  / e3u(ji,jj,jk,Kmm) 
     265                  z1_ne3v = r1_ndttrcp1  / e3v(ji,jj,jk,Kmm) 
     266                  z1_ne3w = r1_ndttrcp1  / e3w(ji,jj,jk,Kmm) 
    267267                  ! 
    268                   un   (ji,jj,jk)        = un_tm   (ji,jj,jk)        * z1_ne3u 
    269                   vn   (ji,jj,jk)        = vn_tm   (ji,jj,jk)        * z1_ne3v 
    270                   tsn  (ji,jj,jk,jp_tem) = tsn_tm  (ji,jj,jk,jp_tem) * z1_ne3t 
    271                   tsn  (ji,jj,jk,jp_sal) = tsn_tm  (ji,jj,jk,jp_sal) * z1_ne3t 
    272                   rhop (ji,jj,jk)        = rhop_tm (ji,jj,jk)        * z1_ne3t 
     268                  uu   (ji,jj,jk,Kmm)        = un_tm   (ji,jj,jk)        * z1_ne3u 
     269                  vv   (ji,jj,jk,Kmm)        = vn_tm   (ji,jj,jk)        * z1_ne3v 
     270                  ts   (ji,jj,jk,jp_tem,Kmm) = tsn_tm  (ji,jj,jk,jp_tem) * z1_ne3t 
     271                  ts   (ji,jj,jk,jp_sal,Kmm) = tsn_tm  (ji,jj,jk,jp_sal) * z1_ne3t 
     272                  rhop (ji,jj,jk)            = rhop_tm (ji,jj,jk)        * z1_ne3t 
    273273!!gm : BUG ==>> for avs I don't understand the division by e3w 
    274                   avs  (ji,jj,jk)        = avs_tm  (ji,jj,jk)        * z1_ne3w 
     274                  avs  (ji,jj,jk)            = avs_tm  (ji,jj,jk)        * z1_ne3w 
    275275               END DO 
    276276            END DO 
     
    283283         ENDIF 
    284284         ! 
    285          CALL trc_sub_ssh( kt, Kmm )         ! after ssh & vertical velocity 
     285         CALL trc_sub_ssh( kt, Kbb, Kmm, Krhs )         ! after ssh & vertical velocity 
    286286         ! 
    287287      ENDIF 
     
    292292 
    293293 
    294    SUBROUTINE trc_sub_ini 
     294   SUBROUTINE trc_sub_ini( Kmm ) 
    295295      !!------------------------------------------------------------------- 
    296296      !!                     ***  ROUTINE trc_sub_ini  *** 
     
    302302      !!------------------------------------------------------------------- 
    303303      INTEGER ::   ierr 
     304      INTEGER, INTENT( in ) ::   Kmm    ! time level index 
    304305      !!------------------------------------------------------------------- 
    305306      ! 
     
    312313      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'top_sub_alloc : unable to allocate standard ocean arrays' ) 
    313314 
    314       un_tm   (:,:,:)        = un   (:,:,:)        * e3u_n(:,:,:)  
    315       vn_tm   (:,:,:)        = vn   (:,:,:)        * e3v_n(:,:,:)  
    316       tsn_tm  (:,:,:,jp_tem) = tsn  (:,:,:,jp_tem) * e3t_n(:,:,: 
    317       tsn_tm  (:,:,:,jp_sal) = tsn  (:,:,:,jp_sal) * e3t_n(:,:,: 
    318       rhop_tm (:,:,:)        = rhop (:,:,:)        * e3t_n(:,:,: 
     315      un_tm   (:,:,:)        = uu   (:,:,:,Kmm)        * e3u(:,:,:,Kmm)  
     316      vn_tm   (:,:,:)        = vv   (:,:,:,Kmm)        * e3v(:,:,:,Kmm)  
     317      tsn_tm  (:,:,:,jp_tem) = ts   (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm 
     318      tsn_tm  (:,:,:,jp_sal) = ts   (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm 
     319      rhop_tm (:,:,:)        = rhop (:,:,:)            * e3t(:,:,:,Kmm 
    319320!!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 
    320       avs_tm  (:,:,:)        = avs  (:,:,:)        * e3w_n(:,:,: 
     321      avs_tm  (:,:,:)        = avs  (:,:,:)            * e3w(:,:,:,Kmm 
    321322      IF( l_ldfslp ) THEN 
    322323         wslpi_tm(:,:,:)     = wslpi(:,:,:) 
     
    325326         vslp_tm (:,:,:)     = vslp (:,:,:) 
    326327      ENDIF 
    327       sshn_tm  (:,:) = sshn  (:,:)  
     328      sshn_tm  (:,:) = ssh   (:,:,Kmm)  
    328329      rnf_tm   (:,:) = rnf   (:,:)  
    329330      h_rnf_tm (:,:) = h_rnf (:,:)  
     
    333334      fr_i_tm  (:,:) = 0._wp 
    334335      emp_tm   (:,:) = 0._wp 
    335       fmmflx_tm(:,:)  = 0._wp 
     336      fmmflx_tm(:,:) = 0._wp 
    336337      qsr_tm   (:,:) = 0._wp 
    337338      wndm_tm  (:,:) = 0._wp 
     
    350351 
    351352 
    352    SUBROUTINE trc_sub_reset( kt ) 
     353   SUBROUTINE trc_sub_reset( kt, Kbb, Kmm, Krhs ) 
    353354      !!------------------------------------------------------------------- 
    354355      !!                     ***  ROUTINE trc_sub_reset  *** 
     
    359360      !!              Compute the averages for sub-stepping 
    360361      !!------------------------------------------------------------------- 
    361       INTEGER, INTENT( in ) ::  kt  ! ocean time-step index 
    362       INTEGER :: jk                 ! dummy loop indices 
     362      INTEGER, INTENT( in ) ::  kt             ! ocean time-step index 
     363      INTEGER, INTENT( in ) ::  Kbb, Kmm, Krhs ! time level index 
     364      INTEGER :: jk                            ! dummy loop indices 
    363365      !!------------------------------------------------------------------- 
    364366      ! 
     
    366368      ! 
    367369      !   restore physics variables 
    368       un    (:,:,:)   =  un_temp    (:,:,:) 
    369       vn    (:,:,:)   =  vn_temp    (:,:,:) 
    370       wn    (:,:,:)   =  wn_temp    (:,:,:) 
    371       tsn   (:,:,:,:) =  tsn_temp  (:,:,:,:) 
    372       rhop  (:,:,:)   =  rhop_temp  (:,:,:) 
    373       avs   (:,:,:)   =  avs_temp  (:,:,:) 
     370      uu   (:,:,:,Kmm)   =  un_temp  (:,:,:) 
     371      vv   (:,:,:,Kmm)   =  vn_temp  (:,:,:) 
     372      ww   (:,:,:)       =  wn_temp  (:,:,:) 
     373      ts   (:,:,:,:,Kmm) =  tsn_temp (:,:,:,:) 
     374      rhop (:,:,:)       =  rhop_temp(:,:,:) 
     375      avs  (:,:,:)       =  avs_temp (:,:,:) 
    374376      IF( l_ldfslp ) THEN 
    375          wslpi (:,:,:)=  wslpi_temp (:,:,:) 
    376          wslpj (:,:,:)=  wslpj_temp (:,:,:) 
    377          uslp  (:,:,:)=  uslp_temp  (:,:,:) 
    378          vslp  (:,:,:)=  vslp_temp  (:,:,:) 
    379       ENDIF 
    380       sshn  (:,:)     =  sshn_temp  (:,:) 
    381       sshb  (:,:)     =  sshb_temp  (:,:) 
    382       ssha  (:,:)     =  ssha_temp  (:,:) 
    383       rnf   (:,:)     =  rnf_temp   (:,:) 
    384       h_rnf (:,:)     =  h_rnf_temp (:,:) 
     377         wslpi (:,:,:)   =  wslpi_temp (:,:,:) 
     378         wslpj (:,:,:)   =  wslpj_temp (:,:,:) 
     379         uslp  (:,:,:)   =  uslp_temp  (:,:,:) 
     380         vslp  (:,:,:)   =  vslp_temp  (:,:,:) 
     381      ENDIF 
     382      ssh   (:,:,Kmm)     =  sshn_temp  (:,:) 
     383      ssh   (:,:,Kbb)     =  sshb_temp  (:,:) 
     384      ssh   (:,:,Krhs)    =  ssha_temp  (:,:) 
     385      rnf   (:,:)         =  rnf_temp   (:,:) 
     386      h_rnf (:,:)         =  h_rnf_temp (:,:) 
    385387      ! 
    386388      hmld  (:,:)     =  hmld_temp  (:,:) 
     
    402404      ENDIF 
    403405      ! 
    404       hdivn (:,:,:)   =  hdivn_temp (:,:,:) 
     406      hdiv (:,:,:)   =  hdivn_temp (:,:,:) 
    405407      !                                       
    406408      ! Start new averages 
    407          un_tm   (:,:,:)        = un   (:,:,:)        * e3u_n(:,:,:)  
    408          vn_tm   (:,:,:)        = vn   (:,:,:)        * e3v_n(:,:,:)  
    409          tsn_tm  (:,:,:,jp_tem) = tsn  (:,:,:,jp_tem) * e3t_n(:,:,: 
    410          tsn_tm  (:,:,:,jp_sal) = tsn  (:,:,:,jp_sal) * e3t_n(:,:,: 
    411          rhop_tm (:,:,:)        = rhop (:,:,:)        * e3t_n(:,:,: 
    412          avs_tm  (:,:,:)        = avs  (:,:,:)        * e3w_n(:,:,: 
     409         un_tm   (:,:,:)        = uu   (:,:,:,Kmm)        * e3u(:,:,:,Kmm)  
     410         vn_tm   (:,:,:)        = vv   (:,:,:,Kmm)        * e3v(:,:,:,Kmm)  
     411         tsn_tm  (:,:,:,jp_tem) = ts   (:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm 
     412         tsn_tm  (:,:,:,jp_sal) = ts   (:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm 
     413         rhop_tm (:,:,:)        = rhop (:,:,:)            * e3t(:,:,:,Kmm 
     414         avs_tm  (:,:,:)        = avs  (:,:,:)            * e3w(:,:,:,Kmm 
    413415      IF( l_ldfslp ) THEN 
    414416         uslp_tm (:,:,:)        = uslp (:,:,:) 
     
    418420      ENDIF 
    419421      ! 
    420       sshb_hold  (:,:) = sshn  (:,:) 
     422      sshb_hold  (:,:) = ssh   (:,:,Kmm ) 
    421423      emp_b_hold (:,:) = emp   (:,:) 
    422       sshn_tm    (:,:) = sshn  (:,:)  
     424      sshn_tm    (:,:) = ssh   (:,:,Kmm)  
    423425      rnf_tm     (:,:) = rnf   (:,:)  
    424426      h_rnf_tm   (:,:) = h_rnf (:,:)  
     
    446448 
    447449 
    448    SUBROUTINE trc_sub_ssh( kt, Kmm )  
     450   SUBROUTINE trc_sub_ssh( kt, Kbb, Kmm, Krhs )  
    449451      !!---------------------------------------------------------------------- 
    450452      !!                ***  ROUTINE trc_sub_ssh  *** 
    451453      !!                    
    452       !! ** Purpose :   compute the after ssh (ssha), the now vertical velocity 
     454      !! ** Purpose :   compute the after ssh (ssh(:,:,Krhs)), the now vertical velocity 
    453455      !!              and update the now vertical coordinate (ln_linssh=F). 
    454456      !! 
     
    458460      !!        The boundary conditions are w=0 at the bottom (no flux) and. 
    459461      !! 
    460       !! ** action  :   ssha    : after sea surface height 
    461       !!                wn      : now vertical velocity 
     462      !! ** action  :   ssh(:,:,Krhs)    : after sea surface height 
     463      !!                ww      : now vertical velocity 
    462464      !!                sshu_a, sshv_a, sshf_a  : after sea surface height (ln_linssh=F) 
    463465      !! 
    464466      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
    465467      !!---------------------------------------------------------------------- 
    466       INTEGER, INTENT(in) ::   kt   ! time step 
    467       INTEGER, INTENT(in) ::   Kmm  ! ocean time-level index 
     468      INTEGER, INTENT(in) ::   kt              ! time step 
     469      INTEGER, INTENT(in) ::   Kbb, Kmm, Krhs  ! ocean time-level index 
    468470      ! 
    469471      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     
    481483         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ ' 
    482484         ! 
    483          wn(:,:,jpk) = 0._wp                  ! bottom boundary condition: w=0 (set once for all) 
    484          ! 
    485       ENDIF 
    486       ! 
    487 !!gm BUG here !   hdivn will include the runoff divergence at the wrong timestep !!!! 
     485         ww(:,:,jpk) = 0._wp                  ! bottom boundary condition: w=0 (set once for all) 
     486         ! 
     487      ENDIF 
     488      ! 
     489!!gm BUG here !   hdiv will include the runoff divergence at the wrong timestep !!!! 
    488490      CALL div_hor( kt, Kmm )                         ! Horizontal divergence & Relative vorticity 
    489491      ! 
     
    496498      zhdiv(:,:) = 0._wp 
    497499      DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports 
    498         zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
     500        zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
    499501      END DO 
    500502      !                                                ! Sea surface elevation time stepping 
     
    502504      ! because emp_b field is initialized with the vlaues of emp field. Hence, 0.5 * ( emp + emp_b ) = emp 
    503505      z1_rau0 = 0.5 / rau0 
    504       ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1) 
     506      ssh(:,:,Krhs) = (  ssh(:,:,Kbb) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1) 
    505507 
    506508      IF( .NOT.ln_dynspg_ts ) THEN 
     
    511513#endif 
    512514         IF( ln_bdy ) THEN 
    513             ssha(:,:) = ssha(:,:) * bdytmask(:,:) 
    514             CALL lbc_lnk( 'trcsub', ssha, 'T', 1. )  
     515            ssh(:,:,Krhs) = ssh(:,:,Krhs) * bdytmask(:,:) 
     516            CALL lbc_lnk( 'trcsub', ssh(:,:,Krhs), 'T', 1. )  
    515517         ENDIF 
    516518      ENDIF 
     
    522524      DO jk = jpkm1, 1, -1                             ! integrate from the bottom the hor. divergence 
    523525         ! - ML - need 3 lines here because replacement of e3t by its expression yields too long lines otherwise 
    524          wn(:,:,jk) = wn(:,:,jk+1) -   e3t_n(:,:,jk) * hdivn(:,:,jk)        & 
    525             &                      - ( e3t_a(:,:,jk) - e3t_b(:,:,jk) )    & 
     526         ww(:,:,jk) = ww(:,:,jk+1) -   e3t(:,:,jk,Kmm ) * hdiv(:,:,jk)          & 
     527            &                      - ( e3t(:,:,jk,Krhs) - e3t (:,:,jk,Kbb) )    & 
    526528            &                         * tmask(:,:,jk) * z1_2dt 
    527          IF( ln_bdy ) wn(:,:,jk) = wn(:,:,jk) * bdytmask(:,:) 
     529         IF( ln_bdy ) ww(:,:,jk) = ww(:,:,jk) * bdytmask(:,:) 
    528530      END DO 
    529531      ! 
     
    588590   !!---------------------------------------------------------------------- 
    589591CONTAINS 
    590    SUBROUTINE trc_sub_stp( kt )        ! Empty routine 
     592   SUBROUTINE trc_sub_stp( kt, Kbb, Kmm, Krhs )        ! Empty routine 
     593      INTEGER, INTENT( in ) ::   Kbb, Kmm, Krhs  ! time level indices 
    591594      WRITE(*,*) 'trc_sub_stp: You should not have seen this print! error?', kt 
    592595   END SUBROUTINE trc_sub_stp 
    593    SUBROUTINE trc_sub_ini        ! Empty routine 
     596   SUBROUTINE trc_sub_ini( Kmm )        ! Empty routine 
     597      INTEGER, INTENT( in ) ::   Kmm    ! time level index 
    594598      WRITE(*,*) 'trc_sub_ini: You should not have seen this print! error?', kt 
    595599   END SUBROUTINE trc_sub_ini 
Note: See TracChangeset for help on using the changeset viewer.