Opened 5 weeks ago

#2447 new Defect

Wave variables not allocated

Reported by: jcastill Owned by: ayoung
Priority: low Milestone: 2020 WP
Component: MULTIPLE Version: 4.0-HEAD
Severity: minor Keywords: wave vertical mixing
Cc: mathiot



The code allows using some of the wave coupling variables when they are not allocated, which can lead to a segmentation fault or unpredictable behaviour if the namelist is not set appropriately (no warnings or errors are given in this respect)


The variables hsw, wmp, ut0sd, vt0sd, and tsd2d are only allocated when ln_wave=true and ln_sdw=true in sbcwave.F90. These variables can be used in other pieces of code when these conditions are not met, and no checks are performed to ensure that the variables are allocated. In particular:

Variables wmp, ut0sd, vt0sd are used when ln_zdmosm=true and nn_osm_wave=2
Variables wnum and tsd2d are used when ln_zdfswm=true
Variable hsw is used in the previous cases, and when ln_zdfgls=true and nn_z0_met=3


It would be ideal to being able to use these wave variables for the different schemes of vertical physics independently of the use of Stokes drift (ln_sdw). Therefore, appropriate code should be written in the routine sbc_wave_init (sbcwave.F90) in order to allocate memory for these variables, and read their values from file (or check if these variables are obtained via coupling in sbccpl.F90), when they are used in vertical mixing schemes. The namelist parameters should be checked to make sure that when a particular vertical mixing scheme is used requiring a wave variable, this variable is read via a forcing file or via coupling, and provide an error otherwise.

Commit History (0)

(No commits)

Change History (0)

Note: See TracTickets for help on using tickets.