Opened 14 months ago

Closed 14 months ago

Last modified 3 months ago

#2345 closed Enhancement (fixed)

Avoid a division by zero when applying the volume control along BDYs

Reported by: ctlod Owned by: systeam
Priority: low Milestone:
Component: BDY Version: release-4.0
Severity: minor Keywords:
Cc: Branch review: failed
MP ready?: no Task progress: Unspecified

Description

Context

A division by zero may occur when using the BDYs (ln_bdy=TRUE) and activating the volume control (ln_vol=TRUE).
This is happening when the nn_write is set to zero (by default when using key_iomput).
The line concerned is line 152 in the bdyvol.F90 module : IF( MOD( kt, nn_write ) == 0 .AND. ( kc == 1 ) ) THEN

Proposal

In the release 3.6, the nn_write value was forced to the value of nn_itend when nn_write = 0. This was done in the domain.F90 module.
This control no more exist in this new release.
So either such behaviour is re-added or the user must think about setting nn_write to a value different from zero in his namelist_cfg.
I guess that forcing nn_write to nn_itend should be the best way to proceed.

Commit History (2)

ChangesetAuthorTimeChangeLog
13679jchanut2020-10-26T19:08:50+01:00

#2345. Add volume initialization with qco in VORTEX test case. At this stage, test case compiles and and runs but parent grid surface kinematic condition appears to be wrong under overlap.

12148smasson2019-12-10T14:59:27+01:00

trunk: minor bugfix in bdyvol, see #2345

Change History (5)

comment:1 Changed 14 months ago by ctlod

Wait a minute …. it's not so clear, I am coming back ….

comment:2 Changed 14 months ago by ctlod

Ok, I got it.

The code which forces nn_write to nn_itend if it's initial value is zero still exist in domain.F90 in this release 4.0 but it is now under the control of the key_iomput cpp key.
So when using the cpp key key_iomput, no modification is applied to nn_write.
Solution:
Just remove the cpp conditioning line 378 in domain.F90:
#if ! defined key_iomput

IF( nn_write == -1 ) CALL ctl_warn( 'nn_write = -1 —> no output files will be done' )
IF ( nn_write == 0 ) THEN

WRITE(ctmp1,*) 'nn_write = ', nn_write, ' it is forced to ', nitend
CALL ctl_warn( ctmp1 )
nn_write = nitend

ENDIF

#endif

comment:3 Changed 14 months ago by smasson

In 12148:

trunk: minor bugfix in bdyvol, see #2345

comment:4 Changed 14 months ago by smasson

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

comment:5 Changed 3 months ago by jchanut

In 13679:

#2345. Add volume initialization with qco in VORTEX test case. At this stage, test case compiles and and runs but parent grid surface kinematic condition appears to be wrong under overlap.

Note: See TracTickets for help on using tickets.