@@ -187,6 +187,149 @@ def test_do3D_vertical_mixing_False():
187187 assert m .vertical_mixing == False
188188
189189
190+ def test_vertical_advection_surface ():
191+ """If do3D is False, vertical_advection_at_surface should be set to False
192+
193+ and if True, vertical_advection_at_surface should be set to True."""
194+
195+ # OceanDrift
196+ m = OceanDriftModelConfig (
197+ steps = 1 ,
198+ do3D = False ,
199+ start_time = "2022-01-01" ,
200+ vertical_advection_at_surface = True ,
201+ )
202+ assert m .vertical_advection_at_surface == False
203+
204+ m = OceanDriftModelConfig (
205+ steps = 1 ,
206+ do3D = True ,
207+ start_time = "2022-01-01" ,
208+ vertical_advection_at_surface = False ,
209+ )
210+ assert m .vertical_advection_at_surface == True
211+
212+ # OpenOil
213+ m = OpenOilModelConfig (
214+ steps = 1 ,
215+ do3D = False ,
216+ start_time = "2022-01-01" ,
217+ vertical_advection_at_surface = True ,
218+ )
219+ assert m .vertical_advection_at_surface == False
220+
221+ m = OpenOilModelConfig (
222+ steps = 1 ,
223+ do3D = True ,
224+ start_time = "2022-01-01" ,
225+ vertical_advection_at_surface = False ,
226+ )
227+ assert m .vertical_advection_at_surface == True
228+
229+ # Phytoplankton
230+ m = PhytoplanktonModelConfig (
231+ steps = 1 ,
232+ do3D = False ,
233+ start_time = "2022-01-01" ,
234+ vertical_advection_at_surface = True ,
235+ )
236+ assert m .vertical_advection_at_surface == False
237+
238+ m = PhytoplanktonModelConfig (
239+ steps = 1 ,
240+ do3D = True ,
241+ start_time = "2022-01-01" ,
242+ vertical_advection_at_surface = False ,
243+ )
244+ assert m .vertical_advection_at_surface == True
245+
246+ m = LarvalFishModelConfig (
247+ steps = 1 ,
248+ do3D = True ,
249+ start_time = "2022-01-01" ,
250+ vertical_advection_at_surface = False ,
251+ )
252+ assert m .vertical_advection_at_surface == True
253+
254+
255+ def test_vertical_mixing_surface ():
256+ """If vertical_mixing is True, vertical_mixing_at_surface should be True
257+
258+ and if False, vertical_mixing_at_surface should be False."""
259+
260+ # OceanDrift
261+ m = OceanDriftModelConfig (
262+ steps = 1 ,
263+ vertical_mixing = True ,
264+ start_time = "2022-01-01" ,
265+ vertical_mixing_at_surface = False ,
266+ do3D = True ,
267+ )
268+ assert m .vertical_mixing_at_surface == True
269+
270+ m = OceanDriftModelConfig (
271+ steps = 1 ,
272+ vertical_mixing = False ,
273+ start_time = "2022-01-01" ,
274+ vertical_mixing_at_surface = True ,
275+ )
276+ assert m .vertical_mixing_at_surface == False
277+
278+ # OpenOil
279+ m = OpenOilModelConfig (
280+ steps = 1 ,
281+ vertical_mixing = True ,
282+ start_time = "2022-01-01" ,
283+ vertical_mixing_at_surface = False ,
284+ do3D = True ,
285+ )
286+ assert m .vertical_mixing_at_surface == True
287+
288+ m = OpenOilModelConfig (
289+ steps = 1 ,
290+ vertical_mixing = False ,
291+ start_time = "2022-01-01" ,
292+ vertical_mixing_at_surface = True ,
293+ )
294+ assert m .vertical_mixing_at_surface == False
295+
296+ # Phytoplankton
297+ m = PhytoplanktonModelConfig (
298+ steps = 1 ,
299+ vertical_mixing = True ,
300+ start_time = "2022-01-01" ,
301+ vertical_mixing_at_surface = False ,
302+ do3D = True ,
303+ )
304+ assert m .vertical_mixing_at_surface == True
305+
306+ m = PhytoplanktonModelConfig (
307+ steps = 1 ,
308+ vertical_mixing = False ,
309+ start_time = "2022-01-01" ,
310+ vertical_mixing_at_surface = True ,
311+ )
312+ assert m .vertical_mixing_at_surface == False
313+
314+ # LarvalFish
315+ m = LarvalFishModelConfig (
316+ steps = 1 ,
317+ vertical_mixing = True ,
318+ start_time = "2022-01-01" ,
319+ vertical_mixing_at_surface = False ,
320+ do3D = True ,
321+ )
322+ assert m .vertical_mixing_at_surface == True
323+
324+ m = LarvalFishModelConfig (
325+ steps = 1 ,
326+ vertical_mixing = False ,
327+ start_time = "2022-01-01" ,
328+ vertical_mixing_at_surface = True ,
329+ )
330+ assert m .vertical_mixing_at_surface == False
331+
332+
190333def test_OceanDrift_parameters ():
191334 """Make sure OceanDrift-specific parameters are present."""
192335 m = OceanDriftModelConfig (drift_model = "OceanDrift" , steps = 1 )
0 commit comments