Opened 4 years ago

Closed 3 years ago

#1818 closed Bug (fixed)

Uninitialized variable in sbc_oce.F90

Reported by: mdunphy Owned by: diovino
Priority: low Milestone:
Component: OCE Version: release-3.6
Severity: Keywords:



Variable nn_components is initialized with a namelist read in sbc_init, however, nn_components is used before it is initialized. Before we make the call to sbc_init, we call istate_init, which calls dta_tsd, which calls fld_read, which makes use of nn_components to set an offset.


The offset in fld_read should be zero for dta_tsd (loading T and S from 3D input files), so nn_components = 0 should be appropriate here.


Initialize nn_components to zero where it is declared in sbc_oce.F90. Patch attached.

Commit History (0)

(No commits)

Attachments (1)

sbc_oce_initialize.patch (1.2 KB) - added by mdunphy 4 years ago.
Patch for nn_components initialization in sbc_oce.F90

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by mdunphy

Patch for nn_components initialization in sbc_oce.F90

comment:1 Changed 3 years ago by clevy

  • Owner changed from nemo to diovino

comment:2 Changed 3 years ago by cbricaud

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

Effectively, nn_components has no value in that case and nn_fsbc also.


  • in the case of jp_iam_opa=0 ( OPA+sbcmod together, i.e no SAS ) or jp_iam_opa=1 ( SAS mode, OPA component ), we will have it_offset = 0 when fldread os called by dtatsd
  • in the case of jp_iam_opa=2 ( SAS mode, SBC component ), dtatsd is not called

So it should not be a problem.

Note: See TracTickets for help on using tickets.