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 4374 for branches/2013 – NEMO

Changeset 4374 for branches/2013


Ignore:
Timestamp:
2014-01-27T11:31:19+01:00 (10 years ago)
Author:
jchanut
Message:

Fixed small bug in flux form + clean header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90

    r4370 r4374  
    2424   USE dynspg_oce      ! surface pressure gradient variables 
    2525   USE phycst          ! physical constants 
    26    USE domvvl          ! variable volume 
    2726   USE dynvor          ! vorticity term 
    2827   USE bdy_par         ! for lk_bdy 
    29    USE bdy_oce         ! Lateral open boundary condition 
    3028   USE bdytides        ! open boundary condition data      
    3129   USE bdydyn2d        ! open boundary conditions on barotropic variables 
     
    3836   USE iom             ! IOM library 
    3937   USE restart         ! only for lrst_oce 
    40    USE zdf_oce         ! Vertical diffusion 
     38   USE zdf_oce         ! Bottom friction coefts 
    4139   USE wrk_nemo        ! Memory Allocation 
    4240   USE timing          ! Timing     
     
    111109      !! ** Purpose :    
    112110      !!      -Compute the now trend due to the explicit time stepping 
    113       !!      of the quasi-linear barotropic system. Barotropic variables are 
    114       !!      advanced from internal time steps "n" to "n+1" (if ln_bt_cen=F) 
    115       !!      or from "n-1" to "n+1" time steps (if ln_bt_cen=T) with a 
    116       !!      generalized forward-backward (see ref. below) time stepping. 
    117       !!      -Update the free surface at step "n+1" (ssha, zsshu_a, zsshv_a). 
    118       !!      -Compute barotropic advective velocities at step "n" to be used  
    119       !!      to advect tracers latter on. These are compliant with discrete 
    120       !!      continuity equation taken at the baroclinic time steps, thus  
    121       !!      ensuring tracers conservation. 
     111      !!      of the quasi-linear barotropic system.  
    122112      !! 
    123113      !! ** Method  :   
     114      !!      Barotropic variables are advanced from internal time steps 
     115      !!      "n"   to "n+1" if ln_bt_fw=T 
     116      !!      or from  
     117      !!      "n-1" to "n+1" if ln_bt_fw=F 
     118      !!      thanks to a generalized forward-backward time stepping (see ref. below). 
    124119      !! 
    125       !! ** Action : - Update barotropic velocities: ua_b, va_b 
    126       !!             - Update trend (ua,va) with barotropic component 
    127       !!             - Update ssha, zsshu_a, zsshv_a 
    128       !!             - Update barotropic advective velocity at kt=now 
     120      !! ** Action : 
     121      !!      -Update the filtered free surface at step "n+1"      : ssha 
     122      !!      -Update filtered barotropic velocities at step "n+1" : ua_b, va_b 
     123      !!      -Compute barotropic advective velocities at step "n" : un_adv, vn_adv 
     124      !!      These are used to advect tracers and are compliant with discrete 
     125      !!      continuity equation taken at the baroclinic time steps. This  
     126      !!      ensures tracers conservation. 
     127      !!      -Update 3d trend (ua, va) with barotropic component. 
    129128      !! 
    130129      !! References : Shchepetkin, A.F. and J.C. McWilliams, 2005:  
     
    138137      ! 
    139138      LOGICAL  ::   ll_fw_start        ! if true, forward integration  
    140       LOGICAL  ::   ll_init         ! if true, special startup of 2d equations 
     139      LOGICAL  ::   ll_init             ! if true, special startup of 2d equations 
    141140      INTEGER  ::   ji, jj, jk, jn        ! dummy loop indices 
    142141      INTEGER  ::   ikbu, ikbv, noffset      ! local integers 
    143142      REAL(wp) ::   zraur, z1_2dt_b, z2dt_bf    ! local scalars 
    144       REAL(wp) ::   zx1, zy1, zx2, zy2          !   -      - 
    145       REAL(wp) ::   z1_12, z1_8, z1_4, z1_2  !   -      - 
    146       REAL(wp) ::   zu_spg, zv_spg     !   -      - 
    147       REAL(wp) ::   zhura, zhvra          !   -      - 
    148       REAL(wp) ::   za0, za1, za2, za3    !   -      - 
     143      REAL(wp) ::   zx1, zy1, zx2, zy2         !   -      - 
     144      REAL(wp) ::   z1_12, z1_8, z1_4, z1_2    !   -      - 
     145      REAL(wp) ::   zu_spg, zv_spg                !   -      - 
     146      REAL(wp) ::   zhura, zhvra               !   -      - 
     147      REAL(wp) ::   za0, za1, za2, za3           !   -      - 
    149148      ! 
    150149      REAL(wp), POINTER, DIMENSION(:,:) :: zun_e, zvn_e, zsshp2_e 
     
    158157      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_ts') 
    159158      ! 
    160       !                                         !* Allocate temporay arrays 
     159      !                                         !* Allocate temporary arrays 
    161160      CALL wrk_alloc( jpi, jpj, zsshp2_e, zhdiv ) 
    162161      CALL wrk_alloc( jpi, jpj, zu_trd, zv_trd, zun_e, zvn_e  ) 
     
    212211      ! Do it once at kt=nit000 if volume is fixed, else at each long time step. 
    213212      ! Note that these arrays are also used during barotropic loop. These are however frozen 
    214       ! although they should be updated in variable volume case. Not a big approximation. 
     213      ! although they should be updated in the variable volume case. Not a big approximation. 
    215214      ! To remove this approximation, copy lines below inside barotropic loop 
    216       ! and update depths at T-F points (ht and hf resp.) at each barotropic time step 
     215      ! and update depths at T-F points (ht and zhf resp.) at each barotropic time step 
    217216      ! 
    218217      IF ( kt == nit000 .OR. lk_vvl ) THEN 
     
    243242            zhf(:,:) = 0. 
    244243            IF ( .not. ln_sco ) THEN 
     244! JC: It not clear yet what should be the depth at f-points over land in z-coordinate case 
     245!     Set it to zero for the time being  
    245246!              IF( rn_hmin < 0._wp ) THEN    ;   jk = - INT( rn_hmin )                                      ! from a nb of level 
    246247!              ELSE                          ;   jk = MINLOC( gdepw_0, mask = gdepw_0 > rn_hmin, dim = 1 )  ! from a depth 
     
    333334         END DO 
    334335         ! 
    335       ELSEIF ( ln_dynvor_ens ) THEN             ! enstrophy conserving scheme 
     336      ELSEIF ( ln_dynvor_ens ) THEN                    ! enstrophy conserving scheme 
    336337         DO jj = 2, jpjm1 
    337338            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    345346         END DO 
    346347         ! 
    347       ELSEIF ( ln_dynvor_een ) THEN             ! enstrophy and energy conserving scheme 
     348      ELSEIF ( ln_dynvor_een ) THEN                    ! enstrophy and energy conserving scheme 
    348349         DO jj = 2, jpjm1 
    349350            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    529530            CALL lbc_lnk( zwx, 'U', 1._wp )    ;   CALL lbc_lnk( zwy, 'V', 1._wp ) 
    530531            ! 
    531             zhup2_e (:,:) = hu_0(:,:) + zwx(:,:)               ! Ocean depth at U- and V-points 
     532            zhup2_e (:,:) = hu_0(:,:) + zwx(:,:)                ! Ocean depth at U- and V-points 
    532533            zhvp2_e (:,:) = hv_0(:,:) + zwy(:,:) 
    533534         ELSE 
     
    795796            DO ji = 1, jpim1      ! NO Vector Opt. 
    796797               zsshu_a(ji,jj) = z1_2 * umask(ji,jj,1)  * r1_e12u(ji,jj) & 
    797                   &              * ( e12t(ji  ,jj) * ssha_e(ji  ,jj)    & 
    798                   &              +   e12t(ji+1,jj) * ssha_e(ji+1,jj) ) 
     798                  &              * ( e12t(ji  ,jj) * ssha(ji  ,jj)    & 
     799                  &              +   e12t(ji+1,jj) * ssha(ji+1,jj) ) 
    799800               zsshv_a(ji,jj) = z1_2 * vmask(ji,jj,1)  * r1_e12v(ji,jj) & 
    800                   &              * ( e12t(ji,jj  ) * ssha_e(ji,jj  )    & 
    801                   &              +   e12t(ji,jj+1) * ssha_e(ji,jj+1) ) 
     801                  &              * ( e12t(ji,jj  ) * ssha(ji,jj  )    & 
     802                  &              +   e12t(ji,jj+1) * ssha(ji,jj+1) ) 
    802803            END DO 
    803804         END DO 
     
    11021103END MODULE dynspg_ts 
    11031104 
     1105 
Note: See TracChangeset for help on using the changeset viewer.