Opened 11 years ago

Closed 11 years ago

Last modified 3 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: release-3.2
Severity: Keywords: VVL
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 (8)

comment:1 Changed 11 years ago by rblod

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

comment:2 Changed 11 years ago by anonymous

  • Milestone 2009 Stream 3: New features deleted

Milestone 2009 Stream 3: New features deleted

comment:3 Changed 4 years ago by nicolasmartin

  • Keywords VVL added; vvl removed

comment:4 Changed 4 years ago by nicolasmartin

  • Keywords nemo_v3_2* added

comment:5 Changed 4 years ago by nicolasmartin

  • Keywords formulation added; form removed

comment:6 Changed 3 years ago by nemo

  • Keywords vector removed

comment:7 Changed 3 years ago by nemo

  • Keywords formulation removed

comment:8 Changed 3 years ago by nemo

  • Keywords nemo_v3_2* removed
Note: See TracTickets for help on using tickets.