New URL for NEMO forge!

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.
#2347 (Uninitialized values of hdivn for first time step.) – NEMO

Opened 4 years ago

Closed 4 years ago

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



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.


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.


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)


trunk: minor bugfix in divhor, see #2347

Change History (3)

comment:1 Changed 4 years ago by smasson

In 12141:

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

comment:2 Changed 4 years ago by smasson

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

comment:3 Changed 2 years ago by nemo

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