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 9817 for branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2018-06-21T11:58:42+02:00 (6 years ago)
Author:
dancopsey
Message:

Merged in GO6 package branch up to revision 8356.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/step.F90

    r9816 r9817  
    3333   USE step_oce         ! time stepping definition modules 
    3434   USE iom 
     35   USE lbclnk 
    3536 
    3637   IMPLICIT NONE 
     
    5051 
    5152#if defined key_agrif 
    52    SUBROUTINE stp( ) 
     53   RECURSIVE SUBROUTINE stp( ) 
    5354      INTEGER             ::   kstp   ! ocean time-step index 
    5455#else 
     
    7374      !!---------------------------------------------------------------------- 
    7475      INTEGER ::   jk       ! dummy loop indice 
     76      INTEGER ::   tind     ! tracer loop index 
    7577      INTEGER ::   indic    ! error indicator if < 0 
    7678      INTEGER ::   kcall    ! optional integer argument (dom_vvl_sf_nxt) 
     
    7981#if defined key_agrif 
    8082      kstp = nit000 + Agrif_Nb_Step() 
    81 !      IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
    82 !      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp 
     83      IF ( lk_agrif_debug ) THEN 
     84         IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
     85         IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 
     86      ENDIF 
     87 
    8388      IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 
     89 
    8490# if defined key_iomput 
    8591      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( cxios_context ) 
     
    105111                         CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    106112      ENDIF 
     113 
     114      ! We must ensure that tsb halos are up to date on EVERY timestep. 
     115      DO tind = 1, jpts 
     116         CALL lbc_lnk( tsb(:,:,:,tind), 'T', 1. ) 
     117      END DO 
     118 
    107119                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    108120                                                      ! clem: moved here for bdy ice purpose 
     
    110122      ! Update stochastic parameters and random T/S fluctuations 
    111123      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    112                         CALL sto_par( kstp )          ! Stochastic parameters 
     124       IF( ln_sto_eos ) CALL sto_par( kstp )          ! Stochastic parameters 
     125       IF( ln_sto_eos ) CALL sto_pts( tsn  )          ! Random T/S fluctuations 
    113126 
    114127      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    152165      ! 
    153166      IF( lk_ldfslp ) THEN                            ! slope of lateral mixing 
    154          IF(ln_sto_eos ) CALL sto_pts( tsn )          ! Random T/S fluctuations 
    155167                         CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
    156168         IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    188200          ! Note that the computation of vertical velocity above, hence "after" sea level 
    189201          ! is necessary to compute momentum advection for the rhs of barotropic loop: 
    190             IF(ln_sto_eos ) CALL sto_pts( tsn )                             ! Random T/S fluctuations 
    191202                            CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 
    192203            IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    200211                                  ua(:,:,:) = 0.e0             ! set dynamics trends to zero 
    201212                                  va(:,:,:) = 0.e0 
    202           IF(  ln_asmiau .AND. & 
     213          IF(  lk_asminc .AND. ln_asmiau .AND. & 
    203214             & ln_dyninc       )  CALL dyn_asm_inc  ( kstp )   ! apply dynamics assimilation increment 
    204215          IF( ln_neptsimp )       CALL dyn_nept_cor ( kstp )   ! subtract Neptune velocities (simplified) 
     
    231242      IF( lk_diaar5  )      CALL dia_ar5( kstp )         ! ar5 diag 
    232243      IF( lk_diaharm )      CALL dia_harm( kstp )        ! Tidal harmonic analysis 
     244                            CALL dia_prod( kstp )        ! ocean model: product diagnostics 
    233245                            CALL dia_wri( kstp )         ! ocean model: outputs 
    234246      ! 
     
    248260                             tsa(:,:,:,:) = 0.e0            ! set tracer trends to zero 
    249261 
    250       IF(  ln_asmiau .AND. & 
     262      IF(  lk_asminc .AND. ln_asmiau .AND. & 
    251263         & ln_trainc     )   CALL tra_asm_inc( kstp )       ! apply tracer assimilation increment 
    252264                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
     
    270282         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    271283                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
    272             IF( ln_sto_eos ) CALL sto_pts( tsn )                 ! Random T/S fluctuations 
    273284                             CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation 
    274285            IF( ln_zps .AND. .NOT. ln_isfcav)                                & 
     
    281292      ELSE                                                  ! centered hpg  (eos then time stepping) 
    282293         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
    283             IF( ln_sto_eos ) CALL sto_pts( tsn )    ! Random T/S fluctuations 
    284294                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
    285295         IF( ln_zps .AND. .NOT. ln_isfcav)                                   & 
     
    314324                               va(:,:,:) = 0.e0 
    315325 
    316         IF(  ln_asmiau .AND. & 
     326        IF(  lk_asminc .AND. ln_asmiau .AND. & 
    317327           & ln_dyninc      )  CALL dyn_asm_inc( kstp )     ! apply dynamics assimilation increment 
    318328        IF( ln_bkgwri )        CALL asm_bkg_wri( kstp )     ! output background fields 
     
    335345                               CALL ssh_swp( kstp )         ! swap of sea surface height 
    336346      IF( lk_vvl           )   CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    337  
     347      ! 
     348      IF( lrst_oce         )   CALL rst_write( kstp )       ! write output ocean restart file 
     349      IF( ln_sto_eos       )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
     350 
     351#if defined key_agrif 
     352      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     353      ! AGRIF 
     354      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     355                               CALL Agrif_Integrate_ChildGrids( stp )   
     356 
     357      IF ( Agrif_NbStepint().EQ.0 ) THEN 
     358                               CALL Agrif_Update_Tra()      ! Update active tracers 
     359                               CALL Agrif_Update_Dyn()      ! Update momentum 
     360      ENDIF 
     361#endif 
    338362      IF( ln_diahsb        )   CALL dia_hsb( kstp )         ! - ML - global conservation diagnostics 
    339363      IF( lk_diaobs  )         CALL dia_obs( kstp )         ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
    340364 
    341365      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    342       ! Control and restarts 
     366      ! Control 
    343367      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    344368                               CALL stp_ctl( kstp, indic ) 
     
    352376         IF( lwm.AND.numoni /= -1 ) CALL FLUSH    ( numoni )     ! flush output namelist ice 
    353377      ENDIF 
    354       IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file 
    355378 
    356379      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    357380      ! Coupled mode 
    358381      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    359       IF( lk_oasis         )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
     382      !IF( lk_oasis         )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
    360383      ! 
    361384#if defined key_iomput 
     
    367390      ! 
    368391      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
     392      !      
    369393      ! 
    370394   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.