MPAS-Dev / compass

Configuration Of MPAS Setups
Other
10 stars 37 forks source link

Landice interpolation unification #817

Open andrewdnolan opened 4 months ago

andrewdnolan commented 4 months ago

With PRs #803 and #750 the mesh_gen testcases in the greenland and antarctica test groups now make better use of mesh generation utilities within the landice framework (e.g. compass.landice.mesh). But there is still some redundant code as it relates to interpolation (e.g. interp_ais_bedmachine and interp_ais_bedmachine could be generalized to interp_ais). Continuing along that line, there is no real need to have separate interpolation functions for Antarctica (interp_ais) and Greenland (interp_gis).

The purpose of the PR is generalize the existing interpolation functions to be applicable the standard datasets (i.e. measures and bedmachine) and standard icesheets (Antarctica and Greenland). With the generalized interpolation routine, the respective mesh_gen testcases are cleaned up and unified as much as possible.

Checklist

andrewdnolan commented 4 months ago

Testing

Command Run :

compass setup -n 0 45 -w wrkdir

Results

landice/antarctica/mesh_gen
  * step: mesh
  test execution:      SUCCESS
  test runtime:        37:42
landice/greenland/mesh_gen
  * step: mesh
  test execution:      SUCCESS
  test runtime:        15:36
Test Runtimes:
37:42 PASS landice_antarctica_mesh_gen
15:36 PASS landice_greenland_mesh_gen
Total runtime 53:30
PASS: All passed successfully!
trhille commented 3 weeks ago

CI seems to be broken. I'm going to close and reopen to see if that jump-starts it.

trhille commented 3 weeks ago

@andrewdnolan, the landice/antarctica/mesh_gen test passes execution for me. It fails baseline comparison with the current head of compass/main. That's not necessarily a problem, but we should look into it. landice/greenland/mesh_gen fails execution however. Here's the traceback:

Setting cell_width in outer regions to max_spac for 654997 cells
calling preprocess_gridded_data
      Failed
Exception raised while running the steps of the test case
Traceback (most recent call last):
  File "/global/cfs/cdirs/fanssie/users/trhille/compass/compass/run/serial.py", line 322, in _log_and_run_test
    _run_test(test_case, available_resources)
  File "/global/cfs/cdirs/fanssie/users/trhille/compass/compass/run/serial.py", line 419, in _run_test
    _run_step(test_case, step, test_case.new_step_log_file,
  File "/global/cfs/cdirs/fanssie/users/trhille/compass/compass/run/serial.py", line 470, in _run_step
    step.run()
  File "/global/cfs/cdirs/fanssie/users/trhille/compass/compass/landice/tests/greenland/mesh.py", line 89, in run
    preprocessed_gridded_dataset = preprocess_gridded_data(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/fanssie/users/trhille/compass/compass/landice/mesh.py", line 912, in preprocess_gridded_data
    gg.variables['thk'][0, :, :] *= floodFillMask
  File "/pscratch/sd/t/trhille/miniforge3/envs/dev_compass_1.4.0-alpha.7/lib/python3.11/site-packages/numpy/ma/core.py", line 4415, in __imul__
    self._data.__imul__(other_data)
ValueError: operands could not be broadcast together with shapes (2816,1664) (1408,832) (2816,1664) 

Any idea what might be causing this?