Opened 6 months ago

Closed 6 months ago

#2347 closed Bug (fixed)

Uninitialized values of hdivn for first time step.

Reported by: kmogensen Owned by: systeam
Priority: low Milestone:
Component: DYN Version: release-4.0
Severity: minor Keywords:
Cc:

Description

Context

When computing the horizontal divergence in div_hor it is only done for the interior points. However in the calls to sbc_rnf_div, ssh_asm_div, sbc_isf_div and iscpl_div it is computed for all points included halo points.

Analysis

For the first call the calls to sbc_rnf_div, ssh_asm_div, sbc_isf_div and iscpl_div accesses uninitialized data on the halo points which could lead to floating point exceptions if the halo points contains NaN's in them. For all following calls the routines below operates on old data, but since there is a call the lbc_lnk at the end of div_hor this is not really a problem.

Running without floating point error trap would work, but it is nice to able trap "real" errors where they occur.

Fix

Multiple fixes are possible.

  • Initializing hdivn to any "reasonable" value when it is allocated.
  • Modify the sbc_rnf_div, ssh_asm_div, sbc_isf_div and iscpl_div routines to only work on interior points
  • Insert a lbc_lnk call before calling sbc_rnf_div etc.

First option is the fastest to implement and the one we have done for our local copy. The second one is probably the nicest. Third option adds MPI communication which is not needed except for the first call.

Commit History (1)

ChangesetAuthorTimeChangeLog
12141smasson2019-12-10T12:43:20+01:00

trunk: minor bugfix in divhor, see #2347

Change History (2)

comment:1 Changed 6 months ago by smasson

In 12141:

trunk: minor bugfix in divhor, see #2347

comment:2 Changed 6 months ago by smasson

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