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 1239 for trunk/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2008-12-31T10:35:35+01:00 (16 years ago)
Author:
ctlod
Message:

this version allows to stabilize the computation of En production term, see ticket: #281

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/step.F90

    r1218 r1239  
    8888   USE zdfbfr          ! bottom friction                  (zdf_bfr routine) 
    8989   USE zdftke          ! TKE vertical mixing              (zdf_tke routine) 
     90   USE zdftke2         ! TKE2 vertical mixing             (zdf_tke2 routine) 
    9091   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine) 
    9192   USE zdfddm          ! double diffusion mixing          (zdf_ddm routine) 
     
    202203      ! Ocean physics update 
    203204      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     205#if defined key_zdftke2 
     206      IF ( ln_dynhpg_imp ) THEN 
     207      !----------------------------------------------------------------------- 
     208      !  LATERAL PHYSICS 
     209      !----------------------------------------------------------------------- 
     210      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
     211      !----------------------------------------------------------------------- 
     212                               CALL zdf_mxl( kstp )                 ! mixed layer depth 
     213         IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing 
     214#  if defined key_traldf_c2d 
     215         IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
     216#  endif 
     217      ENDIF 
     218#endif 
    204219      !----------------------------------------------------------------------- 
    205220      !  VERTICAL PHYSICS 
     
    207222      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    208223      !----------------------------------------------------------------------- 
    209  
     224#if defined key_zdftke2 
     225                        CALL bn2( tn, sn, rn2 )              ! now Brunt-Vaisala frequency 
     226#else 
    210227                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
    211        
     228#endif 
    212229      !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
    213230      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz 
    214231 
    215       IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz 
     232      IF( lk_zdftke )   CALL zdf_tke ( kstp )                      ! TKE  closure scheme for Kz 
     233      IF( lk_zdftke2)   CALL zdf_tke2( kstp )                      ! TKE2 closure scheme for Kz 
    216234 
    217235      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP closure scheme for Kz 
     
    236254                        CALL zdf_mxl( kstp )                 ! mixed layer depth 
    237255 
    238  
     256#if defined key_zdftke2 
     257      IF( .NOT. ln_dynhpg_imp ) THEN 
     258                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
     259                        CALL eos( tb, sb, rhd, rhop )        ! now (swap=before) in situ density for dynhpg module 
     260#endif 
    239261      !----------------------------------------------------------------------- 
    240262      !  LATERAL PHYSICS 
     
    245267#if defined key_traldf_c2d 
    246268      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
     269#  endif 
     270#if defined key_zdftke2 
     271      ENDIF 
    247272#endif 
    248273 
     
    278303#endif 
    279304                             CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields 
     305 
     306#if ! defined key_zdftke2 
    280307      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection 
    281308                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step 
     
    292319            &                                     gtv, gsv, grv ) 
    293320      ENDIF 
    294  
     321#else 
     322      IF( .NOT. ln_dynhpg_imp  ) THEN                       ! centered hpg (default case) 
     323                               CALL eos( tn, sn, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module 
     324         IF( ln_zps    )       CALL zps_hde( kstp, tn, sn, rhd,   &   ! Partial steps: now horizontal gradient 
     325            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level 
     326            &                                     gtv, gsv, grv ) 
     327      ENDIF  
     328      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection 
     329                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step 
     330      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg 
     331                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module 
     332         IF( lk_ldfslp     )   CALL bn2( ta, sa, rn2 )                ! Time-filtered Brunt-Vaisala frequency 
     333         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient 
     334            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level 
     335            &                                     gtv, gsv, grv ) 
     336      ENDIF 
     337#endif 
    295338      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    296339      ! Dynamics 
     
    363406 
    364407      IF( lk_cpl )   CALL sbc_cpl_snd( kstp )                 ! coupled mode : field exchanges 
     408 
     409#if defined key_zdftke2 
     410      IF( ( kstp == nitend ).AND.( lrst_oce ) )  THEN 
     411 
     412         CALL day( kstp+1 )             ! Calendar 
     413         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     414         ! Update data, open boundaries, surface boundary condition (including sea-ice) 
     415         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     416                            CALL sbc    ( kstp+1 )         ! Sea Boundary Condition (including sea-ice) 
     417         !----------------------------------------------------------------------- 
     418         !  VERTICAL PHYSICS 
     419         !----------------------------------------------------------------------- 
     420         ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
     421         !----------------------------------------------------------------------- 
     422                            CALL bn2( tn, sn, rn2 )            ! now Brunt-Vaisala frequency 
     423         !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
     424         IF( lk_zdftke2 )   CALL zdf_tke2 ( kstp+1 )           ! TKE2 closure scheme for Kz 
     425                            CALL rst_write( kstp+1 )           ! close the restart file 
     426      ENDIF 
     427#endif 
    365428      ! 
    366429   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.