
Opened 18 months ago
Closed 15 months ago
#2313 closed Bug (fixed)
Possible uninitialised variables in sbccpl
Reported by: | timgraham | Owned by: | ![]() |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | SBC | Version: | release-4.0 |
Severity: | minor | Keywords: | coupled_mode, currents |
Cc: | Branch review: | ||
MP ready?: | Task progress: |
Description
Context
In the following lines of code the syntax in the ELSE IF part seems wrong as there is a call to ctl_stop followed by another line of code that can never be run
IF( sn_snd_crt%clvgrd == 'U,V' ) THEN ssnd(jps_ocx1)%clgrid = 'U' ; ssnd(jps_ocy1)%clgrid = 'V' ELSE IF( sn_snd_crt%clvgrd /= 'T' ) THEN CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T' ) ssnd(jps_ocx1:jps_ivz1)%clgrid = 'T' ! all oce and ice components on the same unique grid ENDIF
…
Analysis
If sn_snd_crt%clvgrd = 'T' then the code will continue to run but the variables ssnd(jps_ocx1:jps_ivz1)%clgrid won't be initialised to 'T' potentially causing problems later in the run.
Fix
Perhaps the code should be:
IF( sn_snd_crt%clvgrd == 'U,V' ) THEN ssnd(jps_ocx1)%clgrid = 'U' ; ssnd(jps_ocy1)%clgrid = 'V' ELSE IF( sn_snd_crt%clvgrd == 'T' ) THEN ssnd(jps_ocx1:jps_ivz1)%clgrid = 'T' ! all oce and ice components on the same unique grid ELSE CALL ctl_stop( 'sn_snd_crt%clvgrd must be equal to T or 'U,V' ) ENDIF
I'm not able to test this change as we couple on the 'U,V' grids.
Commit History (1)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
12171 | smasson | 2019-12-11T10:36:23+01:00 | trunk: minor cleaning in sbccpl, see #2313 |
Change History (2)
comment:1
Changed 15 months ago by smasson
comment:2
Changed 15 months ago by smasson
- Resolution set to fixed
- Status changed from new to closed
In 12171: