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

Ignore:
Timestamp:
2009-07-03T17:07:08+02:00 (15 years ago)
Author:
ctlod
Message:

ensure restartability of TKE2 in coupled mode + few minor bugs corrections, see ticket: #466

File:
1 edited

Legend:

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

    r1480 r1481  
    207207      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    208208      !----------------------------------------------------------------------- 
    209       IF( neuler == 0 .AND. kstp == nit000 ) THEN 
    210                         CALL bn2( tn, sn, rn2 )              ! now    Brunt-Vaisala frequency 
    211                         rn2b(:,:,:) = rn2(:,:,:) 
    212       ELSE 
    213                         rn2b(:,:,:) = rn2(:,:,:)             ! before Brunt-Vaisala frequency   
    214                         CALL bn2( tn, sn, rn2 )              ! now    Brunt-Vaisala frequency 
    215       ENDIF 
    216  
    217 #if defined key_zdftke2 
    218       IF ( ln_dynhpg_imp ) THEN 
    219       !----------------------------------------------------------------------- 
    220       !  LATERAL PHYSICS 
    221       !----------------------------------------------------------------------- 
    222                                CALL zdf_mxl( kstp )                 ! mixed layer depth 
    223          IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2b )      ! before slope of the lateral mixing 
    224 #  if defined key_traldf_c2d 
    225          IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
    226 #  endif 
    227       ENDIF 
    228 #endif 
     209 
     210                       CALL bn2( tb, sb, rn2b )              ! before Brunt-Vaisala frequency 
     211                       CALL bn2( tn, sn, rn2  )              ! now    Brunt-Vaisala frequency 
     212 
    229213      !----------------------------------------------------------------------- 
    230214      !  VERTICAL PHYSICS 
     
    260244                        CALL zdf_mxl( kstp )                 ! mixed layer depth 
    261245 
    262 #if defined key_zdftke2 
    263       IF( .NOT. ln_dynhpg_imp ) THEN 
    264                         CALL eos( tb, sb, rhd, rhop )        ! now (swap=before) in situ density for dynhpg module 
    265 #endif 
     246      IF( lrst_oce .AND. lk_zdftke2 )   &                    ! write tke2 information in the restart file 
     247         &               CALL tke2_rst( kstp, 'WRITE' ) 
     248 
    266249      !----------------------------------------------------------------------- 
    267250      !  LATERAL PHYSICS 
    268251      !----------------------------------------------------------------------- 
    269       IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2b )      ! before slope of the lateral mixing 
     252      IF( lk_ldfslp )   THEN  
     253                           CALL eos( tb, sb, rhd, rhop )          ! before in situ density 
     254         IF( ln_zps )      CALL zps_hde( kstp, tb, sb, rhd,  &    ! Partial steps: before horizontal gradient 
     255            &                                gtu, gsu, gru,  &    ! of t, s, rd at the last ocean level 
     256            &                                gtv, gsv, grv ) 
     257                               CALL ldf_slp( kstp, rhd, rn2b )      ! before slope of the lateral mixing 
     258      ENDIF 
    270259#if defined key_traldf_c2d 
    271260      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
    272261#  endif 
    273 #if defined key_zdftke2 
    274       ENDIF 
    275 #endif 
    276262 
    277263#if defined key_top 
     
    307293                             CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields 
    308294 
    309 #if ! defined key_zdftke2 
    310       IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection 
    311                              CALL tra_nxt    ( kstp )       ! tracer fields at next time step 
    312  
    313       IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg 
    314                                CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module 
    315          IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient 
    316             &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level 
    317             &                                     gtv, gsv, grv ) 
    318       ELSE                                                  ! centered hpg (default case) 
    319                                CALL eos( tb, sb, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module 
    320          IF( ln_zps    )       CALL zps_hde( kstp, tb, sb, rhd,   &   ! Partial steps: now horizontal gradient 
    321             &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level 
    322             &                                     gtv, gsv, grv ) 
    323       ENDIF 
    324 #else 
    325295      IF( .NOT. ln_dynhpg_imp  ) THEN                       ! centered hpg (default case) 
    326296                               CALL eos( tn, sn, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module 
     
    333303      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg 
    334304                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module 
    335          IF( lk_ldfslp     )   CALL bn2( ta, sa, rn2 )                ! Time-filtered Brunt-Vaisala frequency 
    336305         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient 
    337306            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level 
    338307            &                                     gtv, gsv, grv ) 
    339308      ENDIF 
    340 #endif 
     309 
    341310      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    342311      ! Dynamics 
     
    400369 
    401370      IF( lk_cpl )   CALL sbc_cpl_snd( kstp )                 ! coupled mode : field exchanges 
    402  
    403 #if defined key_zdftke2 
    404       IF( ( kstp == nitend ).AND.( lrst_oce ) )  THEN 
    405  
    406          CALL day( kstp+1 )             ! Calendar 
    407          !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    408          ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    409          !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    410                             CALL sbc    ( kstp+1 )         ! Sea Boundary Condition (including sea-ice) 
    411          !----------------------------------------------------------------------- 
    412          !  VERTICAL PHYSICS 
    413          !----------------------------------------------------------------------- 
    414          ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    415          !----------------------------------------------------------------------- 
    416                             CALL bn2( tn, sn, rn2 )            ! now Brunt-Vaisala frequency 
    417          !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
    418          IF( lk_zdftke2 )   CALL zdf_tke2 ( kstp+1 )           ! TKE2 closure scheme for Kz 
    419                             CALL rst_write( kstp+1 )           ! close the restart file 
    420       ENDIF 
    421 #endif 
     371      ! 
    422372      ! 
    423373   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.