Opened 8 years ago
Closed 7 years ago
#1818 closed Bug (fixed)
Uninitialized variable in sbc_oce.F90
Reported by: | mdunphy | Owned by: | diovino |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | OCE | Version: | v3.6 |
Severity: | Keywords: | ||
Cc: |
Description
Context
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.
Analysis
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.
Fix
Initialize nn_components to zero where it is declared in sbc_oce.F90. Patch attached.
Commit History (0)
(No commits)
Attachments (1)
Change History (3)
comment:1 Changed 7 years ago by clevy
- Owner changed from nemo to diovino
comment:2 Changed 7 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.
But:
- 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.