Opened 7 years ago
Closed 6 years ago
#1833 closed Bug (fixed)
Uninitialized arrays bfrua/bfrva in zdf_bfr_init
Reported by: | mdunphy | Owned by: | cbricaud |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | OCE | Version: | v3.6 |
Severity: | Keywords: | ||
Cc: | cbricaud |
Description (last modified by nicolasmartin)
Context
The function zdf_bfr_init does not initialize arrays bfrua/bfrva for the case of nn_bfr = 2
Analysis
This usually does not matter, but it does matter under the conditions of:
- using key_zdfgls
- resuming from restart
- the restart file does not have one of the zdfgls arrays (en, avt, avm, avmu, avmv or mxln)
These conditions can occur if (1) you switch on the zdfgls scheme between restarts, or (2) you use the nesting tools to create an AGRIF restart file (because the nesting tools do not interpolate most of the zdfgls arrays).
Under these conditions, the restarting function gls_rst() calls zdf_gls() several times:
IF(lwp) WRITE(numout,*) ' ===>>>> : previous run without gls scheme, en and mxln computed by iterative loop' ... DO jit = nit000 + 1, nit000 + 10 ; CALL zdf_gls( jit ) ; END DO
The calls to zdf_gls() make use of bfrua and bfrva, which are uninitialized at this stage.
Fix
In zdf_bfr_init, there is an initialization for bfrua/bfrva when nn_bfr=0 and nn_bfr=1, so I think the fix is to similarly initialize them when nn_bfr=2. Patch attached.
Commit History (2)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
8584 | cbricaud | 2017-10-03T12:23:26+02:00 | fix ticket #1833 in trunk |
1854 | mafoipsl | 2010-04-30T11:08:39+02:00 | Apply in CMIP5_IPSL branch #1833 to solve NP-folding bug on stress in coupled model, see ticket:660 |
Attachments (1)
Change History (6)
Changed 7 years ago by mdunphy
comment:1 Changed 7 years ago by clem
I think the same fix should also apply to tfrua/tfrva in both nemo3.6 and the trunk.
Someone to confirm and to do the fix?
comment:2 Changed 7 years ago by clevy
- Owner changed from nemo to cbricaud
comment:3 Changed 6 years ago by clevy
- Cc cbricaud added
- Status changed from new to assigned
comment:4 Changed 6 years ago by nicolasmartin
- Description modified (diff)
comment:5 Changed 6 years ago by cbricaud
- Resolution set to fixed
- Status changed from assigned to closed
Patch to initialize arrays bfrua/bfrva in zdf_bfr_init when nn_bfr=2