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

Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/step.F90

    r14053 r14072  
    2727   !!            3.6  !  2014-04  (F. Roquet, G. Madec) New equations of state 
    2828   !!            3.6  !  2014-10  (E. Clementi, P. Oddo) Add Qiao vertical mixing in case of waves 
    29    !!            3.7  !  2014-10  (G. Madec)  LDF simplication  
     29   !!            3.7  !  2014-10  (G. Madec)  LDF simplication 
    3030   !!             -   !  2014-12  (G. Madec) remove KPP scheme 
    3131   !!             -   !  2015-11  (J. Chanut) free surface simplification (remove filtered free surface) 
     
    109109      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    110110      ! 
    111       IF( l_1st_euler ) THEN   
     111      IF( l_1st_euler ) THEN 
    112112         ! start or restart with Euler 1st time-step 
    113          rDt =  rn_Dt    
     113         rDt =  rn_Dt 
    114114         r1_Dt = 1._wp / rDt 
    115115      ENDIF 
    116116      ! 
    117117      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    118       ! update I/O and calendar  
     118      ! update I/O and calendar 
    119119      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    120120      IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     
    149149      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    150150      IF( ln_tide    )   CALL tide_update( kstp )                     ! update tide potential 
    151       IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
     151      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib) 
    152152      IF( ln_bdy     )   CALL bdy_dta ( kstp, Nnn )                   ! update dynamic & tracer data at open boundaries 
    153153      IF( ln_isf     )   CALL isf_stp ( kstp, Nnn ) 
     
    184184            &            CALL zps_hde_isf( kstp, Nnn, jpts, ts(:,:,:,:,Nbb), gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF) 
    185185            &                                          rhd, gru , grv , grui, grvi   )       ! of t, s, rd at the first ocean level 
    186          IF( ln_traldf_triad ) THEN  
     186         IF( ln_traldf_triad ) THEN 
    187187                         CALL ldf_slp_triad( kstp, Nbb, Nnn )             ! before slope for triad operator 
    188          ELSE      
     188         ELSE 
    189189                         CALL ldf_slp     ( kstp, rhd, rn2b, Nbb, Nnn )   ! before slope for standard operator 
    190190         ENDIF 
     
    192192      !                                                                        ! eddy diffusivity coeff. 
    193193      IF( l_ldftra_time .OR. l_ldfeiv_time )   CALL ldf_tra( kstp, Nbb, Nnn )  !       and/or eiv coeff. 
    194       IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff.  
     194      IF( l_ldfdyn_time                    )   CALL ldf_dyn( kstp, Nbb )       ! eddy viscosity coeff. 
    195195 
    196196      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    199199 
    200200                            CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )    ! after ssh (includes call to div_hor) 
    201       IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors  
    202                             CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )    ! now cross-level velocity  
     201      IF( .NOT.ln_linssh )  CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )    ! after vertical scale factors 
     202                            CALL wzv           ( kstp, Nbb, Nnn, Naa, ww  )    ! now cross-level velocity 
    203203      IF( ln_zad_Aimp )     CALL wAimp         ( kstp,      Nnn           )  ! Adaptive-implicit vertical advection partitioning 
    204204                            CALL eos    ( ts(:,:,:,:,Nnn), rhd, rhop, gdept(:,:,:,Nnn) )  ! now in situ density for hpg computation 
    205                              
    206                              
     205 
     206 
    207207                         uu(:,:,:,Nrhs) = 0._wp            ! set dynamics trends to zero 
    208208                         vv(:,:,:,Nrhs) = 0._wp 
     
    212212      IF( ln_bdy     )   CALL bdy_dyn3d_dmp ( kstp, Nbb,      uu, vv, Nrhs )  ! bdy damping trends 
    213213#if defined key_agrif 
    214       IF(.NOT. Agrif_Root())  &  
     214      IF(.NOT. Agrif_Root())  & 
    215215               &         CALL Agrif_Sponge_dyn        ! momentum sponge 
    216216#endif 
     
    229229                            CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )  ! vertical diffusion 
    230230      IF( ln_dynspg_ts ) THEN                                                       ! vertical scale factors and vertical velocity need to be updated 
    231                             CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! now cross-level velocity  
     231                            CALL wzv        ( kstp, Nbb, Nnn, Naa, ww )             ! now cross-level velocity 
    232232         IF( ln_zad_Aimp )  CALL wAimp      ( kstp,      Nnn )                      ! Adaptive-implicit vertical advection partitioning 
    233233      ENDIF 
    234        
     234 
    235235 
    236236      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    237237      ! cool skin 
    238       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     238      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    239239      IF ( ln_diurnal )  CALL diurnal_layers( kstp ) 
    240        
     240 
    241241      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    242242      ! diagnostics and outputs 
     
    252252      IF( lk_diadetide ) CALL dia_detide( kstp )                ! Weights computation for daily detiding of model diagnostics 
    253253      IF( lk_diamlr  )   CALL dia_mlr                           ! Update time used in multiple-linear-regression analysis 
    254        
     254 
    255255#if defined key_top 
    256256      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    261261 
    262262      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    263       ! Active tracers                               
     263      ! Active tracers 
    264264      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    265265      ! Loop over tile domains 
     
    294294 
    295295                            CALL tra_adv    ( kstp, Nbb, Nnn, ts, Nrhs )  ! hor. + vert. advection ==> RHS 
    296          IF( ln_zdfmfc  )   CALL tra_mfc    ( kstp, Nbb,      ts, Nrhs )  ! Mass Flux Convection  
     296         IF( ln_zdfmfc  )   CALL tra_mfc    ( kstp, Nbb,      ts, Nrhs )  ! Mass Flux Convection 
    297297         IF( ln_zdfosm  )   CALL tra_osm    ( kstp,      Nnn, ts, Nrhs )  ! OSMOSIS non-local tracer fluxes ==> RHS 
    298298         IF( lrst_oce .AND. ln_zdfosm ) & 
     
    308308      ! Set boundary conditions, time filter and swap time levels 
    309309      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    310 !!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap  
    311 !!    (and time filtering) after Agrif update. Then restart would be done after and would contain updated fields.  
    312 !!    If so:  
     310!!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap 
     311!!    (and time filtering) after Agrif update. Then restart would be done after and would contain updated fields. 
     312!!    If so: 
    313313!!    (i) no need to call agrif update at initialization time 
    314 !!    (ii) no need to update "before" fields  
     314!!    (ii) no need to update "before" fields 
    315315!! 
    316 !!    Apart from creating new tra_swp/dyn_swp routines, this however:  
    317 !!    (i) makes boundary conditions at initialization time computed from updated fields which is not the case between  
    318 !!    two restarts => restartability issue. One can circumvent this, maybe, by assuming "interface separation",  
    319 !!    e.g. a shift of the feedback interface inside child domain.  
     316!!    Apart from creating new tra_swp/dyn_swp routines, this however: 
     317!!    (i) makes boundary conditions at initialization time computed from updated fields which is not the case between 
     318!!    two restarts => restartability issue. One can circumvent this, maybe, by assuming "interface separation", 
     319!!    e.g. a shift of the feedback interface inside child domain. 
    320320!!    (ii) requires that all restart outputs of updated variables by agrif (e.g. passive tracers/tke/barotropic arrays) are done at the same 
    321321!!    place. 
    322 !!  
     322!! 
    323323!!jc2: dynnxt must be the latest call. e3t(:,:,:,Nbb) are indeed updated in that routine 
    324324                         CALL tra_atf       ( kstp, Nbb, Nnn, Naa, ts )                      ! time filtering of "now" tracer arrays 
     
    347347      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    348348      ! AGRIF recursive integration 
    349       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     349      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    350350                         Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs      ! agrif_oce module copies of time level indices 
    351351                         CALL Agrif_Integrate_ChildGrids( stp )       ! allows to finish all the Child Grids before updating 
     
    360360      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    361361      ! AGRIF update 
    362       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     362      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    363363      IF( Agrif_NbStepint() == 0 .AND. nstop == 0 ) THEN 
    364364                         CALL Agrif_update_all( )                  ! Update all components 
     
    370370      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    371371      ! File manipulation at the end of the first time step 
    372       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                          
     372      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    373373      IF( kstp == nit000 ) THEN                          ! 1st time step only 
    374374                                        CALL iom_close( numror )   ! close input  ocean restart file 
     
    386386      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    387387      ! Finalize contextes if end of simulation or error detected 
    388       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                          
    389       IF( kstp == nitend .OR. nstop > 0 ) THEN  
     388      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     389      IF( kstp == nitend .OR. nstop > 0 ) THEN 
    390390                      CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF 
    391          IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) !  
     391         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
    392392      ENDIF 
    393393#endif 
    394394      ! 
    395395      IF( l_1st_euler ) THEN         ! recover Leap-frog timestep 
    396          rDt = 2._wp * rn_Dt    
     396         rDt = 2._wp * rn_Dt 
    397397         r1_Dt = 1._wp / rDt 
    398          l_1st_euler = .FALSE.       
     398         l_1st_euler = .FALSE. 
    399399      ENDIF 
    400400      ! 
Note: See TracChangeset for help on using the changeset viewer.