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

Ignore:
Timestamp:
2015-12-16T10:25:22+01:00 (9 years ago)
Author:
timgraham
Message:

Merged dev_r5836_noc2_VVL_BY_DEFAULT into branch

File:
1 edited

Legend:

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

    r5930 r6060  
    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 
     
    4748 
    4849   !! * Substitutions 
    49 #  include "domzgr_substitute.h90" 
    5050#  include "vectopt_loop_substitute.h90" 
    5151   !!---------------------------------------------------------------------- 
     
    9797      zhdiv(:,:) = 0._wp 
    9898      DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports 
    99         zhdiv(:,:) = zhdiv(:,:) + fse3t_n(:,:,jk) * hdivn(:,:,jk) 
     99        zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
    100100      END DO 
    101101      !                                                ! Sea surface elevation time stepping 
     
    194194         DO jk = jpkm1, 1, -1                       ! integrate from the bottom the hor. divergence 
    195195            ! computation of w 
    196             wn(:,:,jk) = wn(:,:,jk+1) - (   fse3t_n(:,:,jk) * hdivn(:,:,jk) + zhdiv(:,:,jk)                    & 
    197                &                          + z1_2dt * ( fse3t_a(:,:,jk) - fse3t_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) 
    198198         END DO 
    199199         !          IF( ln_vvl_layer ) wn(:,:,:) = 0.e0 
     
    202202         DO jk = jpkm1, 1, -1                       ! integrate from the bottom the hor. divergence 
    203203            ! computation of w 
    204             wn(:,:,jk) = wn(:,:,jk+1) - (   fse3t_n(:,:,jk) * hdivn(:,:,jk)                                   & 
    205                &                          + z1_2dt * ( fse3t_a(:,:,jk) - fse3t_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) 
    206206         END DO 
    207207      ENDIF 
     
    240240      !!---------------------------------------------------------------------- 
    241241      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     242      ! 
     243      REAL(wp) ::   zcoef   ! local scalar 
    242244      !!---------------------------------------------------------------------- 
    243245      ! 
     
    249251         IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
    250252      ENDIF 
    251  
    252       IF( ( neuler == 0 .AND. kt == nit000 ) .OR. ( ln_bt_fw .AND. ln_dynspg_ts ) ) THEN  
    253                                                    !** Euler time-stepping: no filter 
    254          sshb(:,:) = sshn(:,:)                           ! before <-- now 
    255          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) 
    256258         ! 
    257       ELSE                                         !** Leap-Frog time-stepping: Asselin filter + swap 
    258          sshb(:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + ssha(:,:) )     ! before <-- now filtered 
    259          IF( lk_vvl ) sshb(:,:) = sshb(:,:) - atfp * rdt / rau0 * ( emp_b(:,:)    - emp(:,:)    & 
    260                                 &                                 - rnf_b(:,:)    + rnf(:,:)    & 
    261                                 &                                 + fwfisf_b(:,:) - fwfisf(:,:) ) * ssmask(:,:) 
    262          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 
    263269      ENDIF 
    264270      ! 
    265271      IF(ln_ctl)   CALL prt_ctl( tab2d_1=sshb, clinfo1=' sshb  - : ', mask1=tmask, ovlap=1 ) 
    266272      ! 
    267       IF( nn_timing == 1 )  CALL timing_stop('ssh_swp') 
     273      IF( nn_timing == 1 )   CALL timing_stop('ssh_swp') 
    268274      ! 
    269275   END SUBROUTINE ssh_swp 
Note: See TracChangeset for help on using the changeset viewer.