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.
#2290 (Bugs with adaptive vertical advection: 1) dynzdf.F90) – NEMO

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#2290 closed Bug (fixed)

Bugs with adaptive vertical advection: 1) dynzdf.F90

Reported by: jchanut Owned by: systeam
Priority: low Milestone:
Component: DYN Version: v4.0
Severity: minor Keywords: v4.0
Cc:

Description

Context

Adaptive (based on courant number) vertical advection, ln_zad_Aimp=.true.

Analysis

There are a couple of bugs in dynzdf.F90 with ln_zad_Aimp=.true.
1) In building the tridiagonal matrix one uses the implicit vertical velocity at W-point:

zWui = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) )
zWus = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) )

which is multiplied later when filling the matrix by

zdt = r2dt * 0.5

which reads:

zwi(ji,jj,jk) = zzwi + zdt * MIN( zWui, 0._wp ) 
zws(ji,jj,jk) = zzws - zdt * MAX( zWus, 0._wp )
zwd(ji,jj,jk) = 1._wp - zzwi - zzws + zdt * ( MAX( zWui, 0._wp ) - MIN( zWus, 0._wp ) )

It means that vertical velocities are multiplied by 0.5 twice instead of once.

2) Off diagonal terms should be divided by e3u, including implicit advection terms which is not the case.

Fix

U velocity case:

ze3ua =  ( 1._wp - r_vvl ) * e3u_n(ji,jj,jk) + r_vvl * e3u_a(ji,jj,jk)
...
zWui = ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) ) / ze3ua
zWus = ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) ) / ze3ua
zwi(ji,jj,jk) = zzwi + zdt * MIN( zWui, 0._wp ) 
zws(ji,jj,jk) = zzws - zdt * MAX( zWus, 0._wp )
zwd(ji,jj,jk) = 1._wp - zzwi - zzws + zdt * ( MAX( zWui, 0._wp ) - MIN( zWus, 0._wp ) )

Commit History (2)

ChangesetAuthorTimeChangeLog
11282jchanut2019-07-17T15:57:17+02:00

#2290, fixes bugs with adaptive vertical advection

11281jchanut2019-07-17T15:51:21+02:00

#2290, fixes bugs with adaptive vertical advection

Change History (4)

comment:1 Changed 5 years ago by jchanut

In 11281:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:2 Changed 5 years ago by jchanut

In 11282:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:3 Changed 5 years ago by jchanut

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

comment:4 Changed 2 years ago by nemo

  • Keywords v4.0 added
Note: See TracTickets for help on using tickets.