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 1870 for branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/sshwzv.F90 – NEMO

Ignore:
Timestamp:
2010-05-12T17:36:00+02:00 (14 years ago)
Author:
gm
Message:

ticket: #663 step-1 : introduce the modified forcing term

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/sshwzv.F90

    r1792 r1870  
    55   !!============================================================================== 
    66   !! History :  3.1  !  2009-02  (G. Madec, M. Leclair)  Original code 
     7   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  modified LF-RA  
    78   !!---------------------------------------------------------------------- 
    89 
     
    3738#  include "domzgr_substitute.h90" 
    3839#  include "vectopt_loop_substitute.h90" 
    39  
    40    !!---------------------------------------------------------------------- 
    41    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     40   !!---------------------------------------------------------------------- 
     41   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    4242   !! $Id$ 
    4343   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     
    5353      !!              and update the now vertical coordinate (lk_vvl=T). 
    5454      !! 
    55       !! ** Method  : - 
    56       !! 
    57       !!              - Using the incompressibility hypothesis, the vertical  
     55      !! ** Method  : - Using the incompressibility hypothesis, the vertical  
    5856      !!      velocity is computed by integrating the horizontal divergence   
    5957      !!      from the bottom to the surface minus the scale factor evolution. 
     
    6260      !! ** action  :   ssha    : after sea surface height 
    6361      !!                wn      : now vertical velocity 
    64       !! if lk_vvl=T:   sshu_a, sshv_a, sshf_a  : after sea surface height 
    65       !!                          at u-, v-, f-point s 
    66       !!                hu, hv, hur, hvr : ocean depth and its inverse at u-,v-points 
     62      !!                sshu_a, sshv_a, sshf_a  : after sea surface height (lk_vvl=T) 
     63      !!                hu, hv, hur, hvr        : ocean depth and its inverse at u-,v-points 
     64      !! 
     65      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
    6766      !!---------------------------------------------------------------------- 
    6867      USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace 
     
    7877 
    7978      IF( kt == nit000 ) THEN 
     79         ! 
    8080         IF(lwp) WRITE(numout,*) 
    8181         IF(lwp) WRITE(numout,*) 'ssh_wzv : after sea surface height and now vertical velocity ' 
     
    111111      ENDIF 
    112112 
    113       !                                           !------------------------------! 
    114       IF( lk_vvl ) THEN                           !  Update Now Vertical coord.  !   (only in vvl case) 
    115       !                                           !------------------------------! 
     113      !                                           !------------------------------------------! 
     114      IF( lk_vvl ) THEN                           !  Regridding: Update Now Vertical coord.  !   (only in vvl case) 
     115         !                                        !------------------------------------------! 
    116116         DO jk = 1, jpkm1 
    117             fsdept(:,:,jk) = fsdept_n(:,:,jk)          ! now local depths stored in fsdep. arrays 
     117            fsdept(:,:,jk) = fsdept_n(:,:,jk)         ! now local depths stored in fsdep. arrays 
    118118            fsdepw(:,:,jk) = fsdepw_n(:,:,jk) 
    119119            fsde3w(:,:,jk) = fsde3w_n(:,:,jk) 
    120120            ! 
    121             fse3t (:,:,jk) = fse3t_n (:,:,jk)          ! vertical scale factors stored in fse3. arrays 
     121            fse3t (:,:,jk) = fse3t_n (:,:,jk)         ! vertical scale factors stored in fse3. arrays 
    122122            fse3u (:,:,jk) = fse3u_n (:,:,jk) 
    123123            fse3v (:,:,jk) = fse3v_n (:,:,jk) 
     
    127127            fse3vw(:,:,jk) = fse3vw_n(:,:,jk) 
    128128         END DO 
    129          !                                             ! now ocean depth (at u- and v-points) 
    130          hu(:,:) = hu_0(:,:) + sshu_n(:,:) 
     129         ! 
     130         hu(:,:) = hu_0(:,:) + sshu_n(:,:)            ! now ocean depth (at u- and v-points) 
    131131         hv(:,:) = hv_0(:,:) + sshv_n(:,:) 
    132          !                                             ! now masked inverse of the ocean depth (at u- and v-points) 
     132         !                                            ! now masked inverse of the ocean depth (at u- and v-points) 
    133133         hur(:,:) = umask(:,:,1) / ( hu(:,:) + 1.e0 - umask(:,:,1) ) 
    134134         hvr(:,:) = vmask(:,:,1) / ( hv(:,:) + 1.e0 - vmask(:,:,1) ) 
     
    136136      ENDIF 
    137137 
    138                          CALL div_cur( kt )            ! Horizontal divergence & Relative vorticity 
    139       IF( n_cla == 1 )   CALL div_cla( kt )            ! Cross Land Advection (Update Hor. divergence) 
    140  
    141       ! set time step size (Euler/Leapfrog) 
    142       z2dt = 2. * rdt  
     138                         CALL div_cur( kt )           ! Horizontal divergence & Relative vorticity 
     139      IF( n_cla == 1 )   CALL div_cla( kt )           ! Cross Land Advection (Update Hor. divergence) 
     140 
     141      z2dt = 2. * rdt                                 ! set time step size (Euler/Leapfrog) 
    143142      IF( neuler == 0 .AND. kt == nit000 )   z2dt =rdt 
    144143 
    145       zraur = 1. / rau0 
    146  
    147144      !                                           !------------------------------! 
    148145      !                                           !   After Sea Surface Height   ! 
    149146      !                                           !------------------------------! 
     147      zraur = 0.5 / rau0 
     148      ! 
    150149      zhdiv(:,:) = 0.e0 
    151150      DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports 
    152151        zhdiv(:,:) = zhdiv(:,:) + fse3t(:,:,jk) * hdivn(:,:,jk) 
    153152      END DO 
    154  
    155153      !                                                ! Sea surface elevation time stepping 
    156       ssha(:,:) = (  sshb(:,:) - z2dt * ( zraur * emp(:,:) + zhdiv(:,:) )  ) * tmask(:,:,1) 
     154      ssha(:,:) = (  sshb(:,:) - z2dt * ( zraur * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1) 
    157155 
    158156#if defined key_obc 
    159       IF ( Agrif_Root() ) THEN  
     157      IF( Agrif_Root() ) THEN  
    160158         ssha(:,:) = ssha(:,:) * obctmsk(:,:) 
    161          CALL lbc_lnk( ssha, 'T', 1. )  ! absolutly compulsory !! (jmm) 
     159         CALL lbc_lnk( ssha, 'T', 1. )                ! absolutly compulsory !! (jmm) 
    162160      ENDIF 
    163161#endif 
    164  
    165162      !                                                ! Sea Surface Height at u-,v- and f-points (vvl case only) 
    166163      IF( lk_vvl ) THEN                                ! (required only in key_vvl case) 
     
    186183      !                                           !     Now Vertical Velocity    ! 
    187184      !                                           !------------------------------! 
    188       !                                                ! integrate from the bottom the hor. divergence 
    189       DO jk = jpkm1, 1, -1 
    190          wn(:,:,jk) = wn(:,:,jk+1) -    fse3t_n(:,:,jk) * hdivn(:,:,jk)   & 
    191               &                    - (  fse3t_a(:,:,jk)                   & 
    192               &                       - fse3t_b(:,:,jk) ) * tmask(:,:,jk) / z2dt 
     185      DO jk = jpkm1, 1, -1                             ! integrate from the bottom the hor. divergence 
     186         wn(:,:,jk) = wn(:,:,jk+1) -    fse3t_n(:,:,jk) * hdivn(:,:,jk)     & 
     187            &                      - (  fse3t_a(:,:,jk) - fse3t_b(:,:,jk) ) * tmask(:,:,jk) / z2dt 
    193188      END DO 
    194       ! 
     189 
     190      !                                           !------------------------------! 
     191      !                                           !           outputs            ! 
     192      !                                           !------------------------------! 
    195193      CALL iom_put( "woce", wn                    )   ! vertical velocity 
    196194      CALL iom_put( "ssh" , sshn                  )   ! sea surface height 
    197195      CALL iom_put( "ssh2", sshn(:,:) * sshn(:,:) )   ! square of sea surface height 
    198       IF( lk_diaar5 ) THEN 
     196      IF( lk_diaar5 ) THEN                            ! vertical mass transport & its square value 
    199197         z2d(:,:) = rau0 * e1t(:,:) * e2t(:,:) 
    200198         DO jk = 1, jpk 
    201199            z3d(:,:,jk) = wn(:,:,jk) * z2d(:,:) 
    202200         END DO 
    203          CALL iom_put( "w_masstr" , z3d                     )   !           vertical mass transport 
    204          CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) )   ! square of vertical mass transport 
    205       ENDIF 
     201         CALL iom_put( "w_masstr" , z3d                     )   
     202         CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) ) 
     203      ENDIF 
     204      ! 
     205      IF(ln_ctl)   CALL prt_ctl( tab2d_1=ssha, clinfo1=' ssha  - : ', mask1=tmask, ovlap=1 ) 
    206206      ! 
    207207   END SUBROUTINE ssh_wzv 
     
    216216      !!              ssha  already computed in ssh_wzv   
    217217      !! 
    218       !! ** Method  : - apply Asselin time fiter to now ssh and swap : 
    219       !!             sshn = ssha + atfp * ( sshb -2 sshn + ssha ) 
    220       !!             sshn = ssha 
     218      !! ** Method  : - apply Asselin time fiter to now ssh (excluding the forcing 
     219      !!              from the filter, see Leclair and Madec 2010) and swap : 
     220      !!                sshn = ssha + atfp * ( sshb -2 sshn + ssha ) 
     221      !!                            - atfp * rdt * ( emp_b - emp ) / rau0 
     222      !!                sshn = ssha 
    221223      !! 
    222224      !! ** action  : - sshb, sshn   : before & now sea surface height 
    223225      !!                               ready for the next time step 
    224       !!---------------------------------------------------------------------- 
    225       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    226       !! 
    227       INTEGER  ::   ji, jj               ! dummy loop indices 
     226      !! 
     227      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
     228      !!---------------------------------------------------------------------- 
     229      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     230      !! 
     231      INTEGER  ::   ji, jj   ! dummy loop indices 
     232      REAL(wp) ::   zec      ! temporary scalare 
    228233      !!---------------------------------------------------------------------- 
    229234 
     
    234239      ENDIF 
    235240 
    236       ! Time filter and swap of the ssh 
    237       ! ------------------------------- 
    238  
    239       IF( lk_vvl ) THEN      ! Variable volume levels :   ssh at t-, u-, v, f-points 
    240          !                   ! ---------------------- ! 
     241      !                       !--------------------------! 
     242      IF( lk_vvl ) THEN       !  Variable volume levels  !   ssh at t-, u-, v, f-points 
     243         !                    !--------------------------! 
    241244         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter 
    242245            sshn  (:,:) = ssha  (:,:)                        ! now <-- after  (before already = now) 
     
    247250            DO jj = 1, jpj 
    248251               DO ji = 1, jpi                                ! before <-- now filtered 
    249                   sshb  (ji,jj) = sshn(ji,jj)  + atfp * ( sshb  (ji,jj) - 2 * sshn  (ji,jj) + ssha  (ji,jj) ) 
     252                  sshb  (ji,jj) = sshn  (ji,jj) + atfp * ( sshb  (ji,jj) - 2 * sshn  (ji,jj) + ssha  (ji,jj) ) 
    250253                  sshu_b(ji,jj) = sshu_n(ji,jj) + atfp * ( sshu_b(ji,jj) - 2 * sshu_n(ji,jj) + sshu_a(ji,jj) ) 
    251254                  sshv_b(ji,jj) = sshv_n(ji,jj) + atfp * ( sshv_b(ji,jj) - 2 * sshv_n(ji,jj) + sshv_a(ji,jj) ) 
     
    258261            END DO 
    259262         ENDIF 
    260          ! 
    261       ELSE                   ! fixed levels :   ssh at t-point only 
    262          !                   ! ------------ ! 
     263         !                    !--------------------------! 
     264      ELSE                    !        fixed levels      !   ssh at t-point only 
     265         !                    !--------------------------! 
    263266         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter 
    264267            sshn(:,:) = ssha(:,:)                            ! now <-- after  (before already = now) 
    265268            ! 
    266269         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap 
     270            zec = atfp * rdt / rau0 
    267271            DO jj = 1, jpj 
    268272               DO ji = 1, jpi                                ! before <-- now filtered 
    269                   sshb(ji,jj) = sshn(ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )     
     273                  sshb(ji,jj) = sshn(ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )   & 
     274                     &                      - zec  * ( emp_b(ji,jj) - emp(ji,jj) ) * tmask(ji,jj,1) 
    270275                  sshn(ji,jj) = ssha(ji,jj)                  ! now <-- after 
    271276               END DO 
     
    274279         ! 
    275280      ENDIF 
    276       ! 
    277       IF(ln_ctl)   CALL prt_ctl(tab2d_1=sshb    , clinfo1=' sshb  - : ', mask1=tmask, ovlap=1 ) 
     281 
     282      ! time filter with global conservation correction and array swap 
     283      sshbb(:,:) = sshb(:,:) 
     284      sshb (:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + zssha(:,:) )    & 
     285           &       - zfact  *  
     286      sshn (:,:) = zssha(:,:) 
     287      empb (:,:) = emp(:,:) 
     288 
     289 
     290      ! 
     291      IF(ln_ctl)   CALL prt_ctl( tab2d_1=sshb, clinfo1=' sshb  - : ', mask1=tmask, ovlap=1 ) 
    278292      ! 
    279293   END SUBROUTINE ssh_nxt 
Note: See TracChangeset for help on using the changeset viewer.