#2290 closed Bug (fixed)

Bugs with adaptive vertical advection: 1) dynzdf.F90

Reported by: jchanut Owned by: systeam
Priority: low Milestone:
Component: DYN Version: release-4.0
Severity: minor Keywords:
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 (3)

comment:1 Changed 13 months ago by jchanut

In 11281:

#2290, fixes bugs with adaptive vertical advection

comment:2 Changed 13 months ago by jchanut

In 11282:

#2290, fixes bugs with adaptive vertical advection

comment:3 Changed 13 months ago by jchanut

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.