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.
#2345 (Avoid a division by zero when applying the volume control along BDYs) – NEMO

Opened 5 years ago

Closed 5 years ago

Last modified 2 years 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: v4.0
Severity: minor Keywords: v4.0
Cc:

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 (6)

comment:1 Changed 5 years ago by ctlod

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

comment:2 Changed 5 years 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 5 years ago by smasson

In 12148:

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

comment:4 Changed 5 years ago by smasson

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

comment:5 Changed 4 years ago by jchanut

In 13679:

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

comment:6 Changed 2 years ago by nemo

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