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.
#568 (Bug in dynspg_flt with vvl and vector invariant form) – NEMO

Opened 14 years ago

Closed 14 years ago

Last modified 2 years ago

#568 closed Bug (fixed)

Bug in dynspg_flt with vvl and vector invariant form

Reported by: gm Owned by: nemo
Priority: normal Milestone:
Component: OCE Version: v3.2
Severity: Keywords: OPA VVL v3.2
Cc:

Description

In vector invariant form, the time stepping on the velocity must be performed on velocity, not on thickness weighted velocity.
This is correctly done in dynnxt.F90 but not in dynspg_flt.F90
The correct time stepping for dynspg_flt is given below.

This only concerns users using vvl AND the filtered free surface, not the split explicit free surface.

Matthieu Leclair & Gurvan Madec

the following lines:

      !! Explicit physics with thickness weighted updates
      IF( lk_vvl ) THEN          ! variable volume 

         ! Evaluate the masked next velocity (effect of the additional force not included)
         ! -------------------   (thickness weighted velocity, surface pressure gradient already included in dyn_hpg)
         DO jk = 1, jpkm1
            DO jj = 2, jpjm1
               DO ji = fs_2, fs_jpim1   ! vector opt.
                  ua(ji,jj,jk) = (        ub(ji,jj,jk) * fse3u_b(ji,jj,jk)      &
                     &           + z2dt * ua(ji,jj,jk) * fse3u_n(ji,jj,jk)  )   &
                     &         / fse3u_a(ji,jj,jk) * umask(ji,jj,jk)
                  va(ji,jj,jk) = (        vb(ji,jj,jk) * fse3v_b(ji,jj,jk)      &
                     &           + z2dt * va(ji,jj,jk) * fse3v_n(ji,jj,jk)  )   &
                     &         / fse3v_a(ji,jj,jk) * vmask(ji,jj,jk)
               END DO
            END DO
         END DO

      ELSE                       ! fixed volume 

         ! Surface pressure gradient (now)
         DO jj = 2, jpjm1
            DO ji = fs_2, fs_jpim1   ! vector opt.
               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj)
               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj)
            END DO 
         END DO 
         !
         ! add the surface pressure trend to the general trend and
         ! evaluate the masked next velocity (effect of the additional force not included)
         DO jk = 1, jpkm1
            DO jj = 2, jpjm1
               DO ji = fs_2, fs_jpim1   ! vector opt.
                  ua(ji,jj,jk) = (  ub(ji,jj,jk) + z2dt * ( ua(ji,jj,jk) + spgu(ji,jj) )  ) * umask(ji,jj,jk)
                  va(ji,jj,jk) = (  vb(ji,jj,jk) + z2dt * ( va(ji,jj,jk) + spgv(ji,jj) )  ) * vmask(ji,jj,jk)
               END DO
            END DO
         END DO
         !
      ENDIF

must be replaced by :

      ! Evaluate the masked next velocity (effect of the additional force not included)
      ! ---------------------------------  
      IF( lk_vvl ) THEN          ! variable volume  (surface pressure gradient already included in dyn_hpg)
         !
         IF( ln_dynadv_vec ) THEN      ! vector form : applied on velocity
            DO jk = 1, jpkm1
               DO jj = 2, jpjm1
                  DO ji = fs_2, fs_jpim1   ! vector opt.
                     ua(ji,jj,jk) = (  ub(ji,jj,jk) + z2dt * ua(ji,jj,jk)  ) * umask(ji,jj,jk)
                     va(ji,jj,jk) = (  vb(ji,jj,jk) + z2dt * va(ji,jj,jk)  ) * vmask(ji,jj,jk)
                  END DO
               END DO
            END DO
            !
         ELSE                          ! flux form : applied on thickness weighted velocity
            DO jk = 1, jpkm1
               DO jj = 2, jpjm1
                  DO ji = fs_2, fs_jpim1   ! vector opt.
                     ua(ji,jj,jk) = (        ub(ji,jj,jk) * fse3u_b(ji,jj,jk)      &
                        &           + z2dt * ua(ji,jj,jk) * fse3u_n(ji,jj,jk)  )   &
                        &         / fse3u_a(ji,jj,jk) * umask(ji,jj,jk)
                     va(ji,jj,jk) = (        vb(ji,jj,jk) * fse3v_b(ji,jj,jk)      &
                        &           + z2dt * va(ji,jj,jk) * fse3v_n(ji,jj,jk)  )   &
                        &         / fse3v_a(ji,jj,jk) * vmask(ji,jj,jk)
                 END DO
               END DO
            END DO
            !
         ENDIF
         !
      ELSE                       ! fixed volume  (add the surface pressure gradient + unweighted time stepping)
         !
         DO jj = 2, jpjm1              ! Surface pressure gradient (now)
            DO ji = fs_2, fs_jpim1   ! vector opt.
               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj)
               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj)
            END DO 
         END DO 
         DO jk = 1, jpkm1              ! unweighted time stepping 
            DO jj = 2, jpjm1
               DO ji = fs_2, fs_jpim1   ! vector opt.
                  ua(ji,jj,jk) = (  ub(ji,jj,jk) + z2dt * ( ua(ji,jj,jk) + spgu(ji,jj) )  ) * umask(ji,jj,jk)
                  va(ji,jj,jk) = (  vb(ji,jj,jk) + z2dt * ( va(ji,jj,jk) + spgv(ji,jj) )  ) * vmask(ji,jj,jk)
               END DO
            END DO
         END DO
         !
      ENDIF

Commit History (1)

ChangesetAuthorTimeChangeLog
1683rblod2009-10-28T11:24:41+01:00

Correct time stepping for volume variable and filtered free surface, see #568

Change History (9)

comment:1 Changed 14 years ago by rblod

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 14 years ago by anonymous

  • Milestone 2009 Stream 3: New features deleted

Milestone 2009 Stream 3: New features deleted

comment:3 Changed 8 years ago by nicolasmartin

  • Keywords VVL added; vvl removed

comment:4 Changed 8 years ago by nicolasmartin

  • Keywords nemo_v3_2* added

comment:5 Changed 8 years ago by nicolasmartin

  • Keywords formulation added; form removed

comment:6 Changed 6 years ago by nemo

  • Keywords vector removed

comment:7 Changed 6 years ago by nemo

  • Keywords formulation removed

comment:8 Changed 6 years ago by nemo

  • Keywords nemo_v3_2* removed

comment:9 Changed 2 years ago by nemo

  • Keywords OPA v3.2 added
Note: See TracTickets for help on using tickets.