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.
#1833 (Uninitialized arrays bfrua/bfrva in zdf_bfr_init) – NEMO

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)


The function zdf_bfr_init does not initialize arrays bfrua/bfrva for the case of nn_bfr = 2


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.


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)


fix ticket #1833 in trunk


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 7 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 7 years ago by mdunphy

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

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
Note: See TracTickets for help on using tickets.