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 11949 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/step.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (4 years ago)
Author:
acc
Message:

Merge in changes from 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. This just creates a fresh copy of this branch to use as the merge base. See ticket #2341

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src

    • Property svn:mergeinfo deleted
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/step.F90

    r11536 r11949  
    3131   !!             -   !  2015-11  (J. Chanut) free surface simplification (remove filtered free surface) 
    3232   !!            4.0  !  2017-05  (G. Madec)  introduction of the vertical physics manager (zdfphy) 
     33   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 
    3334   !!---------------------------------------------------------------------- 
    3435 
     
    4445 
    4546   PUBLIC   stp   ! called by nemogcm.F90 
     47 
     48   !!---------------------------------------------------------------------- 
     49   !! time level indices 
     50   !!---------------------------------------------------------------------- 
     51   INTEGER, PUBLIC :: Nbb, Nnn, Naa, Nrhs          !! used by nemo_init 
    4652 
    4753   !!---------------------------------------------------------------------- 
     
    8288#if defined key_agrif 
    8389      kstp = nit000 + Agrif_Nb_Step() 
     90      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    8491      IF( lk_agrif_debug ) THEN 
    8592         IF( Agrif_Root() .and. lwp)   WRITE(*,*) '---' 
     
    110117      ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 
    111118      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    112       IF( ln_tide    )   CALL sbc_tide( kstp )                   ! update tide potential 
    113       IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                   ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
    114       IF( ln_bdy     )   CALL bdy_dta ( kstp, kt_offset = +1 )   ! update dynamic & tracer data at open boundaries 
    115                          CALL sbc     ( kstp )                   ! Sea Boundary Condition (including sea-ice) 
     119      IF( ln_tide    )   CALL sbc_tide( kstp )                        ! update tide potential 
     120      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
     121      IF( ln_bdy     )   CALL bdy_dta ( kstp, Nnn, kt_offset = +1 )   ! update dynamic & tracer data at open boundaries 
     122                         CALL sbc     ( kstp, Nbb, Nnn )              ! Sea Boundary Condition (including sea-ice) 
    116123 
    117124      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    119126      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    120127      IF( ln_sto_eos ) CALL sto_par( kstp )          ! Stochastic parameters 
    121       IF( ln_sto_eos ) CALL sto_pts( tsn  )          ! Random T/S fluctuations 
     128      IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn)  )          ! Random T/S fluctuations 
    122129 
    123130      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    125132      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    126133      !  THERMODYNAMICS 
    127                          CALL eos_rab( tsb, rab_b )       ! before local thermal/haline expension ratio at T-points 
    128                          CALL eos_rab( tsn, rab_n )       ! now    local thermal/haline expension ratio at T-points 
    129                          CALL bn2    ( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 
    130                          CALL bn2    ( tsn, rab_n, rn2  ) ! now    Brunt-Vaisala frequency 
     134                         CALL eos_rab( ts(:,:,:,:,Nbb), rab_b, Nnn )       ! before local thermal/haline expension ratio at T-points 
     135                         CALL eos_rab( ts(:,:,:,:,Nnn), rab_n, Nnn )       ! now    local thermal/haline expension ratio at T-points 
     136                         CALL bn2    ( ts(:,:,:,:,Nbb), rab_b, rn2b, Nnn ) ! before Brunt-Vaisala frequency 
     137                         CALL bn2    ( ts(:,:,:,:,Nnn), rab_n, rn2, Nnn  ) ! now    Brunt-Vaisala frequency 
    131138 
    132139      !  VERTICAL PHYSICS 
    133                          CALL zdf_phy( kstp )         ! vertical physics update (top/bot drag, avt, avs, avm + MLD) 
     140                         CALL zdf_phy( kstp, Nbb, Nnn, Nrhs )   ! vertical physics update (top/bot drag, avt, avs, avm + MLD) 
    134141 
    135142      !  LATERAL  PHYSICS 
    136143      ! 
    137144      IF( l_ldfslp ) THEN                             ! slope of lateral mixing 
    138                          CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
    139  
    140          IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
    141             &            CALL zps_hde    ( kstp, jpts, tsb, gtsu, gtsv,  &  ! Partial steps: before horizontal gradient 
    142             &                                          rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
    143  
    144          IF( ln_zps .AND.       ln_isfcav)                               & 
    145             &            CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF) 
    146             &                                          rhd, gru , grv , grui, grvi   )  ! of t, s, rd at the first ocean level 
     145                         CALL eos( ts(:,:,:,:,Nbb), rhd, gdept_0(:,:,:) )               ! before in situ density 
     146 
     147         IF( ln_zps .AND. .NOT. ln_isfcav)                                    & 
     148            &            CALL zps_hde    ( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv,  &  ! Partial steps: before horizontal gradient 
     149            &                                          rhd, gru , grv    )       ! of t, s, rd at the last ocean level 
     150 
     151         IF( ln_zps .AND.       ln_isfcav)                                                & 
     152            &            CALL zps_hde_isf( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF) 
     153            &                                          rhd, gru , grv , grui, grvi   )       ! of t, s, rd at the first ocean level 
    147154         IF( ln_traldf_triad ) THEN  
    148                          CALL ldf_slp_triad( kstp )                       ! before slope for triad operator 
     155                         CALL ldf_slp_triad( kstp, Nbb, Nnn )             ! before slope for triad operator 
    149156         ELSE      
    150                          CALL ldf_slp     ( kstp, rhd, rn2b )             ! before slope for standard operator 
     157                         CALL ldf_slp     ( kstp, rhd, rn2b, Nbb, Nnn )   ! before slope for standard operator 
    151158         ENDIF 
    152159      ENDIF 
    153       !                                                                   ! eddy diffusivity coeff. 
    154       IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp )       !       and/or eiv coeff. 
    155       IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp )       ! eddy viscosity coeff.  
     160      !                                                                        ! eddy diffusivity coeff. 
     161      IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp, Nbb, Nnn )  !       and/or eiv coeff. 
     162      IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff.  
    156163 
    157164      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    159166      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    160167 
    161                             CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_hor) 
    162       IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors  
    163                             CALL wzv           ( kstp )  ! now cross-level velocity  
    164       IF( ln_zad_Aimp )     CALL wAimp         ( kstp )  ! Adaptive-implicit vertical advection partitioning 
    165                             CALL eos    ( tsn, rhd, rhop, gdept_n(:,:,:) )  ! now in situ density for hpg computation 
     168                            CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )    ! after ssh (includes call to div_hor) 
     169      IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors  
     170                            CALL wzv           ( kstp, Nbb, Nnn, ww,  Naa )    ! now cross-level velocity  
     171      IF( ln_zad_Aimp )     CALL wAimp         ( kstp,      Nnn          )  ! Adaptive-implicit vertical advection partitioning 
     172                            CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation 
    166173                             
    167174                             
    168                          ua(:,:,:) = 0._wp            ! set dynamics trends to zero 
    169                          va(:,:,:) = 0._wp 
     175                         uu(:,:,:,Nrhs) = 0._wp            ! set dynamics trends to zero 
     176                         vv(:,:,:,Nrhs) = 0._wp 
    170177 
    171178      IF(  lk_asminc .AND. ln_asmiau .AND. ln_dyninc )   & 
    172                &         CALL dyn_asm_inc   ( kstp )  ! apply dynamics assimilation increment 
    173       IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp )  ! bdy damping trends 
     179               &         CALL dyn_asm_inc   ( kstp, Nbb, Nnn, uu, vv, Nrhs )  ! apply dynamics assimilation increment 
     180      IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends 
    174181#if defined key_agrif 
    175182      IF(.NOT. Agrif_Root())  &  
    176183               &         CALL Agrif_Sponge_dyn        ! momentum sponge 
    177184#endif 
    178                          CALL dyn_adv       ( kstp )  ! advection (vector or flux form) 
    179                          CALL dyn_vor       ( kstp )  ! vorticity term including Coriolis 
    180                          CALL dyn_ldf       ( kstp )  ! lateral mixing 
    181       IF( ln_zdfosm  )   CALL dyn_osm       ( kstp )  ! OSMOSIS non-local velocity fluxes 
    182                          CALL dyn_hpg       ( kstp )  ! horizontal gradient of Hydrostatic pressure 
    183                          CALL dyn_spg       ( kstp )  ! surface pressure gradient 
    184  
    185                                                       ! With split-explicit free surface, since now transports have been updated and ssha as well 
     185                         CALL dyn_adv( kstp, Nbb, Nnn      , uu, vv, Nrhs )  ! advection (VF or FF)   ==> RHS 
     186                         CALL dyn_vor( kstp,      Nnn      , uu, vv, Nrhs )  ! vorticity              ==> RHS 
     187                         CALL dyn_ldf( kstp, Nbb, Nnn      , uu, vv, Nrhs )  ! lateral mixing 
     188      IF( ln_zdfosm  )   CALL dyn_osm( kstp,      Nnn      , uu, vv, Nrhs )  ! OSMOSIS non-local velocity fluxes ==> RHS 
     189                         CALL dyn_hpg( kstp,      Nnn      , uu, vv, Nrhs )  ! horizontal gradient of Hydrostatic pressure 
     190                         CALL dyn_spg( kstp, Nbb, Nnn, Nrhs, uu, vv, ssh, uu_b, vv_b, Naa )  ! surface pressure gradient 
     191 
     192                                                      ! With split-explicit free surface, since now transports have been updated and ssh(:,:,Nrhs) as well 
    186193      IF( ln_dynspg_ts ) THEN                         ! vertical scale factors and vertical velocity need to be updated 
    187                             CALL div_hor    ( kstp )              ! Horizontal divergence  (2nd call in time-split case) 
    188          IF(.NOT.ln_linssh) CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component) 
    189       ENDIF 
    190                          CALL dyn_zdf       ( kstp )  ! vertical diffusion 
     194                            CALL div_hor       ( kstp, Nbb, Nnn )                ! Horizontal divergence  (2nd call in time-split case) 
     195         IF(.NOT.ln_linssh) CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn, Naa, kcall=2 )  ! after vertical scale factors (update depth average component) 
     196      ENDIF 
     197                         CALL dyn_zdf( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )      ! vertical diffusion    ==> after 
    191198 
    192199      IF( ln_dynspg_ts ) THEN                          
    193                             CALL wzv        ( kstp )              ! now cross-level velocity  
    194          IF( ln_zad_Aimp )  CALL wAimp      ( kstp )  ! Adaptive-implicit vertical advection partitioning 
    195       ENDIF 
     200                            CALL wzv        ( kstp, Nbb, Nnn, ww, Naa )          ! now cross-level velocity  
     201         IF( ln_zad_Aimp )  CALL wAimp      ( kstp,      Nnn )                   ! Adaptive-implicit vertical advection partitioning 
     202      ENDIF 
     203       
    196204 
    197205      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    198206      ! cool skin 
    199207      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    200       IF ( ln_diurnal )  CALL stp_diurnal( kstp ) 
     208      IF ( ln_diurnal )  CALL diurnal_layers( kstp ) 
    201209       
    202210      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    203211      ! diagnostics and outputs 
    204212      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    205       IF( ln_floats  )   CALL flo_stp ( kstp )        ! drifting Floats 
    206       IF( ln_diacfl  )   CALL dia_cfl ( kstp )        ! Courant number diagnostics 
    207       IF( lk_diahth  )   CALL dia_hth ( kstp )        ! Thermocline depth (20 degres isotherm depth) 
    208       IF( ln_diadct  )   CALL dia_dct ( kstp )        ! Transports 
    209                          CALL dia_ar5 ( kstp )        ! ar5 diag 
    210       IF( ln_diaharm )   CALL dia_harm( kstp )        ! Tidal harmonic analysis 
    211                          CALL dia_wri ( kstp )        ! ocean model: outputs 
    212       ! 
    213       IF( ln_crs     )   CALL crs_fld       ( kstp )  ! ocean model: online field coarsening & output 
     213      IF( ln_floats  )   CALL flo_stp ( kstp, Nbb, Nnn )   ! drifting Floats 
     214      IF( ln_diacfl  )   CALL dia_cfl ( kstp,      Nnn )   ! Courant number diagnostics 
     215      IF( lk_diahth  )   CALL dia_hth ( kstp,      Nnn )   ! Thermocline depth (20 degres isotherm depth) 
     216      IF( ln_diadct  )   CALL dia_dct ( kstp,      Nnn )   ! Transports 
     217                         CALL dia_ar5 ( kstp,      Nnn )   ! ar5 diag 
     218      IF( ln_diaharm )   CALL dia_harm( kstp,      Nnn )   ! Tidal harmonic analysis 
     219                         CALL dia_wri ( kstp,      Nnn )   ! ocean model: outputs 
     220      ! 
     221      IF( ln_crs     )   CALL crs_fld ( kstp,      Nnn )   ! ocean model: online field coarsening & output 
    214222       
    215223#if defined key_top 
     
    217225      ! Passive Tracer Model 
    218226      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    219                          CALL trc_stp       ( kstp )  ! time-stepping 
     227                         CALL trc_stp       ( kstp, Nbb, Nnn, Nrhs, Naa )  ! time-stepping 
    220228#endif 
    221229 
     
    223231      ! Active tracers                               
    224232      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    225                          tsa(:,:,:,:) = 0._wp         ! set tracer trends to zero 
     233                         ts(:,:,:,:,Nrhs) = 0._wp         ! set tracer trends to zero 
    226234 
    227235      IF(  lk_asminc .AND. ln_asmiau .AND. & 
    228          & ln_trainc )   CALL tra_asm_inc   ( kstp )  ! apply tracer assimilation increment 
    229                          CALL tra_sbc       ( kstp )  ! surface boundary condition 
    230       IF( ln_traqsr  )   CALL tra_qsr       ( kstp )  ! penetrative solar radiation qsr 
    231       IF( ln_trabbc  )   CALL tra_bbc       ( kstp )  ! bottom heat flux 
    232       IF( ln_trabbl  )   CALL tra_bbl       ( kstp )  ! advective (and/or diffusive) bottom boundary layer scheme 
    233       IF( ln_tradmp  )   CALL tra_dmp       ( kstp )  ! internal damping trends 
    234       IF( ln_bdy     )   CALL bdy_tra_dmp   ( kstp )  ! bdy damping trends 
     236         & ln_trainc )   CALL tra_asm_inc( kstp, Nbb, Nnn, ts, Nrhs )  ! apply tracer assimilation increment 
     237                         CALL tra_sbc    ( kstp,      Nnn, ts, Nrhs )  ! surface boundary condition 
     238      IF( ln_traqsr  )   CALL tra_qsr    ( kstp,      Nnn, ts, Nrhs )  ! penetrative solar radiation qsr 
     239      IF( ln_trabbc  )   CALL tra_bbc    ( kstp,      Nnn, ts, Nrhs )  ! bottom heat flux 
     240      IF( ln_trabbl  )   CALL tra_bbl    ( kstp, Nbb, Nnn, ts, Nrhs )  ! advective (and/or diffusive) bottom boundary layer scheme 
     241      IF( ln_tradmp  )   CALL tra_dmp    ( kstp, Nbb, Nnn, ts, Nrhs )  ! internal damping trends 
     242      IF( ln_bdy     )   CALL bdy_tra_dmp( kstp, Nbb,      ts, Nrhs )  ! bdy damping trends 
    235243#if defined key_agrif 
    236244      IF(.NOT. Agrif_Root())  &  
    237245               &         CALL Agrif_Sponge_tra        ! tracers sponge 
    238246#endif 
    239                          CALL tra_adv       ( kstp )  ! horizontal & vertical advection 
    240       IF( ln_zdfosm  )   CALL tra_osm       ( kstp )  ! OSMOSIS non-local tracer fluxes 
     247                         CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection ==> RHS 
     248      IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS 
    241249      IF( lrst_oce .AND. ln_zdfosm ) & 
    242            &             CALL osm_rst( kstp, 'WRITE' )! write OSMOSIS outputs + wn (so must do here) to restarts 
    243                          CALL tra_ldf       ( kstp )  ! lateral mixing 
     250           &             CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts 
     251                         CALL tra_ldf    ( kstp, Nbb, Nnn, ts, Nrhs )  ! lateral mixing 
    244252 
    245253!!gm : why CALL to dia_ptr has been moved here??? (use trends info?) 
    246       IF( ln_diaptr  )   CALL dia_ptr                 ! Poleward adv/ldf TRansports diagnostics 
     254      IF( ln_diaptr  )   CALL dia_ptr( Nnn )                           ! Poleward adv/ldf TRansports diagnostics 
    247255!!gm 
    248                          CALL tra_zdf       ( kstp )  ! vertical mixing and after tracer fields 
    249       IF( ln_zdfnpc  )   CALL tra_npc       ( kstp )  ! update after fields by non-penetrative convection 
    250  
    251       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    252       ! Set boundary conditions and Swap 
     256                         CALL tra_zdf    ( kstp, Nbb, Nnn, Nrhs, ts, Naa  )  ! vert. mixing & after tracer  ==> after 
     257      IF( ln_zdfnpc  )   CALL tra_npc    ( kstp,      Nnn, Nrhs, ts, Naa )  ! update after fields by non-penetrative convection 
     258 
     259      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     260      ! Set boundary conditions, time filter and swap time levels 
    253261      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    254262!!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap  
     
    265273!!    place. 
    266274!!  
    267 !!jc2: dynnxt must be the latest call. e3t_b are indeed updated in that routine 
    268                          CALL tra_nxt       ( kstp )  ! finalize (bcs) tracer fields at next time step and swap 
    269                          CALL dyn_nxt       ( kstp )  ! finalize (bcs) velocities at next time step and swap (always called after tra_nxt) 
    270                          CALL ssh_swp       ( kstp )  ! swap of sea surface height 
    271       IF(.NOT.ln_linssh) CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    272       ! 
    273       IF( ln_diahsb  )   CALL dia_hsb       ( kstp )  ! - ML - global conservation diagnostics 
     275!!jc2: dynnxt must be the latest call. e3t(:,:,:,Nbb) are indeed updated in that routine 
     276                         CALL tra_atf       ( kstp, Nbb, Nnn, Naa, ts )                      ! time filtering of "now" tracer arrays 
     277                         CALL dyn_atf       ( kstp, Nbb, Nnn, Naa, uu, vv, e3t, e3u, e3v  )  ! time filtering of "now" velocities and scale factors 
     278                         CALL ssh_atf       ( kstp, Nbb, Nnn, Naa, ssh )                     ! time filtering of "now" sea surface height 
     279      ! 
     280      ! Swap time levels 
     281      Nrhs = Nbb 
     282      Nbb = Nnn 
     283      Nnn = Naa 
     284      Naa = Nrhs 
     285      ! 
     286      IF(.NOT.ln_linssh) CALL dom_vvl_sf_update( kstp, Nbb, Nnn, Naa )  ! recompute vertical scale factors 
     287      ! 
     288      IF( ln_diahsb  )   CALL dia_hsb       ( kstp, Nbb, Nnn )  ! - ML - global conservation diagnostics 
    274289 
    275290!!gm : This does not only concern the dynamics ==>>> add a new title 
     
    278293!!jc: That would be better, but see comment above 
    279294!! 
    280       IF( lrst_oce   )   CALL rst_write    ( kstp )   ! write output ocean restart file 
     295      IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file 
    281296      IF( ln_sto_eos )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
    282297 
     
    285300      ! AGRIF 
    286301      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    287                          CALL Agrif_Integrate_ChildGrids( stp )  ! allows to finish all the Child Grids before updating 
    288  
    289                          IF( Agrif_NbStepint() == 0 ) CALL Agrif_update_all( ) ! Update all components 
    290 #endif 
    291       IF( ln_diaobs  )   CALL dia_obs      ( kstp )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
     302                         Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs      ! agrif_oce module copies of time level indices 
     303                         CALL Agrif_Integrate_ChildGrids( stp )       ! allows to finish all the Child Grids before updating 
     304 
     305                         IF( Agrif_NbStepint() == 0 ) THEN 
     306                            CALL Agrif_update_all( )                  ! Update all components 
     307                         ENDIF 
     308#endif 
     309      IF( ln_diaobs  )   CALL dia_obs      ( kstp, Nnn )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
    292310 
    293311      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    294312      ! Control 
    295313      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    296                          CALL stp_ctl      ( kstp, indic ) 
     314                         CALL stp_ctl      ( kstp, Nbb, Nnn, indic ) 
    297315                          
    298316      IF( kstp == nit000 ) THEN                          ! 1st time step only 
     
    306324      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    307325!!gm why lk_oasis and not lk_cpl ???? 
    308       IF( lk_oasis   )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
     326      IF( lk_oasis   )   CALL sbc_cpl_snd( kstp, Nbb, Nnn )        ! coupled mode : field exchanges 
    309327      ! 
    310328#if defined key_iomput 
     
    319337      ! 
    320338   END SUBROUTINE stp 
    321     
     339   ! 
    322340   !!====================================================================== 
    323341END MODULE step 
Note: See TracChangeset for help on using the changeset viewer.