E3SM-Project / polaris

Testing and analysis for OMEGA, MPAS-Ocean, MALI and MPAS-Seaice
BSD 3-Clause "New" or "Revised" License
6 stars 13 forks source link

Get maxLevelCell from ds, not ds_mesh in viz #101

Closed xylar closed 1 year ago

xylar commented 1 year ago

This is because ds_mesh should only contain horizontal mesh variables.

Checklist

xylar commented 1 year ago

@cbegeman, the ocean/baroclinic_channel/10km/default test case is currently failing with:

Exception raised while running the steps of the test case
Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/main/polaris/run/serial.py", line 310, in _log_and_run_test
    _run_test(test_case, available_resources)
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/main/polaris/run/serial.py", line 409, in _run_test
    _run_step(test_case, step, test_case.new_step_log_file,
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/main/polaris/run/serial.py", line 484, in _run_step
    step.run()
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/main/polaris/ocean/tests/baroclinic_channel/viz.py", line 38, in run
    plot_horiz_field(ds, ds_mesh, 'temperature',
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/main/polaris/viz/__init__.py", line 87, in plot_horiz_field
    raise ValueError(
ValueError: maxLevelCell must be added to ds_mesh before plotting.

While one fix would be to add maxLevelCell to ds_mesh as has been done elsewhere, I think it makes more sense for ds_mesh to contain only horizontal mesh variables. I'm hoping you agree, but I also wasn't at recent OMEGA meetings where this may have been discussed.

In particular, I don't think maxLevelCell can be considered a mesh variable because it should be allowed to change in time (e.g. by remapping).

xylar commented 1 year ago

Testing

I ran this with the following tests and they all passed:

  ocean/baroclinic_channel/10km/default
  ocean/baroclinic_channel/10km/decomp
  ocean/baroclinic_channel/10km/restart
  ocean/baroclinic_channel/10km/threads
  ocean/inertial_gravity_wave/convergence
  ocean/manufactured_solution/convergence
  ocean/single_column/960km/cvmix
  ocean/single_column/960km/ideal_age

I had to manually check the viz steps for inertial_gravity_wave and manufactured_solution, since they don't run automatically in any test.

xylar commented 1 year ago

Great, thanks @cbegeman!