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 6004 for branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90 – NEMO

Ignore:
Timestamp:
2015-12-04T17:05:58+01:00 (8 years ago)
Author:
gm
Message:

#1613: vvl by default, step III: Merge with the trunk (free surface simplification) (see wiki)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90

    r5866 r6004  
    1212 
    1313   !!---------------------------------------------------------------------- 
    14    !!   ssh_nxt        : after ssh 
    15    !!   ssh_swp        : filter ans swap the ssh arrays 
    16    !!   wzv            : compute now vertical velocity 
    17    !!---------------------------------------------------------------------- 
    18    USE oce             ! ocean dynamics and tracers variables 
    19    USE dom_oce         ! ocean space and time domain variables  
    20    USE sbc_oce         ! surface boundary condition: ocean 
    21    USE domvvl          ! Variable volume 
    22    USE divhor          ! horizontal divergence 
    23    USE phycst          ! physical constants 
    24    USE bdy_oce 
    25    USE bdy_par          
    26    USE bdydyn2d        ! bdy_ssh routine 
     14   !!   ssh_nxt       : after ssh 
     15   !!   ssh_swp       : filter ans swap the ssh arrays 
     16   !!   wzv           : compute now vertical velocity 
     17   !!---------------------------------------------------------------------- 
     18   USE oce            ! ocean dynamics and tracers variables 
     19   USE dom_oce        ! ocean space and time domain variables  
     20   USE sbc_oce        ! surface boundary condition: ocean 
     21   USE domvvl         ! Variable volume 
     22   USE divhor         ! horizontal divergence 
     23   USE phycst         ! physical constants 
     24   USE bdy_oce        !  
     25   USE bdy_par        ! 
     26   USE bdydyn2d       ! bdy_ssh routine 
    2727#if defined key_agrif 
    2828   USE agrif_opa_interp 
    2929#endif 
    3030#if defined key_asminc    
    31    USE asminc          ! Assimilation increment 
    32 #endif 
    33    USE in_out_manager  ! I/O manager 
    34    USE restart         ! only for lrst_oce 
    35    USE prtctl          ! Print control 
    36    USE lbclnk          ! ocean lateral boundary condition (or mpp link) 
    37    USE lib_mpp         ! MPP library 
    38    USE wrk_nemo        ! Memory Allocation 
    39    USE timing          ! Timing 
     31   USE   asminc       ! Assimilation increment 
     32#endif 
     33   ! 
     34   USE in_out_manager ! I/O manager 
     35   USE restart        ! only for lrst_oce 
     36   USE prtctl         ! Print control 
     37   USE lbclnk         ! ocean lateral boundary condition (or mpp link) 
     38   USE lib_mpp        ! MPP library 
     39   USE wrk_nemo       ! Memory Allocation 
     40   USE timing         ! Timing 
    4041 
    4142   IMPLICIT NONE 
     
    105106      ssha(:,:) = (  sshb(:,:) - z2dt * ( zcoef * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * ssmask(:,:) 
    106107 
    107 #if ! defined key_dynspg_ts 
    108       ! These lines are not necessary with time splitting since 
    109       ! boundary condition on sea level is set during ts loop 
     108      IF ( .NOT.ln_dynspg_ts ) THEN 
     109         ! These lines are not necessary with time splitting since 
     110         ! boundary condition on sea level is set during ts loop 
    110111# if defined key_agrif 
    111       CALL agrif_ssh( kt ) 
     112         CALL agrif_ssh( kt ) 
    112113# endif 
    113114# if defined key_bdy 
    114       IF( lk_bdy ) THEN 
    115          CALL lbc_lnk( ssha, 'T', 1. )    ! Not sure that's necessary 
    116          CALL bdy_ssh( ssha )             ! Duplicate sea level across open boundaries 
    117       ENDIF 
     115         IF( lk_bdy ) THEN 
     116            CALL lbc_lnk( ssha, 'T', 1. )    ! Not sure that's necessary 
     117            CALL bdy_ssh( ssha )             ! Duplicate sea level across open boundaries 
     118         ENDIF 
    118119# endif 
    119 #endif 
     120      ENDIF 
    120121 
    121122#if defined key_asminc 
     
    193194         DO jk = jpkm1, 1, -1                       ! integrate from the bottom the hor. divergence 
    194195            ! computation of w 
    195             wn(:,:,jk) = wn(:,:,jk+1) - (   e3t_n(:,:,jk) * hdivn(:,:,jk) + zhdiv(:,:,jk)                    & 
    196                &                          + z1_2dt * ( e3t_a(:,:,jk) - e3t_b(:,:,jk) ) ) * tmask(:,:,jk) 
     196            wn(:,:,jk) = wn(:,:,jk+1) - (  e3t_n(:,:,jk) * hdivn(:,:,jk) + zhdiv(:,:,jk)    & 
     197               &                         + z1_2dt * ( e3t_a(:,:,jk) - e3t_b(:,:,jk) )    ) * tmask(:,:,jk) 
    197198         END DO 
    198199         !          IF( ln_vvl_layer ) wn(:,:,:) = 0.e0 
     
    201202         DO jk = jpkm1, 1, -1                       ! integrate from the bottom the hor. divergence 
    202203            ! computation of w 
    203             wn(:,:,jk) = wn(:,:,jk+1) - (   e3t_n(:,:,jk) * hdivn(:,:,jk)                                   & 
    204                &                          + z1_2dt * ( e3t_a(:,:,jk) - e3t_b(:,:,jk) ) ) * tmask(:,:,jk) 
     204            wn(:,:,jk) = wn(:,:,jk+1) - (  e3t_n(:,:,jk) * hdivn(:,:,jk)                 & 
     205               &                         + z1_2dt * ( e3t_a(:,:,jk) - e3t_b(:,:,jk) ) ) * tmask(:,:,jk) 
    205206         END DO 
    206207      ENDIF 
     
    239240      !!---------------------------------------------------------------------- 
    240241      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     242      ! 
     243      REAL(wp) ::   zcoef   ! local scalar 
    241244      !!---------------------------------------------------------------------- 
    242245      ! 
     
    248251         IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
    249252      ENDIF 
    250  
    251 # if defined key_dynspg_ts 
    252       IF( ( neuler == 0 .AND. kt == nit000 ) .OR. ln_bt_fw ) THEN    !** Euler time-stepping: no filter 
    253 # else 
    254       IF ( neuler == 0 .AND. kt == nit000 ) THEN   !** Euler time-stepping at first time-step : no filter 
    255 #endif 
    256          sshb(:,:) = sshn(:,:)                           ! before <-- now 
    257          sshn(:,:) = ssha(:,:)                           ! now    <-- after  (before already = now) 
     253      !              !==  Euler time-stepping: no filter, just swap  ==! 
     254      IF(  ( neuler == 0 .AND. kt == nit000 ) .OR.    & 
     255         & ( ln_bt_fw    .AND. ln_dynspg_ts )      ) THEN  
     256         sshb(:,:) = sshn(:,:)                              ! before <-- now 
     257         sshn(:,:) = ssha(:,:)                              ! now    <-- after  (before already = now) 
    258258         ! 
    259       ELSE                                         !** Leap-Frog time-stepping: Asselin filter + swap 
    260          sshb(:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + ssha(:,:) )     ! before <-- now filtered 
    261          IF( .NOT.ln_linssh )   sshb(:,:) = sshb(:,:) - atfp * rdt / rau0 * ( emp_b(:,:)    - emp(:,:)    & 
    262                                 &                                 - rnf_b(:,:)    + rnf(:,:)    & 
    263                                 &                                 + fwfisf_b(:,:) - fwfisf(:,:) ) * ssmask(:,:) 
    264          sshn(:,:) = ssha(:,:)                           ! now <-- after 
     259      ELSE           !==  Leap-Frog time-stepping: Asselin filter + swap  ==! 
     260         !                                                  ! before <-- now filtered 
     261         sshb(:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + ssha(:,:) ) 
     262         IF( .NOT.ln_linssh ) THEN                          ! before <-- with forcing removed 
     263            zcoef = atfp * rdt * r1_rau0 
     264            sshb(:,:) = sshb(:,:) - zcoef * (     emp_b(:,:) - emp   (:,:)   & 
     265               &                             -    rnf_b(:,:) + rnf   (:,:)   & 
     266               &                             + fwfisf_b(:,:) - fwfisf(:,:)   ) * ssmask(:,:) 
     267         ENDIF 
     268         sshn(:,:) = ssha(:,:)                              ! now <-- after 
    265269      ENDIF 
    266270      ! 
    267271      IF(ln_ctl)   CALL prt_ctl( tab2d_1=sshb, clinfo1=' sshb  - : ', mask1=tmask, ovlap=1 ) 
    268272      ! 
    269       IF( nn_timing == 1 )  CALL timing_stop('ssh_swp') 
     273      IF( nn_timing == 1 )   CALL timing_stop('ssh_swp') 
    270274      ! 
    271275   END SUBROUTINE ssh_swp 
Note: See TracChangeset for help on using the changeset viewer.