#2313 closed Bug (fixed)
Possible uninitialised variables in sbccpl
Reported by: | timgraham | Owned by: | systeam |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | SBC | Version: | v4.0 |
Severity: | minor | Keywords: | coupled_mode currents v4.0 |
Cc: |
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 (3)
comment:1 Changed 5 years ago by smasson
comment:2 Changed 5 years ago by smasson
- Resolution set to fixed
- Status changed from new to closed
comment:3 Changed 3 years ago by nemo
- Keywords v4.0 added
Note: See
TracTickets for help on using
tickets.
In 12171:
remove useless line as by default