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 12377 for NEMO/trunk/src/OCE/step.F90 – NEMO

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/OCE/step.F90

    r12276 r12377  
    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(*,*) '---' 
     
    100107                              
    101108      IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    102                              CALL iom_init(      cxios_context          )  ! for model grid (including passible AGRIF zoom) 
     109                             CALL iom_init( cxios_context, ld_closedef=.FALSE. )   ! for model grid (including passible AGRIF zoom) 
     110         IF( lk_diamlr   )   CALL dia_mlr_iom_init    ! with additional setup for multiple-linear-regression analysis 
     111                             CALL iom_init_closedef 
    103112         IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid 
    104113      ENDIF 
     
    108117 
    109118      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    110       ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 
    111       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    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      ! Update external forcing (tides, open boundaries, ice shelf interaction and surface boundary condition (including sea-ice) 
     120      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     121      IF( ln_tide    )   CALL tide_update( kstp )                     ! update tide potential 
     122      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
     123      IF( ln_bdy     )   CALL bdy_dta ( kstp, Nnn )                   ! update dynamic & tracer data at open boundaries 
     124      IF( ln_isf     )   CALL isf_stp ( kstp, Nnn ) 
     125                         CALL sbc     ( kstp, Nbb, Nnn )              ! Sea Boundary Condition (including sea-ice) 
    116126 
    117127      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    119129      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    120130      IF( ln_sto_eos ) CALL sto_par( kstp )          ! Stochastic parameters 
    121       IF( ln_sto_eos ) CALL sto_pts( tsn  )          ! Random T/S fluctuations 
     131      IF( ln_sto_eos ) CALL sto_pts( ts(:,:,:,:,Nnn)  )          ! Random T/S fluctuations 
    122132 
    123133      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    125135      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    126136      !  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 
     137                         CALL eos_rab( ts(:,:,:,:,Nbb), rab_b, Nnn )       ! before local thermal/haline expension ratio at T-points 
     138                         CALL eos_rab( ts(:,:,:,:,Nnn), rab_n, Nnn )       ! now    local thermal/haline expension ratio at T-points 
     139                         CALL bn2    ( ts(:,:,:,:,Nbb), rab_b, rn2b, Nnn ) ! before Brunt-Vaisala frequency 
     140                         CALL bn2    ( ts(:,:,:,:,Nnn), rab_n, rn2, Nnn  ) ! now    Brunt-Vaisala frequency 
    131141 
    132142      !  VERTICAL PHYSICS 
    133                          CALL zdf_phy( kstp )         ! vertical physics update (top/bot drag, avt, avs, avm + MLD) 
     143                         CALL zdf_phy( kstp, Nbb, Nnn, Nrhs )   ! vertical physics update (top/bot drag, avt, avs, avm + MLD) 
    134144 
    135145      !  LATERAL  PHYSICS 
    136146      ! 
    137147      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 
     148                         CALL eos( ts(:,:,:,:,Nbb), rhd, gdept_0(:,:,:) )               ! before in situ density 
     149 
     150         IF( ln_zps .AND. .NOT. ln_isfcav)                                    & 
     151            &            CALL zps_hde    ( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv,  &  ! Partial steps: before horizontal gradient 
     152            &                                          rhd, gru , grv    )       ! of t, s, rd at the last ocean level 
     153 
     154         IF( ln_zps .AND.       ln_isfcav)                                                & 
     155            &            CALL zps_hde_isf( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF) 
     156            &                                          rhd, gru , grv , grui, grvi   )       ! of t, s, rd at the first ocean level 
    147157         IF( ln_traldf_triad ) THEN  
    148                          CALL ldf_slp_triad( kstp )                       ! before slope for triad operator 
     158                         CALL ldf_slp_triad( kstp, Nbb, Nnn )             ! before slope for triad operator 
    149159         ELSE      
    150                          CALL ldf_slp     ( kstp, rhd, rn2b )             ! before slope for standard operator 
     160                         CALL ldf_slp     ( kstp, rhd, rn2b, Nbb, Nnn )   ! before slope for standard operator 
    151161         ENDIF 
    152162      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.  
     163      !                                                                        ! eddy diffusivity coeff. 
     164      IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp, Nbb, Nnn )  !       and/or eiv coeff. 
     165      IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff.  
     166 
    156167      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    157168      !  Ocean dynamics : hdiv, ssh, e3, u, v, w 
    158169      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    159170 
    160                             CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_hor) 
    161       IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors  
    162                             CALL wzv           ( kstp )  ! now cross-level velocity  
    163       IF( ln_zad_Aimp )     CALL wAimp         ( kstp )  ! Adaptive-implicit vertical advection partitioning 
    164                             CALL eos    ( tsn, rhd, rhop, gdept_n(:,:,:) )  ! now in situ density for hpg computation 
     171                            CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )    ! after ssh (includes call to div_hor) 
     172      IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors  
     173                            CALL wzv           ( kstp, Nbb, Nnn, ww,  Naa )    ! now cross-level velocity  
     174      IF( ln_zad_Aimp )     CALL wAimp         ( kstp,      Nnn          )  ! Adaptive-implicit vertical advection partitioning 
     175                            CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation 
    165176                             
    166177                             
    167                          ua(:,:,:) = 0._wp            ! set dynamics trends to zero 
    168                          va(:,:,:) = 0._wp 
     178                         uu(:,:,:,Nrhs) = 0._wp            ! set dynamics trends to zero 
     179                         vv(:,:,:,Nrhs) = 0._wp 
    169180 
    170181      IF(  lk_asminc .AND. ln_asmiau .AND. ln_dyninc )   & 
    171                &         CALL dyn_asm_inc   ( kstp )  ! apply dynamics assimilation increment 
    172       IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp )  ! bdy damping trends 
     182               &         CALL dyn_asm_inc   ( kstp, Nbb, Nnn, uu, vv, Nrhs )  ! apply dynamics assimilation increment 
     183      IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends 
    173184#if defined key_agrif 
    174185      IF(.NOT. Agrif_Root())  &  
    175186               &         CALL Agrif_Sponge_dyn        ! momentum sponge 
    176187#endif 
    177                          CALL dyn_adv       ( kstp )  ! advection (vector or flux form) 
    178                          CALL dyn_vor       ( kstp )  ! vorticity term including Coriolis 
    179                          CALL dyn_ldf       ( kstp )  ! lateral mixing 
    180       IF( ln_zdfosm  )   CALL dyn_osm       ( kstp )  ! OSMOSIS non-local velocity fluxes 
    181                          CALL dyn_hpg       ( kstp )  ! horizontal gradient of Hydrostatic pressure 
    182                          CALL dyn_spg       ( kstp )  ! surface pressure gradient 
    183  
    184                                                       ! With split-explicit free surface, since now transports have been updated and ssha as well 
     188                         CALL dyn_adv( kstp, Nbb, Nnn      , uu, vv, Nrhs )  ! advection (VF or FF)   ==> RHS 
     189                         CALL dyn_vor( kstp,      Nnn      , uu, vv, Nrhs )  ! vorticity              ==> RHS 
     190                         CALL dyn_ldf( kstp, Nbb, Nnn      , uu, vv, Nrhs )  ! lateral mixing 
     191      IF( ln_zdfosm  )   CALL dyn_osm( kstp,      Nnn      , uu, vv, Nrhs )  ! OSMOSIS non-local velocity fluxes ==> RHS 
     192                         CALL dyn_hpg( kstp,      Nnn      , uu, vv, Nrhs )  ! horizontal gradient of Hydrostatic pressure 
     193                         CALL dyn_spg( kstp, Nbb, Nnn, Nrhs, uu, vv, ssh, uu_b, vv_b, Naa )  ! surface pressure gradient 
     194 
     195                                                      ! With split-explicit free surface, since now transports have been updated and ssh(:,:,Nrhs) as well 
    185196      IF( ln_dynspg_ts ) THEN                         ! vertical scale factors and vertical velocity need to be updated 
    186                             CALL div_hor    ( kstp )              ! Horizontal divergence  (2nd call in time-split case) 
    187          IF(.NOT.ln_linssh) CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component) 
    188       ENDIF 
    189                             CALL dyn_zdf    ( kstp )  ! vertical diffusion 
    190       IF( ln_dynspg_ts ) THEN                         ! vertical scale factors and vertical velocity need to be updated 
    191                             CALL wzv        ( kstp )              ! now cross-level velocity  
    192          IF( ln_zad_Aimp )  CALL wAimp      ( kstp )  ! Adaptive-implicit vertical advection partitioning 
     197                            CALL div_hor       ( kstp, Nbb, Nnn )                ! Horizontal divergence  (2nd call in time-split case) 
     198         IF(.NOT.ln_linssh) CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn, Naa, kcall=2 )  ! after vertical scale factors (update depth average component) 
     199      ENDIF 
     200                            CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa )  ! vertical diffusion 
     201      IF( ln_dynspg_ts ) THEN                                                       ! vertical scale factors and vertical velocity need to be updated 
     202                            CALL wzv        ( kstp, Nbb, Nnn, ww, Naa )             ! now cross-level velocity  
     203         IF( ln_zad_Aimp )  CALL wAimp      ( kstp,      Nnn )                      ! Adaptive-implicit vertical advection partitioning 
    193204      ENDIF 
    194205       
     
    197208      ! cool skin 
    198209      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    199       IF ( ln_diurnal )  CALL stp_diurnal( kstp ) 
     210      IF ( ln_diurnal )  CALL diurnal_layers( kstp ) 
    200211       
    201212      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    202213      ! diagnostics and outputs 
    203214      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    204       IF( ln_floats  )   CALL flo_stp ( kstp )        ! drifting Floats 
    205       IF( ln_diacfl  )   CALL dia_cfl ( kstp )        ! Courant number diagnostics 
    206                          CALL dia_hth ( kstp )        ! Thermocline depth (20 degres isotherm depth) 
    207       IF( ln_diadct  )   CALL dia_dct ( kstp )        ! Transports 
    208                          CALL dia_ar5 ( kstp )        ! ar5 diag 
    209       IF( ln_diaptr  )   CALL dia_ptr                 ! Poleward adv/ldf TRansports diagnostics 
    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 
     215      IF( ln_floats  )   CALL flo_stp   ( kstp, Nbb, Nnn )      ! drifting Floats 
     216      IF( ln_diacfl  )   CALL dia_cfl   ( kstp,      Nnn )      ! Courant number diagnostics 
     217                         CALL dia_hth   ( kstp,      Nnn )      ! Thermocline depth (20 degres isotherm depth) 
     218      IF( ln_diadct  )   CALL dia_dct   ( kstp,      Nnn )      ! Transports 
     219                         CALL dia_ar5   ( kstp,      Nnn )      ! ar5 diag 
     220                         CALL dia_ptr   ( kstp,      Nnn )      ! Poleward adv/ldf TRansports diagnostics 
     221                         CALL dia_wri   ( kstp,      Nnn )      ! ocean model: outputs 
     222      IF( ln_crs     )   CALL crs_fld   ( kstp,      Nnn )      ! ocean model: online field coarsening & output 
     223      IF( lk_diadetide ) CALL dia_detide( kstp )                ! Weights computation for daily detiding of model diagnostics 
     224      IF( lk_diamlr  )   CALL dia_mlr                           ! Update time used in multiple-linear-regression analysis 
    214225       
    215226#if defined key_top 
     
    217228      ! Passive Tracer Model 
    218229      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    219                          CALL trc_stp       ( kstp )  ! time-stepping 
     230                         CALL trc_stp       ( kstp, Nbb, Nnn, Nrhs, Naa )  ! time-stepping 
    220231#endif 
    221232 
     
    223234      ! Active tracers                               
    224235      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    225                          tsa(:,:,:,:) = 0._wp         ! set tracer trends to zero 
     236                         ts(:,:,:,:,Nrhs) = 0._wp         ! set tracer trends to zero 
    226237 
    227238      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 
     239         & ln_trainc )   CALL tra_asm_inc( kstp, Nbb, Nnn, ts, Nrhs )  ! apply tracer assimilation increment 
     240                         CALL tra_sbc    ( kstp,      Nnn, ts, Nrhs )  ! surface boundary condition 
     241      IF( ln_traqsr  )   CALL tra_qsr    ( kstp,      Nnn, ts, Nrhs )  ! penetrative solar radiation qsr 
     242      IF( ln_isf     )   CALL tra_isf    ( kstp,      Nnn, ts, Nrhs )  ! ice shelf heat flux 
     243      IF( ln_trabbc  )   CALL tra_bbc    ( kstp,      Nnn, ts, Nrhs )  ! bottom heat flux 
     244      IF( ln_trabbl  )   CALL tra_bbl    ( kstp, Nbb, Nnn, ts, Nrhs )  ! advective (and/or diffusive) bottom boundary layer scheme 
     245      IF( ln_tradmp  )   CALL tra_dmp    ( kstp, Nbb, Nnn, ts, Nrhs )  ! internal damping trends 
     246      IF( ln_bdy     )   CALL bdy_tra_dmp( kstp, Nbb,      ts, Nrhs )  ! bdy damping trends 
    235247#if defined key_agrif 
    236248      IF(.NOT. Agrif_Root())  &  
    237249               &         CALL Agrif_Sponge_tra        ! tracers sponge 
    238250#endif 
    239                          CALL tra_adv       ( kstp )  ! horizontal & vertical advection 
    240       IF( ln_zdfosm  )   CALL tra_osm       ( kstp )  ! OSMOSIS non-local tracer fluxes 
     251                         CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection ==> RHS 
     252      IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS 
    241253      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 
    244  
    245                          CALL tra_zdf       ( kstp )  ! vertical mixing and after tracer fields 
    246       IF( ln_zdfnpc  )   CALL tra_npc       ( kstp )  ! update after fields by non-penetrative convection 
    247  
    248       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    249       ! Set boundary conditions and Swap 
     254           &             CALL osm_rst    ( kstp,      Nnn, 'WRITE'  )  ! write OSMOSIS outputs + ww (so must do here) to restarts 
     255                         CALL tra_ldf    ( kstp, Nbb, Nnn, ts, Nrhs )  ! lateral mixing 
     256 
     257                         CALL tra_zdf    ( kstp, Nbb, Nnn, Nrhs, ts, Naa )  ! vertical mixing and after tracer fields 
     258      IF( ln_zdfnpc  )   CALL tra_npc    ( kstp,      Nnn, Nrhs, ts, Naa )  ! update after fields by non-penetrative convection 
     259 
     260      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     261      ! Set boundary conditions, time filter and swap time levels 
    250262      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    251263!!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap  
     
    262274!!    place. 
    263275!!  
    264 !!jc2: dynnxt must be the latest call. e3t_b are indeed updated in that routine 
    265                          CALL tra_nxt       ( kstp )  ! finalize (bcs) tracer fields at next time step and swap 
    266                          CALL dyn_nxt       ( kstp )  ! finalize (bcs) velocities at next time step and swap (always called after tra_nxt) 
    267                          CALL ssh_swp       ( kstp )  ! swap of sea surface height 
    268       IF(.NOT.ln_linssh) CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    269       ! 
    270       IF( ln_diahsb  )   CALL dia_hsb       ( kstp )  ! - ML - global conservation diagnostics 
     276!!jc2: dynnxt must be the latest call. e3t(:,:,:,Nbb) are indeed updated in that routine 
     277                         CALL tra_atf       ( kstp, Nbb, Nnn, Naa, ts )                      ! time filtering of "now" tracer arrays 
     278                         CALL dyn_atf       ( kstp, Nbb, Nnn, Naa, uu, vv, e3t, e3u, e3v  )  ! time filtering of "now" velocities and scale factors 
     279                         CALL ssh_atf       ( kstp, Nbb, Nnn, Naa, ssh )                     ! time filtering of "now" sea surface height 
     280      ! 
     281      ! Swap time levels 
     282      Nrhs = Nbb 
     283      Nbb = Nnn 
     284      Nnn = Naa 
     285      Naa = Nrhs 
     286      ! 
     287      IF(.NOT.ln_linssh) CALL dom_vvl_sf_update( kstp, Nbb, Nnn, Naa )  ! recompute vertical scale factors 
     288      ! 
     289      IF( ln_diahsb  )   CALL dia_hsb       ( kstp, Nbb, Nnn )  ! - ML - global conservation diagnostics 
    271290 
    272291!!gm : This does not only concern the dynamics ==>>> add a new title 
     
    275294!!jc: That would be better, but see comment above 
    276295!! 
    277       IF( lrst_oce   )   CALL rst_write    ( kstp )   ! write output ocean restart file 
     296      IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file 
    278297      IF( ln_sto_eos )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
    279298 
     
    282301      ! AGRIF 
    283302      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    284                          CALL Agrif_Integrate_ChildGrids( stp )  ! allows to finish all the Child Grids before updating 
    285  
    286                          IF( Agrif_NbStepint() == 0 ) CALL Agrif_update_all( ) ! Update all components 
    287 #endif 
    288       IF( ln_diaobs  )   CALL dia_obs      ( kstp )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
     303                         Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs      ! agrif_oce module copies of time level indices 
     304                         CALL Agrif_Integrate_ChildGrids( stp )       ! allows to finish all the Child Grids before updating 
     305 
     306                         IF( Agrif_NbStepint() == 0 ) THEN 
     307                            CALL Agrif_update_all( )                  ! Update all components 
     308                         ENDIF 
     309#endif 
     310      IF( ln_diaobs  )   CALL dia_obs      ( kstp, Nnn )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
    289311 
    290312      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    291313      ! Control 
    292314      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    293                          CALL stp_ctl      ( kstp, indic ) 
     315                         CALL stp_ctl      ( kstp, Nbb, Nnn, indic ) 
    294316                          
    295317      IF( kstp == nit000 ) THEN                          ! 1st time step only 
     
    303325      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    304326!!gm why lk_oasis and not lk_cpl ???? 
    305       IF( lk_oasis   )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
     327      IF( lk_oasis   )   CALL sbc_cpl_snd( kstp, Nbb, Nnn )        ! coupled mode : field exchanges 
    306328      ! 
    307329#if defined key_iomput 
     
    316338      ! 
    317339   END SUBROUTINE stp 
    318     
     340   ! 
    319341   !!====================================================================== 
    320342END MODULE step 
Note: See TracChangeset for help on using the changeset viewer.