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 5758 for branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2015-09-24T08:31:40+02:00 (9 years ago)
Author:
gm
Message:

#1593: LDF-ADV, step II.1: phasing the improvements/simplifications of diffusive trend (see wiki)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/step.F90

    r5656 r5758  
    2424   !!             -   !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA 
    2525   !!            3.4  !  2011-04  (G. Madec, C. Ethe) Merge of dtatem and dtasal 
    26    !!                 !  2012-07  (J. Simeon, G. Madec, C. Ethe) Online coarsening of outputs 
    27    !!            3.7  !  2014-04  (F. Roquet, G. Madec) New equations of state 
     26   !!            3.6  !  2012-07  (J. Simeon, G. Madec. C. Ethe)  Online coarsening of outputs 
     27   !!            3.6  !  2014-04  (F. Roquet, G. Madec) New equations of state 
     28   !!            3.7  !  2014-10  (G. Madec)  LDF simplication  
     29   !!             -   !  2014-12  (G. Madec) remove KPP scheme 
    2830   !!---------------------------------------------------------------------- 
    2931 
     
    3739   PRIVATE 
    3840 
    39    PUBLIC   stp   ! called by opa.F90 
     41   PUBLIC   stp   ! called by nemogcm.F90 
    4042 
    4143   !! * Substitutions 
     
    4345!!gm   #  include "zdfddm_substitute.h90" 
    4446   !!---------------------------------------------------------------------- 
    45    !! NEMO/OPA 3.7 , NEMO Consortium (2014) 
     47   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
    4648   !! $Id$ 
    4749   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    7678      INTEGER ::   kcall    ! optional integer argument (dom_vvl_sf_nxt) 
    7779      !! --------------------------------------------------------------------- 
    78  
    7980#if defined key_agrif 
    8081      kstp = nit000 + Agrif_Nb_Step() 
    81       IF ( lk_agrif_debug ) THEN 
    82          IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
    83          IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 
    84       ENDIF 
    85  
    86       IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 
    87  
     82      IF( lk_agrif_debug ) THEN 
     83         IF( Agrif_Root() .and. lwp)   WRITE(*,*) '---' 
     84         IF(lwp)   WRITE(*,*) 'Grid Number', Agrif_Fixed(),' time step ', kstp, 'int tstep', Agrif_NbStepint() 
     85      ENDIF 
     86      IF( kstp == nit000 + 1 )   lk_agrif_fstep = .FALSE. 
    8887# if defined key_iomput 
    8988      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( cxios_context ) 
    9089# endif 
    9190#endif 
    92                              indic = 0           ! reset to no error condition 
    93       IF( kstp == nit000 ) THEN 
    94          ! must be done after nemo_init for AGRIF+XIOS+OASIS 
    95                       CALL iom_init(      cxios_context          )  ! iom_put initialization 
    96          IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" )  ! initialize context for coarse grid 
    97       ENDIF 
    98  
     91      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     92      ! update I/O and calendar  
     93      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     94                             indic = 0                ! reset to no error condition 
     95                              
     96      IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     97                             CALL iom_init(      cxios_context          )  ! for model grid (including passible AGRIF zoom) 
     98         IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid 
     99      ENDIF 
    99100      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init) 
    100                              CALL iom_setkt( kstp - nit000 + 1,      cxios_context          )   ! tell iom we are at time step kstp 
    101       IF( ln_crs     )       CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell iom we are at time step kstp 
    102  
    103       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    104       ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    105       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    106       IF( lk_tide    )   CALL sbc_tide( kstp ) 
    107       IF( lk_bdy     )  THEN 
    108          IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib  
    109                          CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    110       ENDIF 
    111                          CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    112                                                       ! clem: moved here for bdy ice purpose 
     101                             CALL iom_setkt( kstp - nit000 + 1,      cxios_context          )   ! tell IOM we are at time step kstp 
     102      IF( ln_crs         )   CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell IOM we are at time step kstp 
     103 
     104      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     105      ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 
     106      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     107      IF( lk_tide    )   CALL sbc_tide( kstp )                   ! update tide potential 
     108      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                   ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
     109      IF( lk_bdy     )   CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
     110                         CALL sbc     ( kstp )                   ! Sea Boundary Condition (including sea-ice) 
     111CALL FLUSH    ( numout ) 
    113112      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    114113      ! Update stochastic parameters and random T/S fluctuations 
    115114      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    116                         CALL sto_par( kstp )          ! Stochastic parameters 
     115                         CALL sto_par( kstp )          ! Stochastic parameters 
     116CALL FLUSH    ( numout ) 
    117117 
    118118      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    124124                         CALL bn2    ( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 
    125125                         CALL bn2    ( tsn, rab_n, rn2  ) ! now    Brunt-Vaisala frequency 
     126CALL FLUSH    ( numout ) 
    126127      ! 
    127128      !  VERTICAL PHYSICS 
     
    131132      IF( lk_zdftke  )   CALL zdf_tke( kstp )            ! TKE closure scheme for Kz 
    132133      IF( lk_zdfgls  )   CALL zdf_gls( kstp )            ! GLS closure scheme for Kz 
    133       IF( lk_zdfkpp  )   CALL zdf_kpp( kstp )            ! KPP closure scheme for Kz 
    134134      IF( lk_zdfcst  ) THEN                              ! Constant Kz (reset avt, avm[uv] to the background value) 
    135135         avt (:,:,:) = rn_avt0 * wmask (:,:,:) 
     
    137137         avmv(:,:,:) = rn_avm0 * wvmask(:,:,:) 
    138138      ENDIF 
     139CALL FLUSH    ( numout ) 
    139140      IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths 
    140          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO 
     141         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO 
    141142      ENDIF 
    142143      IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity 
     
    144145      IF( lk_zdftmx  )   CALL zdf_tmx( kstp )         ! tidal vertical mixing 
    145146 
    146       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    147          &               CALL zdf_ddm( kstp )         ! double diffusive mixing 
     147      IF( lk_zdfddm  )   CALL zdf_ddm( kstp )         ! double diffusive mixing 
    148148 
    149149                         CALL zdf_mxl( kstp )         ! mixed layer depth 
     
    152152      IF( lrst_oce .AND. lk_zdftke )   CALL tke_rst( kstp, 'WRITE' ) 
    153153      IF( lrst_oce .AND. lk_zdfgls )   CALL gls_rst( kstp, 'WRITE' ) 
     154CALL FLUSH    ( numout ) 
    154155      ! 
    155156      !  LATERAL  PHYSICS 
    156157      ! 
    157       IF( lk_ldfslp ) THEN                            ! slope of lateral mixing 
     158      IF( l_ldfslp ) THEN                             ! slope of lateral mixing 
     159!!gm : why this here ???? 
    158160         IF(ln_sto_eos ) CALL sto_pts( tsn )          ! Random T/S fluctuations 
     161!!gm 
    159162                         CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
     163 
    160164         IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
    161165            &            CALL zps_hde    ( kstp, jpts, tsb, gtsu, gtsv,  &  ! Partial steps: before horizontal gradient 
    162166            &                                          rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
     167 
    163168         IF( ln_zps .AND.       ln_isfcav)                               & 
    164             &            CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, &    ! Partial steps for top cell (ISF) 
     169            &            CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, gtui, gtvi,  &    ! Partial steps for top cell (ISF) 
    165170            &                                          rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    166             &                                   gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the first ocean level 
    167          IF( ln_traldf_grif ) THEN                           ! before slope for Griffies operator 
    168                          CALL ldf_slp_grif( kstp ) 
    169          ELSE 
    170                          CALL ldf_slp( kstp, rhd, rn2b )     ! before slope for Madec operator 
     171            &                                   grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the first ocean level 
     172 
     173         IF( ln_traldf_triad ) THEN  
     174                         CALL ldf_slp_triad( kstp )                       ! before slope for triad operator 
     175         ELSE      
     176                         CALL ldf_slp     ( kstp, rhd, rn2b )             ! before slope for standard operator 
    171177         ENDIF 
    172178      ENDIF 
    173 #if defined key_traldf_c2d 
    174       IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )      ! eddy induced velocity coefficient 
    175 #endif 
    176 #if defined key_traldf_c3d && defined key_traldf_smag 
    177                           CALL ldf_tra_smag( kstp )      ! eddy induced velocity coefficient 
    178 #  endif 
    179 #if defined key_dynldf_c3d && defined key_dynldf_smag 
    180                           CALL ldf_dyn_smag( kstp )      ! eddy induced velocity coefficient 
    181 #  endif 
     179      !                                               ! eddy diffusivity coeff. and/or eiv coeff. 
     180      IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp )  
     181write(*,*) 'after ldf_slp' 
     182CALL FLUSH    ( numout ) 
    182183 
    183184      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    187188      IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors  
    188189                         CALL wzv           ( kstp )  ! now cross-level velocity  
     190write(*,*) 'after wzv' 
     191CALL FLUSH    ( numout ) 
    189192 
    190193      IF( lk_dynspg_ts ) THEN  
     
    192195          ! Note that the computation of vertical velocity above, hence "after" sea level 
    193196          ! is necessary to compute momentum advection for the rhs of barotropic loop: 
     197!!gm : why also here ???? 
    194198            IF(ln_sto_eos ) CALL sto_pts( tsn )                             ! Random T/S fluctuations 
     199!!gm 
    195200                            CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 
    196             IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
    197                &            CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
    198                &                                          rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
    199             IF( ln_zps .AND.       ln_isfcav)                               & 
    200                &            CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
     201                             
     202            IF( ln_zps .AND. .NOT. ln_isfcav)   &                           ! Partial steps: bottom before horizontal gradient 
     203               &            CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &  ! of t, s, rd at the last ocean level 
     204               &                                          rhd, gru , grv    ) 
     205            IF( ln_zps .AND.       ln_isfcav)   &                           ! Partial steps: top & bottom before horizontal gradient 
     206               &            CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi,   &  
    201207               &                                          rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    202                &                                   gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
    203  
    204                                   ua(:,:,:) = 0.e0             ! set dynamics trends to zero 
    205                                   va(:,:,:) = 0.e0 
     208               &                                               grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) 
     209 
     210                                  ua(:,:,:) = 0._wp            ! set dynamics trends to zero 
     211                                  va(:,:,:) = 0._wp 
    206212          IF(  lk_asminc .AND. ln_asmiau .AND. & 
    207213             & ln_dyninc       )  CALL dyn_asm_inc  ( kstp )   ! apply dynamics assimilation increment 
     
    225231                                  CALL wzv           ( kstp )  ! now cross-level velocity  
    226232      ENDIF 
     233write(*,*) 'after wzv 2' 
     234CALL FLUSH    ( numout ) 
    227235 
    228236      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    229237      ! diagnostics and outputs             (ua, va, tsa used as workspace) 
    230238      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    231       IF( lk_floats  )      CALL flo_stp( kstp )         ! drifting Floats 
    232       IF( lk_diahth  )      CALL dia_hth( kstp )         ! Thermocline depth (20 degres isotherm depth) 
    233       IF( .NOT. ln_cpl )    CALL dia_fwb( kstp )         ! Fresh water budget diagnostics 
    234       IF( lk_diadct  )      CALL dia_dct( kstp )         ! Transports 
    235       IF( lk_diaar5  )      CALL dia_ar5( kstp )         ! ar5 diag 
    236       IF( lk_diaharm )      CALL dia_harm( kstp )        ! Tidal harmonic analysis 
    237                             CALL dia_wri( kstp )         ! ocean model: outputs 
    238       ! 
    239       IF( ln_crs     )      CALL crs_fld( kstp )         ! ocean model: online field coarsening & output 
     239      IF( lk_floats  )   CALL flo_stp( kstp )         ! drifting Floats 
     240      IF( lk_diahth  )   CALL dia_hth( kstp )         ! Thermocline depth (20 degres isotherm depth) 
     241      IF(.NOT.ln_cpl )   CALL dia_fwb( kstp )         ! Fresh water budget diagnostics 
     242      IF( lk_diadct  )   CALL dia_dct( kstp )         ! Transports 
     243      IF( lk_diaar5  )   CALL dia_ar5( kstp )         ! ar5 diag 
     244      IF( lk_diaharm )   CALL dia_harm( kstp )        ! Tidal harmonic analysis 
     245                         CALL dia_wri( kstp )         ! ocean model: outputs 
     246      ! 
     247      IF( ln_crs     )   CALL crs_fld( kstp )         ! ocean model: online field coarsening & output 
    240248 
    241249#if defined key_top 
     
    245253                         CALL trc_stp( kstp )         ! time-stepping 
    246254#endif 
    247  
     255write(*,*) 'end dyn ' 
     256CALL FLUSH    ( numout ) 
    248257 
    249258      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    250259      ! Active tracers                              (ua, va used as workspace) 
    251260      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    252                              tsa(:,:,:,:) = 0.e0            ! set tracer trends to zero 
     261                             tsa(:,:,:,:) = 0._wp           ! set tracer trends to zero 
    253262 
    254263      IF(  lk_asminc .AND. ln_asmiau .AND. & 
     
    261270      IF( lk_bdy         )   CALL bdy_tra_dmp( kstp )       ! bdy damping trends 
    262271                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection 
    263       IF( lk_zdfkpp      )   CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes 
     272write(*,*) 'before tra_ldf' 
     273CALL FLUSH    ( numout ) 
    264274                             CALL tra_ldf    ( kstp )       ! lateral mixing 
    265  
     275write(*,*) 'after tra_ldf' 
     276CALL FLUSH    ( numout ) 
     277 
     278!!gm : why CALL to dia_ptr has been moved here??? (use trends info?) 
    266279      IF( ln_diaptr      )   CALL dia_ptr                   ! Poleward adv/ldf TRansports diagnostics 
     280!!gm 
    267281 
    268282#if defined key_agrif 
     
    274288         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    275289                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
     290!!gm : why again a call to sto_pts ??? 
    276291            IF( ln_sto_eos ) CALL sto_pts( tsn )                 ! Random T/S fluctuations 
     292!!gm 
    277293                             CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation 
    278294            IF( ln_zps .AND. .NOT. ln_isfcav)                                & 
     
    280296               &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
    281297            IF( ln_zps .AND.       ln_isfcav)                                & 
    282                &             CALL zps_hde_isf( kstp, jpts, tsa, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
     298               &             CALL zps_hde_isf( kstp, jpts, tsa, gtsu, gtsv, gtui, gtvi,  &    ! Partial steps for top/bottom cells 
    283299               &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    284                &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
     300               &                                                grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) 
    285301      ELSE                                                  ! centered hpg  (eos then time stepping) 
    286302         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
     303!!gm : why again a call to sto_pts ??? 
    287304            IF( ln_sto_eos ) CALL sto_pts( tsn )    ! Random T/S fluctuations 
     305!!gm 
    288306                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
    289307         IF( ln_zps .AND. .NOT. ln_isfcav)                                   & 
    290                &             CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
    291                &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
     308               &             CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: bottom before horizontal gradient 
     309               &                                           rhd, gru , grv    )    ! of t, s, rd at the last ocean level 
    292310         IF( ln_zps .AND.       ln_isfcav)                                   &  
    293                &             CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
     311               &             CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi,   &    ! Partial steps for top/bottom cells 
    294312               &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    295                &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
     313               &                                    grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
    296314         ENDIF 
    297315         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    298316                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
    299317      ENDIF 
     318write(*,*) 'after tra_nxt' 
     319CALL FLUSH    ( numout ) 
    300320 
    301321      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    315335                               CALL dyn_zdf( kstp )         ! vertical diffusion 
    316336      ELSE 
    317                                ua(:,:,:) = 0.e0             ! set dynamics trends to zero 
    318                                va(:,:,:) = 0.e0 
     337                               ua(:,:,:) = 0._wp            ! set dynamics trends to zero 
     338                               va(:,:,:) = 0._wp 
    319339 
    320340        IF(  lk_asminc .AND. ln_asmiau .AND. & 
     
    340360      IF( lk_vvl           )   CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    341361      ! 
     362write(*,*) 'after dom_vvl' 
     363CALL FLUSH    ( numout ) 
     364 
     365 
     366!!gm : This does not only concern the dynamics ==>>> add a new title 
     367!!gm2: why ouput restart before AGRIF update? 
    342368      IF( lrst_oce         )   CALL rst_write( kstp )       ! write output ocean restart file 
    343369 
     
    367393                 CALL iom_close( numror )     ! close input  ocean restart file 
    368394         IF(lwm) CALL FLUSH    ( numond )     ! flush output namelist oce 
    369          IF( lwm.AND.numoni /= -1 ) CALL FLUSH    ( numoni )     ! flush output namelist ice 
     395         IF(lwm.AND.numoni /= -1 )   & 
     396            &    CALL FLUSH    ( numoni )     ! flush output namelist ice (if exist) 
    370397      ENDIF 
    371398 
     
    373400      ! Coupled mode 
    374401      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     402!!gm why lk_oasis and not lk_cpl ???? 
    375403      IF( lk_oasis         )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
    376404      ! 
     
    383411      ! 
    384412      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
    385       !      
    386413      ! 
    387414   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.