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 1505 for trunk/NEMO – NEMO

Changeset 1505 for trunk/NEMO


Ignore:
Timestamp:
2009-07-20T17:36:58+02:00 (15 years ago)
Author:
rblod
Message:

Correct dynspg_exp for variable volume case, see ticket #479

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/dynspg_exp.F90

    r1438 r1505  
    44   !! Ocean dynamics:  surface pressure gradient trend 
    55   !!====================================================================== 
    6    !! History :  9.0  !  2005-11  (V. Garnier, G. Madec, L. Bessieres) Original code 
     6   !! History :  2.0  !  2005-11  (V. Garnier, G. Madec, L. Bessieres) Original code 
     7   !!            3.2  !  2009-06  (G. Madec, M. Leclair, R. Benshila) introduce sshwzv module 
    78   !!---------------------------------------------------------------------- 
    89#if defined key_dynspg_exp   ||   defined key_esopa 
    910   !!---------------------------------------------------------------------- 
    10    !!   'key_dynspg_exp'           free sfce cst vol. without filter nor ts 
     11   !!   'key_dynspg_exp'                              explicit free surface 
    1112   !!---------------------------------------------------------------------- 
    1213   !!   dyn_spg_exp  : update the momentum trend with the surface  
     
    4950      !! 
    5051      !! ** Purpose :   Compute the now trend due to the surface pressure 
    51       !!      gradient in case of explicit free surface formulation and  
    52       !!      add it to the general trend of momentum equation. Compute 
    53       !!      the free surface. 
     52      !!              gradient in case of explicit free surface formulation and  
     53      !!              add it to the general trend of momentum equation. 
    5454      !! 
    55       !! ** Method  :   Explicit free surface formulation. The surface pressure 
    56       !!      gradient is given by: 
    57       !!         spgu = 1/rau0 d/dx(ps) =  g/e1u di( sshn ) 
    58       !!         spgv = 1/rau0 d/dy(ps) =  g/e2v dj( sshn ) 
    59       !!      -1- Compute the now surface pressure gradient 
    60       !!      -2- Add it to the general trend 
     55      !! ** Method  :   Explicit free surface formulation. Add to the general 
     56      !!              momentum trend the surface pressure gradient : 
     57      !!                      (ua,va) = (ua,va) + (spgu,spgv) 
     58      !!              where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn ) 
     59      !!                    spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn ) 
    6160      !! 
    62       !! ** Action : - Update (ua,va) with the surf. pressure gradient trend 
     61      !! ** Action :   (ua,va)   trend of horizontal velocity increased by  
     62      !!                         the surf. pressure gradient trend 
    6363      !!--------------------------------------------------------------------- 
    6464      INTEGER, INTENT( in )  ::   kt         ! ocean time-step index 
     
    7171         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend' 
    7272         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)' 
    73  
    74          ! set to zero free surface specific arrays 
    75          spgu(:,:) = 0.e0                     ! surface pressure gradient (i-direction) 
    76          spgv(:,:) = 0.e0                     ! surface pressure gradient (j-direction) 
     73         ! 
     74         spgu(:,:) = 0.e0   ;   spgv(:,:) = 0.e0 
     75         ! 
     76         IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg' 
    7777      ENDIF 
    7878 
    79       ! read or estimate sea surface height and vertically integrated velocities 
    80       IF( lk_obc )   CALL obc_dta_bt( kt, 0 ) 
    8179 
    82       ! Surface pressure gradient (now) 
    83       DO jj = 2, jpjm1 
    84          DO ji = fs_2, fs_jpim1   ! vector opt. 
    85             spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj) 
    86             spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj) 
    87          END DO 
    88       END DO 
     80!!gm bug ??  Rachid we have to discuss of the call below. I don't understand why it is here and not in ssh_wzv 
     81      IF( lk_obc )   CALL obc_dta_bt( kt, 0 )      ! OBC: read or estimate ssh and vertically integrated velocities 
     82!!gm 
    8983 
    90       ! Add the surface pressure trend to the general trend 
    91       DO jk = 1, jpkm1 
    92          DO jj = 2, jpjm1 
     84      IF( .NOT. lk_vvl ) THEN          !* fixed volume : add the surface pressure gradient trend 
     85         ! 
     86         DO jj = 2, jpjm1                    ! now surface pressure gradient 
    9387            DO ji = fs_2, fs_jpim1   ! vector opt. 
    94                ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) 
    95                va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) 
     88               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj) 
     89               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj) 
     90            END DO  
     91         END DO  
     92         DO jk = 1, jpkm1                    ! Add it to the general trend 
     93            DO jj = 2, jpjm1 
     94               DO ji = fs_2, fs_jpim1   ! vector opt. 
     95                  ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) 
     96                  va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) 
     97               END DO 
    9698            END DO 
    9799         END DO 
    98       END DO 
    99  
     100         ! 
     101      ENDIF 
     102      ! 
    100103   END SUBROUTINE dyn_spg_exp 
    101104 
Note: See TracChangeset for help on using the changeset viewer.