#2514 closed Bug (fixed)
unallocated ICE variable (a_i_last_couple) when using SAS+OASIS
Reported by: | gsamson | Owned by: | gsamson |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | SI3 | Version: | v4.0 |
Severity: | minor | Keywords: | ICE OASIS SAS SI3 v4.0 |
Cc: | clem, smasson |
Description (last modified by smasson)
Context
In nemo 4.0.3, a new variable "a_i_last_couple" (Ice fractional area at last coupling time) has been introduced in "ice_alloc" specifically for atm coupling.
Analysis
However, when using SAS+OASIS, this new variable is used in "sbc_cpl_init" before it has been allocated in "ice_alloc", causing the model to crash.
Fix
Move "a_i_last_couple" variable declaration and allocation from ice.F90 to sbccpl.F90
Bonus: "info" variable is not initialised at the first call of "sbc_cpl_snd" routine and should be initialised to "info = OASIS_idle" for exemple
Commit History (2)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
14321 | dancopsey | 2021-01-20T15:31:58+01:00 | Revert the code change that went into NEMO4.0.4 as changeset [13444] and ticket #2514. This crashes the Met Office coupled model as a_i_last_couple is allocated in sbc_cpl_alloc ahead of when jpl is set (jpl is set in par_init). Therefore it is allocated an array size with the wrong value of jpl. When it then copies a_i into this array (in sbc_cpl_snd) it puts data off the end of the array into random memory. During the next call to OASIS (i.e. call cpl_snd) some of this affected memory is processed and a segmentation fault occurs. |
13444 | gsamson | 2020-08-31T10:58:55+02:00 | move 'a_i_last_couple' variable declaration and allocation from ice.F90 to sbccpl.F90; delete cice specific declaration from sbc_ice.F90 and inialize 'info' variable to 'OASIS_idle' in sbc_cpl_snd routine (sbccpl.F90); see ticket #2514 |
Change History (6)
comment:1 Changed 4 years ago by smasson
- Description modified (diff)
comment:2 Changed 4 years ago by smasson
comment:3 Changed 4 years ago by gsamson
In 13444:
comment:4 Changed 4 years ago by gsamson
- Resolution set to fixed
- Status changed from new to closed
comment:5 Changed 3 years ago by dancopsey
In 14321:
comment:6 Changed 2 years ago by nemo
- Keywords v4.0 added
I agree with your proposition. a_i_last_couple is used only in sbccpl, there is no real need to declare and allocate it somewhere else. Don't forget to also remove a_i_last_couple declaration in sbc_ice.
I also agree with the "bonus". I think this one should also be done in the trunk.