Opened 4 years ago

Closed 3 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: release-3.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:

  1. using key_zdfgls
  2. resuming from restart
  3. 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)

ChangesetAuthorTimeChangeLog
8584cbricaud2017-10-03T12:23:26+02:00

fix ticket #1833 in trunk

1854mafoipsl2010-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)

zdfbfr.patch (398 bytes) - added by mdunphy 4 years ago.
Patch to initialize arrays bfrua/bfrva in zdf_bfr_init when nn_bfr=2

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by mdunphy

Patch to initialize arrays bfrua/bfrva in zdf_bfr_init when nn_bfr=2

comment:1 Changed 4 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 3 years ago by clevy

  • Owner changed from nemo to cbricaud

comment:3 Changed 3 years ago by clevy

  • Cc cbricaud added
  • Status changed from new to assigned

comment:4 Changed 3 years ago by nicolasmartin

  • Description modified (diff)

comment:5 Changed 3 years ago by cbricaud

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