File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 44from ruamel .yaml import YAML
55
66from polaris .model_step import ModelStep
7+ from polaris .tasks .ocean import Ocean
78
89
910class OceanModelStep (ModelStep ):
@@ -323,6 +324,32 @@ def update_namelist_eos(self):
323324
324325 self .add_model_config_options (options = replacements )
325326
327+ def validate_baselines (self ):
328+ """
329+ Compare variables between output files in this step and in the same
330+ step from a baseline run if one was provided.
331+
332+ Returns
333+ -------
334+ compared : bool
335+ Whether a baseline comparison was performed
336+
337+ success : bool
338+ Whether the outputs were successfully validated against a baseline
339+ """
340+ if not isinstance (self .component , Ocean ):
341+ raise TypeError (
342+ 'component must be an instance of Ocean to map model vars'
343+ )
344+ # translate variable names to native model names
345+ validate_vars = {}
346+ for filename , vars in self .validate_vars .items ():
347+ validate_vars [filename ] = (
348+ self .component .map_var_list_to_native_model (vars )
349+ )
350+ self .validate_vars = validate_vars
351+ return super ().validate_baselines ()
352+
326353 def _update_ntasks (self ):
327354 """
328355 Update ``ntasks`` and ``min_tasks`` for the step based on the estimated
You can’t perform that action at this time.
0 commit comments