Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#1547 closed Bug (fixed)

Uninitialised values in lim_thd_dif

Reported by: ufla Owned by: nemo
Priority: normal Milestone:
Component: LIM3 Version: trunk
Severity: Keywords: LIM*
Cc:

Description

The model crashes with floating point exception.

The usual dance shows that this line

IF ( ln_it_qnsice ) hfx_err_dif_1d(:) = hfx_err_dif_1d(:) - ( qns_ice_1d(:) - zqns_ice_b(:) ) * a_i_1d(:)

from lim_thd_dif (limthd_dif.F90) accesses arrays that have uninitialised values. Initialising all arrays allocated in thd_ice_alloc (thd_ice.F90) to HUGE shows the bug reliably. Setting them to zero right after allocation prevents the crash reliably.

The following arrays carry the HUGE() values according to the debugger: a_i_1d, qns_ice_1d, and hfx_err_dif_1d. Note that not all of the array elements are uninitialised. There seems to be a certain array index (dependent on the MPI rank) from which on elements are not initialised. Elements with lower index are zero.

Commit History (2)

ChangesetAuthorTimeChangeLog
5487clem2015-06-25T11:10:44+02:00

bug fix concerning precipitation distribution over ice/ocean after wind blowing. see ticket #1547

5474clem2015-06-24T15:50:59+02:00

correct limthd_dif to avoid floating point exception. see ticket #1547

Change History (4)

comment:1 Changed 5 years ago by clem

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

Yes, thanks again Uwe. In the thermodynamics of LIM, we should not use the entirety of the 1D arrays (:) but only the range from kideb to kiut since arrays are not defined outside these boundaries. I corrected limthd_dif at revision 5474. There may be other parts of the code where it is the case. I'll have a look

comment:2 Changed 5 years ago by ufla

  • Resolution fixed deleted
  • Status changed from closed to reopened

Here seems to be another case (limthd_dh.F90):

CALL lim_thd_snwblow( 1. - at_i_1d, zsnw ) ! snow distribution over ice after wind blowing

at_i_1d is apparently not initialised for non-oce points.

Can be fixed by

CALL lim_thd_snwblow( 1. - at_i_1d(kideb:kiut), zsnw(kideb:kiut) ) ! snow distribution over ice after wind blowing
Last edited 5 years ago by ufla (previous) (diff)

comment:3 Changed 5 years ago by clem

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

Ok. It has been fixed in revision 5487. I supposed the distribution of snow over ice/ocean was not right (not sure though)

comment:4 Changed 3 years ago by nemo

  • Keywords LIM* added
Note: See TracTickets for help on using tickets.